git.iko.soy/typeable/elm-ui
on master help sign in
wrap style tags in their own div to prevent schenannigans with Dark Reader
02e9919Matthew Griffith
src/Internal/Model.elm+18−3
@@ -1818,7 +1818,10 @@ staticRoot : OptionRecord -> VirtualDom.Node msg
1818staticRoot opts =
1818staticRoot opts =
1819 case opts.mode of
1819 case opts.mode of
1820 Layout ->
1820 Layout ->
1821+ -- wrap the style node in a div to prevent `Dark Reader` from blowin up the dom.
1822+ VirtualDom.node "div"
1823+ []
1821− VirtualDom.node "style" [] [ VirtualDom.text Internal.Style.rules ]
1824+ [ VirtualDom.node "style" [] [ VirtualDom.text Internal.Style.rules ] ]
1822
1825
1823 NoStaticStyleSheet ->
1826 NoStaticStyleSheet ->
1824 VirtualDom.text ""
1827 VirtualDom.text ""
@@ -2345,10 +2348,22 @@ toStyleSheet : OptionRecord -> List Style -> VirtualDom.Node msg
2345toStyleSheet options styleSheet =
2348toStyleSheet options styleSheet =
2346 case options.mode of
2349 case options.mode of
2347 Layout ->
2350 Layout ->
2351+ -- wrap the style node in a div to prevent `Dark Reader` from blowin up the dom.
2352+ VirtualDom.node "div"
2353+ []
2354+ [ VirtualDom.node "style"
2355+ []
2348− VirtualDom.node "style" [] [ VirtualDom.text (toStyleSheetString options styleSheet) ]
2356+ [ VirtualDom.text (toStyleSheetString options styleSheet) ]
2357+ ]
2349
2358
2350 NoStaticStyleSheet ->
2359 NoStaticStyleSheet ->
2360+ -- wrap the style node in a div to prevent `Dark Reader` from blowin up the dom.
2361+ VirtualDom.node "div"
2362+ []
2363+ [ VirtualDom.node "style"
2364+ []
2351− VirtualDom.node "style" [] [ VirtualDom.text (toStyleSheetString options styleSheet) ]
2365+ [ VirtualDom.text (toStyleSheetString options styleSheet) ]
2366+ ]
2352
2367
2353 WithVirtualCss ->
2368 WithVirtualCss ->
2354 VirtualDom.node "elm-ui-rules"
2369 VirtualDom.node "elm-ui-rules"