Repository navigation
JSPWIKI-1317 Follow the dark colour scheme of the system when no skin was chosen - #555
Merged
spyhunter99 merged 4 commits intoNov 4, 2026
Conversation
… was chosen The default template now also loads the dark skin, under a prefers-color-scheme media query, when the active skin is the default one and the user has not picked a skin. Preferences records which preferences come from the user's cookie, so a user who chose the default skin on purpose keeps it.
… was chosen The default template now also loads the dark skin, under a prefers-color-scheme media query, when the active skin is the default one and the user has not picked a skin. Preferences records which preferences come from the user's cookie, so a user who chose the default skin on purpose keeps it.
arturobernalg
force-pushed
the
feature/JSPWIKI-1317-color-scheme
branch
from
October 31, 2026 18:03
8170e23 to
f0e064a
Compare
…m/arturobernalg/jspwiki into feature/JSPWIKI-1317-color-scheme
Contributor
|
tested and validated. thanks! |
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.
https://issues.apache.org/jira/browse/JSPWIKI-1317
Users whose system asks for a dark colour scheme got the light default skin, although dark skins already exist. The default template now also loads the dark skin, under a prefers-color-scheme: dark media query, when the active skin is the default one and the user has not picked a skin. The browser applies it only when the system is in dark mode, so there is no script and no flash of the light page.
To tell a user who chose the default skin on purpose from one who chose nothing, Preferences now records which preferences come from the user's cookie (Preferences.isSetByUser). parseJSONPreferences is now package-private so that PreferencesTest can call it. A user who picked another skin is not affected.
Checked in a browser with the system in dark mode: with no skin chosen the page uses the dark skin, and with the default skin chosen in the cookie it stays light. With a cookie for another skin the generated HTML has no extra link. PreferencesTest has three cases and does not exercise the JSP. I did not check the older 210 template, other browsers, or the editor under the dark skin.
If the project would rather not change the default look, the same behaviour can be switched on by a property instead.