Generated with the help of an LLM.
Problem/Motivation
In Firefox, prefers-color-scheme inside an iframe follows the color-scheme of the <iframe> element, not the OS. Chromium reports the OS.
Shoelace's .sl-theme-dark sets color-scheme: dark, and the Builder and Preview iframes inherit it.
So with a dark builder on a light OS, a front theme following the system renders dark in the Builder, and light on the site.
Steps to reproduce
- Use Firefox with a light OS, and UI Suite DSFR as the front theme, with its ui_skins theme on System.
- Set Default Admin to Dark, or pick Dark in the Theme menu of the builder.
- Open a page layout builder: DSFR renders dark in the Builder. The same page on the site is light.
Proposed resolution
Set color-scheme: normal on .db-builder-frame and .db-builder-preview. Both already paint their own background.
Remaining tasks
- Fix and check in Firefox, with the builder dark and light.
User interface changes
None.
API changes
None.
Data model changes
None.
Comments
Comment #2
shank115 commentedThe proposed resolution works, and the patch is attached. It adds color-scheme: normal to
.db-builder-frameand.db-builder-preview.Comment #3
mogtofu33 commentedCould you please move it to the branch/MR process, so we have the advantage of ci pass, thanks.
Comment #4
pdureau commentedLet's address bug reports before rc1
Comment #5
csakiistvanComment #7
csakiistvan@pdureau @mogtofu33 Moved the patch from #2 to MR !555, pipeline is green.
❓ Needs more info — reproduced in Firefox with UI Suite DSFR on its System skin and a dark builder, then applied MR !555, rebuilt caches and reloaded the page layout builder: the DSFR page is now light in the Builder and in Preview, as on the site, with the builder dark or light. The placeholder still renders dark in a dark builder, since it takes the builder's tokens copied into the iframe by
builder_frame.js: is that the expected result?If so, can it go to RTBC as is, or do you want a Playwright test first? It would need a Firefox project, since Chromium does not show the bug.