Repository navigation
chore(tokens): finish the Infima aliases and read brand tokens on the brand kit - #409
Open
IanoNjuguna wants to merge 2 commits into
Open
IanoNjuguna wants to merge 2 commits into
IanoNjuguna wants to merge 2 commits into
Conversation
custom.css already aliased three Infima tokens to brand values (background-surface-color, font-color-base, emphasis-300). Three more were still resolving to Infima's own greys in components that read them: --ifm-color-emphasis-200 #EBEDF0 light / gray-800 dark -> --color-border --ifm-color-emphasis-100 #F5F6F7 light / gray-900 dark -> --color-surface --ifm-color-emphasis-700 #606770 light / #DADDE1 dark -> --color-text-secondary The last one was the visible drift: in dark mode secondary text came out at Infima's #DADDE1 instead of the brand's Winter Steel #B3C4D4. Both clear AA on the dark surfaces (9.46:1 on midnight, 7.91:1 on shadow), and the light value tightens from 5.72:1 to 8.86:1 on white, so this is a contrast gain in one theme and a colour match in the other. Blast radius is two components plus the brand kit page: MeetupReminderButton (12 declarations, the floating sessions control and its panel) and MermaidDiagramFrame (6). Measured after the change: the panel in dark mode is unchanged (#1E1E1E, moon text, #404040 border, #E0E0E0 prompt) because it carries its own dark block; in light mode the prompt moves from #606770 to #4A4A4A and the row fill from grey to moon. Refs IntersectMBO#376
The page was written against raw Infima. Two consequences were visible in dark mode: - The hero used --ifm-color-primary, which custom.css re-points to --color-link in dark mode. The hero therefore turned #4D91FF at night while the navbar and footer above and below it stayed #2353FF. A brand surface must not follow the theme: it now takes --color-brand-primary. - Secondary text resolved to Infima's grey rather than the brand's. Every remaining emphasis token is now the brand token it stood for, the two #ffffff literals are --color-brand-white, and the hero subtitle drops its rgba white for solid moon (5.04:1 on the blue), which is also what the rule added in IntersectMBO#407 asks for: alpha is for shadows, rings and scrims, not for text. Measured after the change, dark mode: hero #2353FF, h1 #FFFFFF, subtitle #F5F3EB, table body #F5F3EB, secondary and header cells #B3C4D4. No --ifm-color-emphasis-* or literal hex remains in the module. Refs IntersectMBO#376
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.
Description
Third layer of the stack, on top of #408. #408 put the colour roles on the brand kit page; this makes the page read the brand token layer instead of raw Infima, and finishes the aliasing that
custom.cssalready started.Two commits, because they have different blast radii.
1.
custom.css: three more Infima aliases. The file already mappedbackground-surface-color,font-color-baseandemphasis-300to brand values. Three tokens were still resolving to Infima's own greys:--ifm-color-emphasis-200#EBEDF0light / gray-800 dark--color-border--ifm-color-emphasis-100#F5F6F7light / gray-900 dark--color-surface--ifm-color-emphasis-700#606770light /#DADDE1dark--color-text-secondaryThe last row is real drift, not naming: in dark mode secondary text rendered at Infima's
#DADDE1instead of the brand's Winter Steel#B3C4D4.2.
brand-kit.module.css: read the brand tokens, and stop theming the hero. The page was written against raw Infima, and the hero showed it: it used--ifm-color-primary, whichcustom.cssre-points to--color-linkin dark mode, so the hero turned#4D91FFat night while the navbar and footer above and below it stayed#2353FF. A brand surface must not follow the theme.Also drops the hero subtitle's
rgba(255,255,255,0.9)for solid moon, which is what the rule added in #407 asks for: alpha is for shadows, rings and scrims, not for text.Refs #376.
Type of Change
Testing
Checklist
Verification
Built and served locally on 4180, measured in the browser in both themes.
Contrast of the changed text pairs, computed rather than eyeballed:
Every value clears AA, and the light secondary text tightens considerably.
Brand kit page, dark mode, after: hero
#2353FF, h1#FFFFFF, subtitle#F5F3EB, table body#F5F3EB, header and secondary cells#B3C4D4. No--ifm-color-emphasis-*, no--ifm-color-primaryand no literal hex remains inbrand-kit.module.css.Blast radius, checked rather than assumed, since this PR touches a global stylesheet:
Measured on the sessions panel after the change. Dark mode: unchanged at
#1E1E1E, moon text,#404040border,#E0E0E0prompt, because that component carries its own[data-theme='dark']block that outranks the aliases. Mermaid container: transparent, moon border in dark, unchanged.That panel is mounted in
theme/Root.tsx, so it renders on the landing page too, and it is the only thing there that moves. Measured against the live site:#F5F6F7(Infima grey)#F5F3EB(moon)#EBEDF0#E8E8E8#606770(5.72:1)#4A4A4A(8.86:1)Nothing else on the landing page:
index.tsx,Landing,CommunitySectionandTrackscontain zero references to the three aliased tokens. The docs sidebar is also unaffected, becausecustom.csspins.menu__linkto#404040 !important; measured identical before and after, as is the TOC hairline at#E8E8E8.Keeping the moon rows deliberately: the option is a card, and every other card on the site is
--color-surface.Stacking
Base is
feat/brand-kit-roles(#408), which sits ondocs/brand-colour-roles(#407). Merge order is #407, #408, then this. GitHub retargets each one down as its base merges.No CI while stacked:
pr-build-website.ymlonly runs for PRs based onmain. The build and the measurements above are the evidence; CI runs when this retargets.