diff --git a/.changeset/template-contrast.md b/.changeset/template-contrast.md new file mode 100644 index 000000000..31d9ed633 --- /dev/null +++ b/.changeset/template-contrast.md @@ -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`. diff --git a/quartz.config.default.yaml b/quartz.config.default.yaml index 2f57c6e71..6e4b6a776 100644 --- a/quartz.config.default.yaml +++ b/quartz.config.default.yaml @@ -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" diff --git a/quartz/cli/templates/blog.yaml b/quartz/cli/templates/blog.yaml index 2113333a5..9e0b21ca0 100644 --- a/quartz/cli/templates/blog.yaml +++ b/quartz/cli/templates/blog.yaml @@ -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" diff --git a/quartz/cli/templates/default.yaml b/quartz/cli/templates/default.yaml index a11bdd826..549b8a455 100644 --- a/quartz/cli/templates/default.yaml +++ b/quartz/cli/templates/default.yaml @@ -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" diff --git a/quartz/cli/templates/docs.yaml b/quartz/cli/templates/docs.yaml index 383c11bc0..2521cc4a4 100644 --- a/quartz/cli/templates/docs.yaml +++ b/quartz/cli/templates/docs.yaml @@ -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" diff --git a/quartz/cli/templates/obsidian.yaml b/quartz/cli/templates/obsidian.yaml index f42cd6643..0d8bfda4e 100644 --- a/quartz/cli/templates/obsidian.yaml +++ b/quartz/cli/templates/obsidian.yaml @@ -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" diff --git a/quartz/cli/templates/ttrpg.yaml b/quartz/cli/templates/ttrpg.yaml index f7ed3c244..44c594dd4 100644 --- a/quartz/cli/templates/ttrpg.yaml +++ b/quartz/cli/templates/ttrpg.yaml @@ -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" diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss index 3c9af09d7..a5116ab85 100644 --- a/quartz/styles/base.scss +++ b/quartz/styles/base.scss @@ -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); }