♻️(react) update token.ts to handles themes

Some components were using wrong design tokens and this was noticed
only when changing themes, like using hard-coded "white" instead of
"greyscale-000".
This commit is contained in:
Nathan Vasse
2023-09-26 11:38:47 +02:00
committed by NathanVss
parent cce8eccf5b
commit e2c0d3259b
7 changed files with 10 additions and 9 deletions

View File

@@ -2,7 +2,7 @@ import { DefaultTokens } from "@openfun/cunningham-tokens";
export const tokens = (defaults: DefaultTokens) => ({
"background-color--hover": defaults.theme.colors["greyscale-200"],
"background-color": "white",
"background-color": defaults.theme.colors["greyscale-000"],
"font-size": defaults.theme.font.sizes.m,
"font-weight": defaults.theme.font.weights.medium,
color: defaults.theme.colors["greyscale-900"],

View File

@@ -18,8 +18,8 @@ export const tokens = (defaults: DefaultTokens) => ({
"item-background-color--selected": defaults.theme.colors["primary-100"],
"item-color": defaults.theme.colors["greyscale-800"],
"item-font-size": defaults.theme.font.sizes.l,
"background-color": "white",
"menu-background-color": "white",
"background-color": defaults.theme.colors["greyscale-000"],
"menu-background-color": defaults.theme.colors["greyscale-000"],
"range-selection-background-color": defaults.theme.colors["primary-100"],
"range-selection-background-color--disabled":
defaults.theme.colors["greyscale-100"],

View File

@@ -1,7 +1,7 @@
import { DefaultTokens } from "@openfun/cunningham-tokens";
export const tokens = (defaults: DefaultTokens) => ({
"background-color": "white",
"background-color": defaults.theme.colors["greyscale-000"],
"border-color": defaults.theme.colors["greyscale-300"],
"border-radius": "0.5rem",
"border-width": "2px",
@@ -18,7 +18,7 @@ export const tokens = (defaults: DefaultTokens) => ({
"file-border-color": defaults.theme.colors["greyscale-300"],
"file-border-width": "1px",
"file-border-radius": "0.5rem",
"file-background-color": "white",
"file-background-color": defaults.theme.colors["greyscale-000"],
"file-specs-size": "0.6875rem",
"file-specs-color": defaults.theme.colors["greyscale-600"],
});

View File

@@ -12,7 +12,7 @@ export const tokens = (defaults: DefaultTokens) => ({
"border-color--focus": defaults.theme.colors["primary-600"],
"border-style": "solid",
"label-color--focus": defaults.theme.colors["primary-600"],
"background-color": "white",
"background-color": defaults.theme.colors["greyscale-000"],
"value-color": defaults.theme.colors["greyscale-900"],
"value-color--disabled": defaults.theme.colors["greyscale-800"],
});

View File

@@ -3,5 +3,5 @@ import { DefaultTokens } from "@openfun/cunningham-tokens";
export const tokens = (defaults: DefaultTokens) => ({
"border-color": defaults.theme.colors["greyscale-300"],
"accent-color": defaults.theme.colors["success-600"],
"background-color": "white",
"background-color": defaults.theme.colors["greyscale-000"],
});

View File

@@ -58,6 +58,7 @@
margin: 0;
color: var(--c--components--forms-select--color);
font-size: var(--c--components--forms-select--font-size);
background-color: var(--c--components--forms-select--background-color);
}
}

View File

@@ -18,8 +18,8 @@ export const tokens = (defaults: DefaultTokens) => ({
"item-color": defaults.theme.colors["greyscale-800"],
"item-color--disabled": defaults.theme.colors["greyscale-500"],
"item-font-size": defaults.theme.font.sizes.l,
"background-color": "white",
"menu-background-color": "white",
"background-color": defaults.theme.colors["greyscale-000"],
"menu-background-color": defaults.theme.colors["greyscale-000"],
"label-color--focus": defaults.theme.colors["primary-600"],
"multi-pill-background-color": defaults.theme.colors["greyscale-200"],
"multi-pill-border-radius": "2px",