Skip to content

refactor(docs): fold brand CSS into MonorailCSS utility compositions#13

Merged
phil-scott-78 merged 1 commit into
mainfrom
docs/brand-styling-utility-compositions
Jul 12, 2026
Merged

refactor(docs): fold brand CSS into MonorailCSS utility compositions#13
phil-scott-78 merged 1 commit into
mainfrom
docs/brand-styling-utility-compositions

Conversation

@phil-scott-78

Copy link
Copy Markdown
Contributor

What

Refactors how the docs site's brand styling is authored, without changing the rendered result. BrandStyling now feeds MonorailCSS in two forms, split by what each is actually good at:

  • Applies (new) — component classes as utility compositions (CssFrameworkSettings.Applies: selector → space-separated utilities, expanded into @layer components). This absorbs the repetitive box-model + colour + .dark/:hover twin CSS, folding each variant pair into a single dark:/hover: value. Covers the syntax tokens, lazy gallery slots, syntax-chip filters, API nav links, and the icon gallery cards.
  • ExtraStyles — keeps only the genuine residue that isn't utility-shaped: at-rules (@keyframes, @starting-style, @media), pseudo-elements (::backdrop, ::-webkit-scrollbar), --beck-* token / colour-scheme tables, and literals a utility wouldn't clarify (the dot-grid radial gradient, color-mix scrims).

Program.cs wires Applies in via CustomCssFrameworkSettings.

The playground toolbar (PlaygroundIsland.razor) and the lightbox chrome (site.js) move to utility classes directly on their elements. .beck-lightbox survives only as the hook for the ::backdrop / @starting-style / cloned-SVG sizing that utilities can't express.

Packaging

Pins MonorailCss 0.1.3 explicitly (Directory.Packages.props + an explicit PackageReference in Beck.Docs.csproj) for Applies bug fixes not yet flowed through Pennington.

Notes

  • Docs-site only; the engine, tests, and NuGet packages are untouched.
  • Both forms still resolve from the mapped primary/accent/base palette variables and flip under .dark, so the CSS themes itself as before.
  • dotnet build Beck.slnx -c Release passes; the compile confirms the Applies / CustomCssFrameworkSettings API resolves in MonorailCss 0.1.3.

Split BrandStyling's declarative CSS into two forms by what each is good
at. The repetitive box-model + colour + .dark/:hover twin rules move into
a new `Applies` map (CssFrameworkSettings.Applies: selector -> utility
string, expanded into @layer components), folding each variant pair into
one dark:/hover: value. Program.cs wires it via CustomCssFrameworkSettings.
ExtraStyles keeps only the genuine residue: at-rules, pseudo-elements,
--beck-* token tables, and gnarly literals a utility wouldn't clarify.

The playground toolbar (PlaygroundIsland.razor) and the lightbox chrome
(site.js) move to utility classes directly on their elements; the
`.beck-lightbox` hook stays only for the ::backdrop / @starting-style /
cloned-svg sizing that utilities can't reach.

Pin MonorailCss 0.1.3 explicitly (Directory.Packages.props +
Beck.Docs.csproj) for the Applies bug fixes not yet flowed through
Pennington.
@phil-scott-78
phil-scott-78 merged commit c37d2f7 into main Jul 12, 2026
1 check passed
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