Site Editor: is-dark-theme
class is not applied correctly
#49294
Labels
[Feature] Site Editor
Related to the overarching Site Editor (formerly "full site editing")
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
[Type] Bug
An existing feature does not function as intended
Description
The block editor determines if it is a dark theme based on the canvas background color via useDarkThemeBodyClassName and grants the
is-dark-theme
class. However, when changing the background color from the global style or changing the theme variation, the previous background color is referenced and this class is not given correctly.As a result, components that depend on this class will not be displayed in the correct color.
Step-by-step reproduction instructions
.is-dark-theme
class is not added to the body tag in the iframe..is-dark-theme
class is not added to the body tag, even though it is considered a dark theme..is-dark-theme
class is unintentionally added to the body tag. As a result, the background color for the dark theme is applied to the spacer block, making it invisible.The text was updated successfully, but these errors were encountered: