fix: enforce semantic contrast across admin
Local Build and Deploy / deploy (push) Successful in 44s
Local Build and Deploy / deploy (push) Successful in 44s
This commit is contained in:
1 parent
45c8178cfa
commit
f0b4bc1630
86 files changed
+438
-338
No files matched your search
@@ -27,6 +27,8 @@ export function themePaletteCss(selector: string, palette: ThemePalette): string
|
||||
`--color-text-muted-readable:${readableColor(palette.color_text_muted, [palette.color_background, palette.color_surface])};`,
|
||||
`--color-primary-readable:${readableColor(palette.color_primary, [palette.color_background, palette.color_surface])};`,
|
||||
`--color-accent-readable:${readableColor(palette.color_accent, [palette.color_background, palette.color_surface])};`,
|
||||
`--color-primary-foreground-readable:${semantic.byName.primary};`,
|
||||
`--color-accent-foreground-readable:${semantic.byName.accent};`,
|
||||
`--color-navbar-text-readable:${semantic.byName.navbar};`,
|
||||
`--button-text-color-readable:${semantic.byName["button-primary"]};`,
|
||||
`--button-secondary-text-color-readable:${semantic.byName["button-secondary"]};`,
|
||||
@@ -39,6 +41,18 @@ export function themePaletteCss(selector: string, palette: ThemePalette): string
|
||||
`--color-pill-text-readable:${semantic.byName.pill};`,
|
||||
`--color-badge-text-readable:${semantic.byName.badge};`,
|
||||
`--color-overlay-text-readable:${semantic.byName.overlay};`,
|
||||
`--color-text-subtle-readable:${semantic.byName.subtle};`,
|
||||
`--color-text-disabled-readable:${semantic.byName.disabled};`,
|
||||
`--admin-sidebar-background:${palette.color_navbar};`,
|
||||
`--admin-sidebar-text-readable:${semantic.byName.sidebar};`,
|
||||
`--admin-sidebar-muted-readable:${semantic.byName.sidebar};`,
|
||||
`--admin-input-text-readable:${semantic.byName.input};`,
|
||||
...(["success", "warning", "error", "info"] as const).flatMap((status) => [
|
||||
`--color-${status}-text-readable:${semantic.byName[`${status}-text`]};`,
|
||||
`--color-${status}-foreground-readable:${semantic.byName[`${status}-solid`]};`,
|
||||
`--color-${status}-subtle:color-mix(in srgb, ${palette[`color_${status}`]} 14%, ${palette.color_surface});`,
|
||||
`--color-${status}-border:color-mix(in srgb, ${palette[`color_${status}`]} 38%, transparent);`,
|
||||
]),
|
||||
);
|
||||
return `${selector}{${declarations.join("")}}`;
|
||||
}
|
||||
Reference in new issue
Block a user