Skip to content
This repository was archived by the owner on Nov 26, 2024. It is now read-only.

Commit 56a5507

Browse files
committed
add hover pressed code and fix alternativePressed
1 parent bce5af3 commit 56a5507

File tree

7 files changed

+60
-24
lines changed

7 files changed

+60
-24
lines changed

src/css/design-tokens.css

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,13 @@
273273

274274
:root {
275275
--color-background-default: var(--brand-colors-white-white000);
276-
--color-background-default-hover: var(--brand-colors-grey-grey030);
277-
--color-background-default-pressed: var(--brand-colors-grey-grey030);
276+
--color-background-default-hover: #fafafa;
277+
--color-background-default-pressed: #ebebeb;
278278
--color-background-alternative: var(--brand-colors-grey-grey040);
279-
--color-background-alternative-hover: var(--brand-colors-grey-grey100);
280-
--color-background-alternative-pressed: var(--brand-colors-grey-grey100);
279+
--color-background-alternative-hover: #edeff1;
280+
--color-background-alternative-pressed: #dfe0e2;
281+
--color-background-hover: #00000005;
282+
--color-background-pressed: #00000014;
281283
--color-text-default: var(--brand-colors-grey-grey800);
282284
--color-text-alternative: var(--brand-colors-grey-grey600);
283285
--color-text-muted: var(--brand-colors-grey-grey200);
@@ -346,11 +348,13 @@
346348

347349
[data-theme='dark'] {
348350
--color-background-default: var(--brand-colors-grey-grey800);
349-
--color-background-default-hover: var(--brand-colors-grey-grey700);
350-
--color-background-default-pressed: var(--brand-colors-grey-grey700);
351+
--color-background-default-hover: #282b2e;
352+
--color-background-default-pressed: #36383b;
351353
--color-background-alternative: var(--brand-colors-grey-grey900);
352-
--color-background-alternative-hover: var(--brand-colors-grey-grey750);
353-
--color-background-alternative-pressed: var(--brand-colors-grey-grey750);
354+
--color-background-alternative-hover: #191b1d;
355+
--color-background-alternative-pressed: #27292a;
356+
--color-background-hover: #ffffff05;
357+
--color-background-pressed: #ffffff14;
354358
--color-text-default: var(--brand-colors-white-white000);
355359
--color-text-alternative: var(--brand-colors-grey-grey100);
356360
--color-text-muted: var(--brand-colors-grey-grey400);

src/figma/tokens.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -848,9 +848,9 @@
848848
"description": "(#EDEFF1) For component hover states that use background/alternative"
849849
},
850850
"alternative-pressed": {
851-
"value": "#DFE0E2)",
851+
"value": "#DFE0E2",
852852
"type": "color",
853-
"description": "(#DFE0E2)) For component pressed states that use background/alternative"
853+
"description": "(#DFE0E2) For component pressed states that use background/alternative"
854854
},
855855
"hover": {
856856
"value": "#00000005",
@@ -1605,10 +1605,6 @@
16051605
},
16061606
"$themes": [],
16071607
"$metadata": {
1608-
"tokenSetOrder": [
1609-
"global",
1610-
"light",
1611-
"dark"
1612-
]
1608+
"tokenSetOrder": ["global", "light", "dark"]
16131609
}
1614-
}
1610+
}

src/js/themes/darkTheme/colors.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ describe('Dark Theme Colors', () => {
4040
);
4141
});
4242

43+
it('js tokens for background.hover matches figma tokens background.hover', () => {
44+
expect(importableColors.background.hover).toStrictEqual(
45+
designTokens.dark.colors.background.hover.value,
46+
);
47+
});
48+
49+
it('js tokens for background.pressed matches figma tokens background.pressed', () => {
50+
expect(importableColors.background.pressed).toStrictEqual(
51+
designTokens.dark.colors.background.pressed.value,
52+
);
53+
});
54+
4355
it('js tokens for text.default matches figma tokens text.default', () => {
4456
expect(importableColors.text.default).toStrictEqual(
4557
designTokens.dark.colors.text.default.value,

src/js/themes/darkTheme/colors.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ import { ThemeColors } from '../types';
77
export const colors: ThemeColors = {
88
background: {
99
default: '#24272A',
10-
defaultHover: '#3B4046',
11-
defaultPressed: '#3B4046',
10+
defaultHover: '#282B2E',
11+
defaultPressed: '#36383B',
1212
alternative: '#141618',
13-
alternativeHover: '#2E3339',
14-
alternativePressed: '#2E3339',
13+
alternativeHover: '#191B1D',
14+
alternativePressed: '#27292A',
15+
hover: '#FFFFFF05',
16+
pressed: '#FFFFFF14',
1517
},
1618
text: {
1719
default: '#FFFFFF',

src/js/themes/lightTheme/colors.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ describe('Light Theme Colors', () => {
4040
);
4141
});
4242

43+
it('js tokens for background.hover matches figma tokens background.hover', () => {
44+
expect(importableColors.background.hover).toStrictEqual(
45+
designTokens.light.colors.background.hover.value,
46+
);
47+
});
48+
49+
it('js tokens for background.pressed matches figma tokens background.pressed', () => {
50+
expect(importableColors.background.pressed).toStrictEqual(
51+
designTokens.light.colors.background.pressed.value,
52+
);
53+
});
54+
4355
it('js tokens for text.default matches figma tokens text.default', () => {
4456
expect(importableColors.text.default).toStrictEqual(
4557
designTokens.light.colors.text.default.value,

src/js/themes/lightTheme/colors.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ import { ThemeColors } from '../types';
77
export const colors: ThemeColors = {
88
background: {
99
default: '#FFFFFF',
10-
defaultHover: '#FAFBFC',
11-
defaultPressed: '#FAFBFC',
10+
defaultHover: '#FAFAFA',
11+
defaultPressed: '#EBEBEB',
1212
alternative: '#F2F4F6',
13-
alternativeHover: '#D6D9DC',
14-
alternativePressed: '#D6D9DC',
13+
alternativeHover: '#EDEFF1',
14+
alternativePressed: '#DFE0E2',
15+
hover: '#00000005',
16+
pressed: '#00000014',
1517
},
1618
text: {
1719
default: '#24272A',

src/js/themes/types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ export interface ThemeColors {
4747
* {string} background.alternativePressed - For component pressed states that use background/alternative
4848
*/
4949
alternativePressed: string;
50+
/**
51+
* {string} background.hover - For component hover states that don't have a background color
52+
*/
53+
hover: string;
54+
/**
55+
* {string} background.pressed - For component pressed states that don't have a background color
56+
*/
57+
pressed: string;
5058
};
5159
text: {
5260
/**

0 commit comments

Comments
 (0)