Skip to content

Commit 0ff2c62

Browse files
authored
chore: use uikit colors in icons & ds5 theme (#4865)
1 parent f675f61 commit 0ff2c62

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

packages/core/src/themes/ds5.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,33 +49,33 @@ export const ds5 = mergeTheme(ds5Base, {
4949
classes: {
5050
root: {
5151
":where(:not(.HvButton-disabled,.HvButton-contained))": {
52-
"&[data-color=warning]": { color: theme.colors.warning_140 },
52+
"&[data-color=warning]": { color: theme.colors.warningDeep },
5353
},
5454
},
5555
contained: {
5656
":where([data-color=primary]:not(.HvButton-disabled))": {
5757
":hover, &:focus-visible": {
58-
backgroundColor: theme.colors.primary_80,
59-
borderColor: theme.colors.primary_80,
58+
backgroundColor: theme.colors.primaryStrong,
59+
borderColor: theme.colors.primaryStrong,
6060
},
6161
},
6262
":where([data-color=positive]:not(.HvButton-disabled))": {
6363
":hover, &:focus-visible": {
64-
backgroundColor: theme.colors.positive_80,
65-
borderColor: theme.colors.positive_80,
64+
backgroundColor: theme.colors.positiveStrong,
65+
borderColor: theme.colors.positiveStrong,
6666
},
6767
},
6868
":where([data-color=warning]:not(.HvButton-disabled))": {
69-
backgroundColor: theme.colors.warning_120,
69+
backgroundColor: theme.colors.warningStrong,
7070
":hover, &:focus-visible": {
71-
backgroundColor: theme.colors.warning_140,
72-
borderColor: theme.colors.warning_140,
71+
backgroundColor: theme.colors.warningDeep,
72+
borderColor: theme.colors.warningDeep,
7373
},
7474
},
7575
":where([data-color=negative]:not(.HvButton-disabled))": {
7676
":hover, &:focus-visible": {
77-
backgroundColor: theme.colors.negative_80,
78-
borderColor: theme.colors.negative_80,
77+
backgroundColor: theme.colors.negativeStrong,
78+
borderColor: theme.colors.negativeStrong,
7979
},
8080
},
8181
},
@@ -108,10 +108,10 @@ export const ds5 = mergeTheme(ds5Base, {
108108
splitGroup: {
109109
// NEXT5 subtle multi-buttons have a custom background
110110
"& .HvButton-subtle": {
111-
backgroundColor: theme.colors.atmo1,
111+
backgroundColor: theme.colors.bgContainer,
112112
},
113113
"&& .HvButton-disabled": {
114-
backgroundColor: theme.colors.atmo3,
114+
backgroundColor: theme.colors.bgDisabled,
115115
},
116116
},
117117
},
@@ -136,7 +136,7 @@ export const ds5 = mergeTheme(ds5Base, {
136136
classes: {
137137
root: {
138138
"&.HvTab-selected": {
139-
color: theme.colors.secondary,
139+
color: theme.colors.text,
140140
},
141141
},
142142
},
@@ -158,7 +158,7 @@ export const ds5 = mergeTheme(ds5Base, {
158158
padding: 0,
159159
},
160160
"& .HvIconContainer-root": {
161-
color: `${theme.colors.secondary}!important`,
161+
color: `${theme.colors.text}!important`,
162162
},
163163
},
164164
},

packages/icons/scripts/generateComponent.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { HvColor } from "@hitachivantara/uikit-styles";
22

33
const hexColorMap: Record<string, HvColor> = {
4-
"#414141": "secondary",
5-
"#fff": "atmo1",
6-
"#f0f0f0": "atmo2",
7-
"#ccced0": "atmo4",
4+
"#414141": "text", // secondary
5+
"#fff": "bgContainer", // atmo1
6+
"#f0f0f0": "bgPage", // atmo2
7+
"#ccced0": "border", // atmo4
88
};
99

1010
/**

packages/icons/src/IconBase.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ const IconBaseInternal = (
156156
const title = titleProp ?? ariaLabel;
157157

158158
const inheritColor =
159-
!color && palette?.length === 1 && palette?.[0] === "secondary";
159+
!color && palette?.length === 1 && palette?.[0] === "text";
160160

161161
return (
162162
<HvIconContainer

packages/icons/src/IconSprite.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { IconBase, IconBaseProps } from "./IconBase";
44
import { isSelector, isSort } from "./utils";
55

66
const getSecondaryColor = (iconName: string): HvColor => {
7-
if (isSelector(iconName)) return "atmo1";
8-
if (isSort(iconName)) return "atmo4";
7+
if (isSelector(iconName)) return "bgContainer"; // atmo1
8+
if (isSort(iconName)) return "border"; // atmo4
99

10-
return "atmo2";
10+
return "bgPage"; // atmo2
1111
};
1212

1313
export interface HvIconSpriteProps
@@ -28,7 +28,7 @@ export const HvIconSprite = ({
2828
...others
2929
}: HvIconSpriteProps) => {
3030
// this color array is fragile... we know it currently covers all the existing icons
31-
const baseColors: HvColor[] = ["secondary", getSecondaryColor(iconName)];
31+
const baseColors: HvColor[] = ["text", getSecondaryColor(iconName)];
3232

3333
return (
3434
<IconBase iconName={iconName} palette={baseColors} {...others}>

packages/lab/src/Blade/Blade.styles.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const { staticClasses, useClasses } = createClasses("HvBlade", {
1717
zIndex: 0,
1818

1919
color: theme.colors.text,
20-
backgroundColor: theme.colors.atmo1,
20+
backgroundColor: theme.colors.bgContainer,
2121
borderRadius: theme.radii.round,
2222
border: `1px solid ${theme.colors.border}`,
2323
},

0 commit comments

Comments
 (0)