Skip to content

Commit

Permalink
Add <meta name='color-scheme'>
Browse files Browse the repository at this point in the history
The [`color-scheme` meta tag][0] provides a signal to the browser about
what color schemes the website supports it. Without it, browsers default
to light mode, which means that viewing the page before any CSS has
loaded will produce a white background even if the device is in dark
mode.

The `color-scheme` meta tag activates the browser's awareness of the
OS's color preferences, thus it will choose a dark background for
unstyled content, preventing the flash of white.

[0]: https://html.spec.whatwg.org/multipage/semantics.html#meta-color-scheme
  • Loading branch information
noelleleigh committed Nov 27, 2024
1 parent 8e4ee48 commit fa5d21d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ build(FILE *f, Lexicon *l, char *name, char *srcpath)
"<meta charset='utf-8'>"
"<meta name='thumbnail' content='" DOMAIN "media/services/rss.jpg' />"
"<meta name='viewport' content='width=device-width,initial-scale=1'>"
"<meta name='color-scheme' content='light dark'>"
"<link rel='alternate' type='application/rss+xml' title='RSS Feed' "
"href='../links/rss.xml' />"
"<link rel='stylesheet' type='text/css' href='../links/main.css'>"
Expand Down

0 comments on commit fa5d21d

Please sign in to comment.