Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
scy
@scy@chaos.social  路  activity timestamp 6 days ago

By the way, if your website only uses minimal styling, or no styles at all, consider setting

in the . This allows browsers to also use their default dark mode styles on your page, without you having to do anything. If you don't, it'll always be light mode.

For example, these screenshots show this minimal document and how it will be rendered when the browser is set to light or dark mode.

#HTML#DarkMode#WebDev#WebDesign #accessibility

The rendered document, showing a white "Hello world!" on an almost black background in a serif font. The button below it is almost black too and has the white text "This rocks!"
The rendered document, showing a white "Hello world!" on an almost black background in a serif font. The button below it is almost black too and has the white text "This rocks!"
The rendered document, showing a white "Hello world!" on an almost black background in a serif font. The button below it is almost black too and has the white text "This rocks!"
The rendered document, showing a black "Hello world!" on a white background in a serif font. The button below it is light gray and has the black text "This rocks!"
The rendered document, showing a black "Hello world!" on a white background in a serif font. The button below it is light gray and has the black text "This rocks!"
The rendered document, showing a black "Hello world!" on a white background in a serif font. The button below it is light gray and has the black text "This rocks!"
Screenshot of minimal HTML source code using <meta name="color-scheme" content="light dark"> and a single paragraph that says "Hello world!", followed by a button that says "This rocks!". No styles are defined.
Screenshot of minimal HTML source code using <meta name="color-scheme" content="light dark"> and a single paragraph that says "Hello world!", followed by a button that says "This rocks!". No styles are defined.
Screenshot of minimal HTML source code using <meta name="color-scheme" content="light dark"> and a single paragraph that says "Hello world!", followed by a button that says "This rocks!". No styles are defined.
  • Copy link
  • Flag this post
  • Block
Charly Coste 馃嚝馃嚪
@Changaco@mastodon.cloud replied  路  activity timestamp 6 days ago
@scy Done on two simple homepages.

Also, here's a link to the documentation for anyone interested: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name/color-scheme

  • Copy link
  • Flag this comment
  • Block
scy
@scy@chaos.social replied  路  activity timestamp 6 days ago
@Changaco lol I had that in my clipboard and totally forgot to paste it in. And now there's no space left in the post. Ah well, thanks for the amendment :)
  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About 路 Code of conduct 路 Privacy 路 Users 路 Instances
Bonfire social 路 1.0.0-rc.2.21 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login