Skip to content

refactor: move the homepage layout into the shared stylesheet - #24

Merged
imran-siddique merged 1 commit into
mainfrom
refactor/one-stylesheet-one-palette
Aug 21, 2026
Merged

refactor: move the homepage layout into the shared stylesheet#24
imran-siddique merged 1 commit into
mainfrom
refactor/one-stylesheet-one-palette

Conversation

@imran-siddique

Copy link
Copy Markdown
Member

design-system.css already states the intent:

Every standalone page under agentrust-io.com opts in with <body class="at-page"> and then writes no CSS of its own. The hub keeps .agentrust-hub; MkDocs keeps the .md-* rules above. Adding a page means adding markup, not a stylesheet.

The homepage was the one page still writing its own. It carried a 478-line <style> block on a second token set (--bg, --surface, --border, --navy, --body, --muted, --red, --blue, --green, --amber, --purple, --orange), which the .agentrust-hub rules in design-system.css then repainted with the editorial --at-* tokens. Two palettes for one estate, and 64 declarations painted twice.

What changed

  • Every rule from the inline block is scoped to .agentrust-hub and moved into design-system.css, immediately above the editorial layer that refines it, so the cascade order the page relies on is unchanged.
  • The twelve private tokens map onto the shared ones. --red, --navy and --blue were already byte-identical to their --at- counterparts, and --green/--amber matched --at-pass/--at-warn. --purple and --orange had no equivalent and are now --at-purple/--at-orange in the shared token block.
  • 64 dead declarations removed — painted in index.html, painted again in design-system.css.
  • .hero p carried color: rgba(255,255,255,0.68) left over from the navy hero that preceded the editorial design. Scoping the rule raised its specificity enough to shadow the accent on .hero-eyebrow, so the dead colour goes.
  • scroll-behavior: smooth sat on a bare html selector inside the page's own stylesheet. Moved as-is it would have newly changed anchor scrolling on all six MkDocs sites, which have Material's own behaviour, so it is scoped to the hub.

index.html goes from 1262 lines to 783 and carries no CSS at all. Total across both files is unchanged, which is the honest number: this consolidates and de-duplicates rather than deletes.

Verification

Not eyeballed. The pre-refactor index.html and design-system.css were served from the same origin alongside the new ones, and 501 elements were compared across 31 computed properties plus measured width and height. Zero differences. The .at-page layer and the MkDocs surfaces are byte-identical to before, so the other four site pages and all six docs sites are untouched.

Opening this as a PR rather than pushing to main, per the branch ruleset on this repo.

🤖 Generated with Claude Code

https://claude.ai/code/session_013EQx4N5BzTQbY8kvXUsdkY

index.html carried a 478-line <style> block with its own token set
(--bg, --surface, --border, --navy, --body, --muted, --red, --blue,
--green, --amber, --purple, --orange), which the .agentrust-hub rules in
design-system.css then repainted with the editorial --at-* tokens. Two
palettes for one estate, and 64 declarations painted twice.

design-system.css already states the intent: "Every standalone page under
agentrust-io.com opts in with <body class="at-page"> and then writes no
CSS of its own." The homepage was the one page still writing its own.

- Every rule from the inline block is now scoped to .agentrust-hub and
  sits in design-system.css, immediately above the editorial layer that
  refines it, so the cascade order the page relies on is unchanged.
- The twelve private tokens map onto the shared ones. --red, --navy and
  --blue were already byte-identical to their --at- counterparts, and
  --green and --amber matched --at-pass and --at-warn. --purple and
  --orange had no equivalent and are now named --at-purple and
  --at-orange in the shared token block.
- 64 declarations the editorial layer restates are removed. They were
  dead: painted in index.html, painted again in design-system.css.
- .hero p carried color: rgba(255,255,255,0.68) from the navy hero that
  preceded the editorial design. Scoping the rule raised its specificity
  enough to shadow the accent on .hero-eyebrow, so the dead colour goes.
- scroll-behavior: smooth was on a bare html selector inside the page's
  own stylesheet. Moved as-is it would have newly changed anchor
  scrolling on all six MkDocs sites, so it is scoped to the hub.

index.html goes from 1262 lines to 783 and now carries no CSS at all.

Verified rendering-identical: 501 elements compared across 31 computed
properties plus measured width and height, before and after, same
origin. Zero differences.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013EQx4N5BzTQbY8kvXUsdkY
@imran-siddique
imran-siddique merged commit 81c978a into main Aug 21, 2026
1 check passed
@imran-siddique
imran-siddique deleted the refactor/one-stylesheet-one-palette branch August 21, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant