git.iko.soy/typeable/elm-ui
on master help sign in
wrap style tags in their own div to prevent schenannigans with Dark Reader
commit02e9919a47d50a71fbc92338a8a38def853ffa0f authorMatthew Griffith <mdg.griffith@gmail.com> dateWed 7 Aug 2019, 08:45 (7 years ago) parent34c7ba0
1 file changed+18−3
src/Internal/Model.elm+18−3
src/Internal/Model.elm+18−3
@@ -1818,7 +1818,10 @@ staticRoot : OptionRecord -> VirtualDom.Node msg
18181818staticRoot opts =
18191819 case opts.mode of
18201820 Layout ->
1821− VirtualDom.node "style" [] [ VirtualDom.text Internal.Style.rules ]
1821+ -- wrap the style node in a div to prevent `Dark Reader` from blowin up the dom.
1822+ VirtualDom.node "div"
1823+ []
1824+ [ VirtualDom.node "style" [] [ VirtualDom.text Internal.Style.rules ] ]
18221825
18231826 NoStaticStyleSheet ->
18241827 VirtualDom.text ""
@@ -2345,10 +2348,22 @@ toStyleSheet : OptionRecord -> List Style -> VirtualDom.Node msg
23452348toStyleSheet options styleSheet =
23462349 case options.mode of
23472350 Layout ->
2348− VirtualDom.node "style" [] [ VirtualDom.text (toStyleSheetString options styleSheet) ]
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+ []
2356+ [ VirtualDom.text (toStyleSheetString options styleSheet) ]
2357+ ]
23492358
23502359 NoStaticStyleSheet ->
2351− VirtualDom.node "style" [] [ VirtualDom.text (toStyleSheetString options styleSheet) ]
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+ []
2365+ [ VirtualDom.text (toStyleSheetString options styleSheet) ]
2366+ ]
23522367
23532368 WithVirtualCss ->
23542369 VirtualDom.node "elm-ui-rules"