Repository navigation
[ShadcnAdminUi] Add an auto mode to the theme switcher - #411
Merged
loic425 merged 1 commit intoNov 18, 2026
Merged
Conversation
Port of the BootstrapAdminUi auto mode (Sylius#407): the switcher opens a Light / Dark / Auto menu, Auto follows prefers-color-scheme live and across tabs, and is the default (no stored sylius-theme key).
camilleislasse
approved these changes
Nov 18, 2026
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.
The BootstrapAdminUi theme switcher got an auto mode in #407, but the ShadcnAdminUi one still only toggles between light and dark: once clicked, the OS preference is ignored for good.
The button now opens a shadcn
DropdownMenuwith three radio items:prefers-color-scheme, live when the OS switches and across open tabs.Same storage as Bootstrap: Auto is the default and removes the
sylius-themekey, so admins who never picked a theme see no change and those who did keep their choice. The inline script setsdata-theme-modeon<html>before the stylesheet, so there is no flash and the right icon shows before Stimulus connects. Thetoggleaction is kept for overridden templates.Labels reuse the
sylius.ui.theme_*keys added to UiTranslations in #407.lucide:monitorwas added to the test app's locked icons.