Skip to content

Add support for automatic CSS dark mode#127

Merged
Deer-Spangle merged 1 commit into
Deer-Spangle:masterfrom
s0ph0s-dog:master
Dec 11, 2025
Merged

Add support for automatic CSS dark mode#127
Deer-Spangle merged 1 commit into
Deer-Spangle:masterfrom
s0ph0s-dog:master

Conversation

@s0ph0s-dog

Copy link
Copy Markdown
Contributor

This change uses the CSS color-scheme property (widely available as of 2022 according to MDN 1) to opt FAExport's web interface in to automatic CSS light and dark mode. This change should be invisible to browsers that do not support color-scheme, since it has no other effects, and browsers that do not support the property will continue to display FAExport in light mode, as they always have.

In order to make the navigation links visible in dark mode, I also changed the text color from #000000 to CanvasText, which selects the default text color. This color name has been available since 2015, according to MDN 2. If you'd prefer, I can add the CanvasText line after the original #000000 line, so that browsers which do not support the system-color data type will still display the links in black text. (That shouldn't be an issue for dark mode, since a browser that doesn't support system-color will almost certainly not support color-scheme :P)

Motivation: I got flashbanged by FAExport at 2:30 am and realized that I could fix that :3

Footnotes

  1. https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme

  2. https://developer.mozilla.org/en-US/docs/Web/CSS/system-color

This change uses the CSS color-scheme property (widely available as of
2022 according to MDN[1]) to opt FAExport's web form in to automatic CSS
light and dark mode.  This change should be invisible to browsers that
do not support `color-scheme`, since it has no other effects, and
browsers that do not support the property will continue to display
FAExport in light mode, as they always have.

In order to make the navigation links visible in dark mode, I also
changed the text color from `#000000` to `CanvasText`, which selects the
default text color.  This color name has been available since 2015,
according to MDN[2].  If you'd prefer, I can add the `CanvasText` line
after the original `#000000` line, so that browsers which do not support
the system-color data type will still display the links in black text.
(That shouldn't be an issue for dark mode, since a browser that doesn't
support system-color will almost certainly not support `color-scheme`
:P)

[1]: https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
[2]: https://developer.mozilla.org/en-US/docs/Web/CSS/system-color
@Deer-Spangle

Copy link
Copy Markdown
Owner

Sorry I haven't gotten to this. Do you have any screenshots, perhaps?

@s0ph0s-dog

Copy link
Copy Markdown
Contributor Author

No problem! It's a hobby project, and "add dark mode" is not very important :P

Here's how it looks in Firefox (I have my browser's default font set to Libertinus Serif, which is why the font is different):

Firefox (Dark) crush

And here's how it looks in Safari:

Safari (Dark) 2

@Deer-Spangle

Copy link
Copy Markdown
Owner

Oh yeah, that looks great! Thank you so much! I'll try and get that released and deployed soon. (Having a little bit of an issue setting up a local development environment for this at the moment)

@Deer-Spangle Deer-Spangle merged commit 4715d40 into Deer-Spangle:master Dec 11, 2025
@Deer-Spangle

Copy link
Copy Markdown
Owner

I've got that deployed as version 2025.12.1 now, thank you again!

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