Repository navigation
feat: enable light/dark theme toggle - #669
Open
SCARPxVeNOM wants to merge 1 commit into
Open
SCARPxVeNOM wants to merge 1 commit into
SCARPxVeNOM wants to merge 1 commit into
Conversation
Set appearance.strict to false so Mintlify's built-in theme toggle renders, and darken colors.primary to #8A7500 so light-mode emphasis text meets WCAG AA on white (4.54:1; #F0DB4F measured 1.40:1). colors.light is unchanged, so dark mode is unaffected. Closes leonardomso#667
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The docs site is dark-only because
appearance.strict: trueremoves Mintlify's built-in light/dark toggle. This enables the toggle and adjusts the light-mode accent colour so that light mode is actually readable.Closes #667
The change
"appearance": { "default": "dark", - "strict": true + "strict": false }, "colors": { - "primary": "#F0DB4F", + "primary": "#8A7500", "light": "#F0DB4F", "dark": "#C9B83C" },Two lines in
docs/docs.json. No new dependencies, no CSS, no JS.Why the colour change is part of this
Flipping
stricton its own ships a broken light mode.In Mintlify,
colors.primaryis the emphasis colour used in light mode, whilecolors.lightis the one used in dark mode — easy to read backwards. Both were set to#F0DB4F(JS yellow). Yellow on a white background measures 1.40:1, against the WCAG AA minimum of 4.5:1 for body text. It went unnoticed because light mode was unreachable.Measured in the browser on
/at 14px:#8A7500is close to the lightest value that holds the JS-yellow hue while clearing 4.5:1 on white, so the brand colour is kept as far as the contrast requirement allows.Dark mode is untouched.
colors.lightstill carries#F0DB4F, measured at 14.95:1 on black both before and after.appearance.defaultstays"dark", so existing visitors see exactly what they see today — the toggle is simply now available to those who want it.I checked that
colors.primaryis not used as a button background anywhere before darkening it; it appears as text colour, 1.5px active-indicator bars, and icon fills only.Screenshots
1. Light mode with the existing palette — accent text at 1.40:1, fails WCAG AA
2. Light mode with
colors.primaryset to#8A7500— 4.54:1, passes AA3. Dark mode — unchanged
Both light-mode shots already include the toggle, since
strict: falsewas applied for all of them. They show why the colour adjustment is needed, not the state of the live site — on https://33jsconcepts.com today, light mode cannot be reached at all.How to verify
npm run docs # open the local preview, then use the toggle in the top-leftContrast ratios were measured in the page via
getComputedStyle, with colours resolved through a canvas (the theme emits someoklch()values that a naivergb()parse gets wrong). A sweep of all 114 visible text nodes returns zero failures in both modes, other than the item below.Out of scope
Mintlify's own "Powered by Mintlify" footer measures 2.56:1 in light mode and 4.42:1 in dark. That is vendor chrome rather than anything
docs.jsoncontrols, so I have left it alone.Open question
I kept
appearance.defaultas"dark"to avoid changing the default experience. Mintlify's own default is"system", which follows each visitor's OS preference. Happy to switch it in this PR if you would prefer that — it seemed like your call rather than mine.