Skip to content

JSPWIKI-1317 Follow the dark colour scheme of the system when no skin was chosen - #555

Merged
spyhunter99 merged 4 commits into
apache:masterfrom
arturobernalg:feature/JSPWIKI-1317-color-scheme
Nov 4, 2026
Merged

spyhunter99 merged 4 commits into
apache:masterfrom
arturobernalg:feature/JSPWIKI-1317-color-scheme

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

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.

… 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
arturobernalg force-pushed the feature/JSPWIKI-1317-color-scheme branch from 8170e23 to f0e064a Compare October 31, 2026 18:03
@spyhunter99

Copy link
Copy Markdown
Contributor

tested and validated. thanks!

@spyhunter99
spyhunter99 merged commit d5acbc6 into apache:master Nov 4, 2026
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