Add support for automatic CSS dark mode#127
Merged
Merged
Conversation
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
Owner
|
Sorry I haven't gotten to this. Do you have any screenshots, perhaps? |
Contributor
Author
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) |
Owner
|
I've got that deployed as version 2025.12.1 now, thank you again! |
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.


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
#000000toCanvasText, 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 theCanvasTextline after the original#000000line, 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 supportcolor-scheme:P)Motivation: I got flashbanged by FAExport at 2:30 am and realized that I could fix that :3
Footnotes
https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme ↩
https://developer.mozilla.org/en-US/docs/Web/CSS/system-color ↩