Repository navigation
AA contrast: dark text on orange fills, darker orange text (was 2.29:1) - #3
Merged
Merged
Conversation
…unneeded auto-dark secondary override
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.
Fixes the cross-site contrast item from UI UX's audit (README item 1, btcdecoded-website P1): white text on Bitcoin orange
#f7931ais 2.29:1, which fails WCAG AA 4.5:1. That pair is on the checkout CTAs ("Start trial", "Continue with GitHub" on /subscribe and /account) and the secondary buttons. It was reported against plebly.fund in the room, but plebly.fund has no white-on-orange text. The pair lives here (and on the benchmarks page, not touched in this PR).Change (CSS only)
Two new tokens, following the Commons site's dark-text-on-orange approach. The fill colour is unchanged, so the brand orange stays.
--on-orange: #111111. It's now the text colour on every orange fill:.btn-primary,.btn-secondary:hover,.platform-tab.active,.release-badge,.governance-badge,.auth-session__avatar,.book-cover. It's 8.22:1 on#f7931aand 6.80:1 on the#e6820ahover/gradient end.--orange-text-on-light: #a35400. It's now.btn-secondary's text colour. It's 5.45:1 on white and 5.21:1 on the#fff8f0warm panel; it was 2.29:1 and 2.18:1.Ratios use the WCAG 2.x relative-luminance formula; they're noted next to the tokens. Applied to
components/styles.css(the Next app) and the legacycss/styles.css.Tests
CSS-only change; the repo has no style tests. I didn't run
next build.Live recheck: on btcdecoded.org/subscribe and /account, "Start trial" and "Continue with GitHub" show dark text on orange. "Continue with Nostr" and "See Intelligence" show darker orange text and turn dark-on-orange on hover. The install page's platform tabs and the release/governance badges show dark text.
Donate: n/a.
@review default scope. @ui UX
Update (ea71508): opt out of Auto Dark
color-scheme: only lightonhtmland<meta name="color-scheme" content="only light">inpages/_document.js. This is Chrome's documented opt-out (Auto Dark Theme blog, Chrome 98, and the CSS Color Adjust spec). With it, the page stays light, so.btn-primarykeeps#111on#f7931a(8.22:1) and.btn-secondarykeeps#a35400(5.45:1 on white).html.auto-dark { --orange-text-on-light: #f7931a }override from 0ae705c; the opt-out replaces it.html.auto-darkrules (logo swap, nav toggle) and the probe in_document.js. Browsers that ignore the opt-out still add the class, and those rules still matter there.next buildpasses.docs/was not touched; the Pages workflow rebuilds it.Headless check: the forced-dark render could not confirm the opt-out. Desktop Chrome 155 with
--enable-features=WebContentsForceDarkdarkens even a minimal two-line page that setsonly lightin both the meta tag and:root(white rendered as #121212, the same as a page without it). This desktop flag is a user override that ignores the page's opt-out, so this harness can't test it. The opt-out is aimed at Android Chrome's Auto Dark Theme and WebView, which I can't run here. Under that desktop flag only (page still darkened):.btn-primaryis computed#111on#f7931abut renders#ffffffon#f7931a: 2.30:1. Chrome rewrites the label, and no page CSS can stop it..btn-secondaryis computed#a35400and renders#e08737on#231f19: 6.0:1, or 6.86:1 on#121212on /subscribe.Live recheck: on an Android phone with Chrome's dark theme / Auto Dark on, btcdecoded.org should stay light. "Start trial" shows dark text on orange, and "See plans" shows dark-orange text.