Skip to content

CSS cleanup for syntax.html - #409

Open
clarfonthey wants to merge 3 commits into
jgm:mainfrom
clarfonthey:syntax-css
Open

CSS cleanup for syntax.html#409
clarfonthey wants to merge 3 commits into
jgm:mainfrom
clarfonthey:syntax-css

Conversation

@clarfonthey

Copy link
Copy Markdown

Split into three commits:

  1. Removes unused CSS rules
  2. Replaces usage of foreground colour with currentColor (supported since 2010, 98% browser usage)
  3. Adds light-dark syntax to add dark mode styles (uses fallback since this standard is from 2024-ish, 88% usage)

Not actually sure you care that much about browser support for these features, but figured I'd be conservative anyway while making it so that the CSS is easy to modify if needed.

Comment thread doc/syntax.html
color: light-dark(#1a1a1a, #fdfdfd);
background-color: #fdfdfd;
background-color: light-dark(#fdfdfd, #1a1a1a);
color-scheme: light dark;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is required to tell the browser the website actually supports dark mode. It's still only used if the browser requests it.

@jgm

jgm commented Aug 25, 2026

Copy link
Copy Markdown
Owner

syntax.html is actually a generated file (see the Makefile rule for it). The CSS is produced by pandoc (it's part of the default pandoc HTML template). (You could consider making a PR there...data/templates/styles.html)

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.

2 participants