feat(website): Allow additional CSS to replace or augment CSS in generated HTML - #288
Merged
Merged
Conversation
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
hickey
force-pushed
the
feat/generate-local-css
branch
from
September 17, 2026 02:17
7cdbb6b to
a03834d
Compare
- Emit the --link-css <link> after the built-in <style> block. It was placed before it, so built-in rules won every tie and a linked :root override had no effect. - Drop the unreachable replace-only branches. --style always resolves to a built-in style, so custom CSS always layers on top of one. - Read --embed-css in main() and exit 1 if it can't be read, before plugins load, instead of logging and silently falling back. The file contents are passed to generate_html() as custom_css. - Allow --link-css and --embed-css together (embedded first, linked last) instead of silently dropping --embed-css. - HTML-escape the --link-css href. - Pass both options through to --sample pages. - Restore byte-identical default output (no stray blank line in <head>). - Rework tests: cascade order, escaping, both flags together, every style, main() failing on an unreadable file and wiring --sample.
- Describe the actual cascade order, how relative --link-css and --embed-css paths resolve, and the error on an unreadable file. - Remove the "without --style" custom design case, which isn't possible. - Note that --sample pages pick up custom CSS, and that --link-css pages need the stylesheet uploaded alongside index.html. - Demote the CSS architecture section from a second H1 to H2. - Mark theme variables that no base rule uses, and note where !important and hard-coded colors limit variable-only overrides. - Smooth scrolling comes from CSS scroll-behavior, not JavaScript. - Tighten the changelog entry.
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.
What this changes
This adds the ability for a CSS file to replace or augment the CSS that is in the HTML generated by
generate_website.py.Why
Provide the end user the ability to customize the the generated HTML to suite their tastes and/or integrate into an existing website better.
Testing
Tests have been added and using the output currently.
Checklist
devand targetingdevmake testpassesmake lintpasses (ruff + mypy)Frontend lint passes if templates changed (npm run lint:frontend)CHANGELOG.mdupdated under## [Unreleased]if user-visibleConfig changes are reflected inconfig.ini.example(and the minimal/quickstarttemplates where relevant) — CI validates these with
validate_config.py --strictNew docs pages are added tonav:inmkdocs.ymlAny new command justifies its airtime and defaults conservatively