diff --git a/src/VirtualDom/Styled.elm b/src/VirtualDom/Styled.elm index 780a7159..6c04a164 100644 --- a/src/VirtualDom/Styled.elm +++ b/src/VirtualDom/Styled.elm @@ -31,6 +31,7 @@ module VirtualDom.Styled exposing , unstyledNode ) +import Css import Css.Preprocess as Preprocess exposing (Style) import Css.Preprocess.Resolve as Resolve import Css.Structure as Structure @@ -479,13 +480,18 @@ toKeyedStyleNode maybeNonce allStyles keyedChildNodes = toStyleNode : Maybe Nonce -> Dict CssTemplate Classname -> VirtualDom.Node msg toStyleNode maybeNonce styles = - -- wrap the style node in a div to prevent `Dark Reader` from blowin up the dom. + let + styleWrapperClass = + "elm-css-style-wrapper" + in + -- wrap the style node in a span to prevent `Dark Reader` from blowin up the dom. VirtualDom.node "span" - [ VirtualDom.attribute "style" "display: none;" - , VirtualDom.attribute "class" "elm-css-style-wrapper" - ] + [ VirtualDom.attribute "class" styleWrapperClass ] [ -- this