Merge pull request #2695 from jackyzha0/a11y/template-contrast

fix(a11y): template colours meet WCAG AA contrast in light and dark mode
This commit is contained in:
Emile Bangma authored and GitHub committed 2026-11-26 12:53:05 +01:00
commit a5b07e3c48
8 files changed
+25 -19

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
The templates' colours meet WCAG AA contrast (4.5:1) on their backgrounds. Light `gray` goes from #b8b8b8 to #727272 (was 1.9:1), dark `gray` from #646464 to #7f7f7f (was 3.1:1), and light `tertiary`, the link hover colour, from #84a59d to #587971 (was 2.5:1). Text selection mixes 40% of `tertiary` instead of 60%, so text stays readable on it in both modes. Existing sites keep the colours in their own `quartz.config.yaml`.
+3 -3
View File
@@ -24,17 +24,17 @@ configuration:
lightMode:
light: "#faf8f8"
lightgray: "#e5e5e5"
gray: "#b8b8b8"
gray: "#727272"
darkgray: "#4e4e4e"
dark: "#2b2b2b"
secondary: "#284b63"
tertiary: "#84a59d"
tertiary: "#587971"
highlight: rgba(143, 159, 169, 0.15)
textHighlight: "#fff23688"
darkMode:
light: "#161618"
lightgray: "#393639"
gray: "#646464"
gray: "#7f7f7f"
darkgray: "#d4d4d4"
dark: "#ebebec"
secondary: "#7b97aa"
+3 -3
View File
@@ -25,17 +25,17 @@ configuration:
lightMode:
light: "#faf8f8"
lightgray: "#e5e5e5"
gray: "#b8b8b8"
gray: "#727272"
darkgray: "#4e4e4e"
dark: "#2b2b2b"
secondary: "#284b63"
tertiary: "#84a59d"
tertiary: "#587971"
highlight: rgba(143, 159, 169, 0.15)
textHighlight: "#fff23688"
darkMode:
light: "#161618"
lightgray: "#393639"
gray: "#646464"
gray: "#7f7f7f"
darkgray: "#d4d4d4"
dark: "#ebebec"
secondary: "#7b97aa"
+3 -3
View File
@@ -25,17 +25,17 @@ configuration:
lightMode:
light: "#faf8f8"
lightgray: "#e5e5e5"
gray: "#b8b8b8"
gray: "#727272"
darkgray: "#4e4e4e"
dark: "#2b2b2b"
secondary: "#284b63"
tertiary: "#84a59d"
tertiary: "#587971"
highlight: rgba(143, 159, 169, 0.15)
textHighlight: "#fff23688"
darkMode:
light: "#161618"
lightgray: "#393639"
gray: "#646464"
gray: "#7f7f7f"
darkgray: "#d4d4d4"
dark: "#ebebec"
secondary: "#7b97aa"
+3 -3
View File
@@ -26,17 +26,17 @@ configuration:
lightMode:
light: "#faf8f8"
lightgray: "#e5e5e5"
gray: "#b8b8b8"
gray: "#727272"
darkgray: "#4e4e4e"
dark: "#2b2b2b"
secondary: "#284b63"
tertiary: "#84a59d"
tertiary: "#587971"
highlight: rgba(143, 159, 169, 0.15)
textHighlight: "#fff23688"
darkMode:
light: "#161618"
lightgray: "#393639"
gray: "#646464"
gray: "#7f7f7f"
darkgray: "#d4d4d4"
dark: "#ebebec"
secondary: "#7b97aa"
+3 -3
View File
@@ -25,17 +25,17 @@ configuration:
lightMode:
light: "#faf8f8"
lightgray: "#e5e5e5"
gray: "#b8b8b8"
gray: "#727272"
darkgray: "#4e4e4e"
dark: "#2b2b2b"
secondary: "#284b63"
tertiary: "#84a59d"
tertiary: "#587971"
highlight: rgba(143, 159, 169, 0.15)
textHighlight: "#fff23688"
darkMode:
light: "#161618"
lightgray: "#393639"
gray: "#646464"
gray: "#7f7f7f"
darkgray: "#d4d4d4"
dark: "#ebebec"
secondary: "#7b97aa"
+3 -3
View File
@@ -25,17 +25,17 @@ configuration:
lightMode:
light: "#faf8f8"
lightgray: "#e5e5e5"
gray: "#b8b8b8"
gray: "#727272"
darkgray: "#4e4e4e"
dark: "#2b2b2b"
secondary: "#284b63"
tertiary: "#84a59d"
tertiary: "#587971"
highlight: rgba(143, 159, 169, 0.15)
textHighlight: "#fff23688"
darkMode:
light: "#161618"
lightgray: "#393639"
gray: "#646464"
gray: "#7f7f7f"
darkgray: "#d4d4d4"
dark: "#ebebec"
secondary: "#7b97aa"
+2 -1
View File
@@ -51,7 +51,8 @@ body {
border-radius: 5px;
}
::selection {
background: color-mix(in srgb, var(--tertiary) 60%, rgba(255, 255, 255, 0));
// 40%: text stays readable on it (4.5:1 for --darkgray in both default palettes).
background: color-mix(in srgb, var(--tertiary) 40%, rgba(255, 255, 255, 0));
color: var(--darkgray);
}