Skip to content

chore(tokens): finish the Infima aliases and read brand tokens on the brand kit - #409

Open
IanoNjuguna wants to merge 2 commits into
IntersectMBO:feat/brand-kit-rolesfrom
IanoNjuguna:feat/brand-token-uniformity
Open

IanoNjuguna wants to merge 2 commits into
IntersectMBO:feat/brand-kit-rolesfrom
IanoNjuguna:feat/brand-token-uniformity

Conversation

@IanoNjuguna

@IanoNjuguna IanoNjuguna commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

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.css already started.

Two commits, because they have different blast radii.

1. custom.css: three more Infima aliases. The file already mapped background-surface-color, font-color-base and emphasis-300 to brand values. Three tokens were still resolving to Infima's own greys:

Token Resolved to Now
--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 row is real drift, not naming: in dark mode secondary text rendered at Infima's #DADDE1 instead 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, which custom.css re-points to --color-link in dark mode, so the hero turned #4D91FF at 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Testing

  • I have tested these changes locally
  • I have checked for broken links
  • Code examples have been tested

Checklist

  • My code follows the style guidelines
  • I have performed a self-review
  • I have made corresponding changes to documentation
  • My changes generate no new warnings

Verification

Built and served locally on 4180, measured in the browser in both themes.

Contrast of the changed text pairs, computed rather than eyeballed:

#606770 on #FFFFFF  5.72  ->  #4A4A4A on #FFFFFF  8.86   (light secondary text)
#DADDE1 on #2C2B2B 10.36  ->  #B3C4D4 on #2C2B2B  7.91   (dark, on shadow)
                             #B3C4D4 on #1D1D1B  9.46   (dark, on midnight)
                             #4A4A4A on #F5F6F7  8.19   (light, on the old row fill)

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-primary and no literal hex remains in brand-kit.module.css.

Blast radius, checked rather than assumed, since this PR touches a global stylesheet:

MeetupReminderButton/styles.module.css    12 declarations
MermaidDiagramFrame/styles.module.css      6 declarations
brand-kit.module.css                       1 (now swapped for the brand token)

Measured on the sessions panel after the change. Dark mode: unchanged at #1E1E1E, moon text, #404040 border, #E0E0E0 prompt, 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:

Element in the panel Before After
Header and option row fill #F5F6F7 (Infima grey) #F5F3EB (moon)
Option border #EBEDF0 #E8E8E8
"Choose which session" prompt #606770 (5.72:1) #4A4A4A (8.86:1)

Nothing else on the landing page: index.tsx, Landing, CommunitySection and Tracks contain zero references to the three aliased tokens. The docs sidebar is also unaffected, because custom.css pins .menu__link to #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 on docs/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.yml only runs for PRs based on main. The build and the measurements above are the evidence; CI runs when this retargets.

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
@IanoNjuguna IanoNjuguna added the documentation Improvements or additions to documentation label Nov 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant