From 02e9919a47d50a71fbc92338a8a38def853ffa0f Mon Sep 17 00:00:00 2001 From: Matthew Griffith Date: Wed, 7 Aug 2019 08:45:06 -0400 Subject: [PATCH] wrap style tags in their own div to prevent schenannigans with Dark Reader --- src/Internal/Model.elm | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/Internal/Model.elm b/src/Internal/Model.elm index 7ea22e1..f180e71 100644 --- a/src/Internal/Model.elm +++ b/src/Internal/Model.elm @@ -1818,7 +1818,10 @@ staticRoot : OptionRecord -> VirtualDom.Node msg staticRoot opts = case opts.mode of Layout -> - VirtualDom.node "style" [] [ VirtualDom.text Internal.Style.rules ] + -- wrap the style node in a div to prevent `Dark Reader` from blowin up the dom. + VirtualDom.node "div" + [] + [ VirtualDom.node "style" [] [ VirtualDom.text Internal.Style.rules ] ] NoStaticStyleSheet -> VirtualDom.text "" @@ -2345,10 +2348,22 @@ toStyleSheet : OptionRecord -> List Style -> VirtualDom.Node msg toStyleSheet options styleSheet = case options.mode of Layout -> - VirtualDom.node "style" [] [ VirtualDom.text (toStyleSheetString options styleSheet) ] + -- wrap the style node in a div to prevent `Dark Reader` from blowin up the dom. + VirtualDom.node "div" + [] + [ VirtualDom.node "style" + [] + [ VirtualDom.text (toStyleSheetString options styleSheet) ] + ] NoStaticStyleSheet -> - VirtualDom.node "style" [] [ VirtualDom.text (toStyleSheetString options styleSheet) ] + -- wrap the style node in a div to prevent `Dark Reader` from blowin up the dom. + VirtualDom.node "div" + [] + [ VirtualDom.node "style" + [] + [ VirtualDom.text (toStyleSheetString options styleSheet) ] + ] WithVirtualCss -> VirtualDom.node "elm-ui-rules"