Repository navigation
[BootstrapAdminUi] Add an auto mode to the theme switcher - #407
Merged
Merged
Conversation
loic425
force-pushed
the
feat/admin-theme-auto-mode
branch
from
November 13, 2026 09:15
60b8728 to
60b2ec5
Compare
crydotsnake
approved these changes
Nov 13, 2026
TheMilek
added a commit
to Sylius/Sylius
that referenced
this pull request
Nov 13, 2026
| Q | A |-----------------|----- | Branch? | 2.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Related tickets | port of Sylius/Stack#407 | License | MIT The admin theme switcher only toggles between light and dark. Once you click it, your OS preference is ignored for good, and there is no way to go back to following it. The button now opens a dropdown with three options: - **Light** and **Dark** force the theme, as before. - **Auto** follows `prefers-color-scheme`, and updates live when the OS switches (e.g. at sunset), across open tabs too. - The button shows the icon of the selected mode (sun, moon or screen), and the active option is highlighted. Auto is the default and is stored by removing the `sylius-admin-theme` key, so admins who never picked a theme get the same behaviour as today, and those who did keep their choice. The `toggle` action is kept for templates that still use it. The new labels (`theme_auto`, `theme_dark`, `theme_light`) and the existing `toggle_theme`, which was only in English, are translated in all 51 admin locales. | Light | Dark | |-------|------| | <img width="400" alt="Theme switcher with Light selected" src="https://github.com/user-attachments/assets/2ed240ab-34cc-4345-a613-2d3f25c0314d" /> | <img width="400" alt="Theme switcher with Dark selected" src="https://github.com/user-attachments/assets/65b89f47-54c7-411c-a6e1-743e12b41b8e" /> | | Auto (OS light) | Auto (OS dark) | |-----------------|----------------| | <img width="400" alt="Theme switcher with Auto selected and a light OS" src="https://github.com/user-attachments/assets/d7175193-0cfb-42b3-a2fd-18799ec65378" /> | <img width="400" alt="Theme switcher with Auto selected and a dark OS" src="https://github.com/user-attachments/assets/39d4551a-9f25-42bf-9b7b-d900db8b9861" /> |
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 admin theme switcher only toggles between light and dark. Once you click it, your OS preference is ignored for good, and there is no way to go back to following it.
The button now opens a dropdown with three options:
prefers-color-scheme, and updates live when the OS switches (e.g. at sunset), across open tabs too.Auto is the default and is stored by removing the
sylius-themekey, so admins who never picked a theme get the same behaviour as today, and those who did keep their choice. Thetoggleaction is kept for templates that still use it.Translations were added in en, fr, de, es, nl and pl.
public/assets were rebuilt withyarn build.