File tree Expand file tree Collapse file tree 2 files changed +29
-3
lines changed
Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ module Element
6262 , layout
6363 , viewport
6464 , toHtml
65+ , toLayoutCss
66+ , toViewportCss
6567 , embedStylesheet
6668 , Device
6769 , classifyDevice
@@ -196,7 +198,7 @@ Some convient elements for working with forms.
196198
197199## Advanced Rendering
198200
199- @docs toHtml, embedStylesheet
201+ @docs toHtml, embedStylesheet, toLayoutCss, toViewportCss
200202
201203
202204### Deprecated
@@ -1252,6 +1254,20 @@ toHtml stylesheet el =
12521254 ( Render . render stylesheet el)
12531255
12541256
1257+ {- | Renders the stylesheet generated by 'layout' to css
1258+ -}
1259+ toLayoutCss : StyleSheet style variation -> String
1260+ toLayoutCss stylesheet =
1261+ Render . layoutCss stylesheet
1262+
1263+
1264+ {- | Renders the stylesheet generated by 'viewport' to css
1265+ -}
1266+ toViewportCss : StyleSheet style variation -> String
1267+ toViewportCss stylesheet =
1268+ Render . viewportCss stylesheet
1269+
1270+
12551271{- | Embed a stylesheet.
12561272-}
12571273embedStylesheet : StyleSheet style variation -> Html msg
Original file line number Diff line number Diff line change @@ -45,15 +45,25 @@ root stylesheet elm =
4545 ( embed False stylesheet :: render stylesheet elm)
4646
4747
48+ viewportCss : Internal .StyleSheet elem variation -> String
49+ viewportCss stylesheet =
50+ normalizeFull () ++ stylesheet. css
51+
52+
53+ layoutCss : Internal .StyleSheet elem variation -> String
54+ layoutCss stylesheet =
55+ normalize ++ stylesheet. css
56+
57+
4858embed : Bool -> Internal .StyleSheet elem variation -> Html msg
4959embed full stylesheet =
5060 Html . node " style"
5161 []
5262 [ Html . text <|
5363 if full then
54- normalizeFull () ++ stylesheet. css
64+ viewportCss stylesheet
5565 else
56- normalize ++ stylesheet. css
66+ layoutCss stylesheet
5767 ]
5868
5969
You can’t perform that action at this time.
0 commit comments