Skip to content

Commit 3426192

Browse files
committed
feat: add contrast bg theme for black mode
1 parent 9fb44c4 commit 3426192

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

app/assets/main.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@
6464
--bg-elevated: oklch(0.252 0.007 34.298);
6565
}
6666

67+
:root[data-theme='dark'][data-bg-theme='contrast'] {
68+
--bg: oklch(0 0 0);
69+
--bg-subtle: oklch(0.148 0 0);
70+
--bg-muted: oklch(0.204 0 0);
71+
--bg-elevated: oklch(0.264 0 0);
72+
}
73+
6774
:root[data-theme='light'] {
6875
--bg: var(--bg-color, oklch(1 0 0));
6976
--bg-subtle: var(--bg-subtle-color, oklch(0.979 0.001 286.375));

shared/utils/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ export const BACKGROUND_THEMES = {
4040
stone: 'oklch(0.555 0.013 58.123)',
4141
zinc: 'oklch(0.555 0.016 285.931)',
4242
slate: 'oklch(0.555 0.046 257.407)',
43+
contrast: 'oklch(0.4 0 0)',
4344
} as const

test/nuxt/a11y.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,6 +1808,8 @@ describe('background theme accessibility', () => {
18081808
['dark', 'zinc'],
18091809
['light', 'slate'],
18101810
['dark', 'slate'],
1811+
['light', 'contrast'],
1812+
['dark', 'contrast'],
18111813
] as const
18121814

18131815
function applyTheme(colorMode: string, bgTheme: string | null) {

0 commit comments

Comments
 (0)