File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -23,3 +23,23 @@ desktopQuery style =
2323 css
2424 { " @media (min-width: 860px)" : nested style
2525 }
26+
27+ -- | Create a style modifier that, only in a mobile-sized screen, applies the
28+ -- | styles accumulated in the modifier passed in as argument.
29+ -- |
30+ -- | NOTE: the value passed in as argument must be a props modifier that touches
31+ -- | no component-specific props, a property that currently defines style
32+ -- | modifiers.
33+ onMobile :: StyleModifier -> StyleModifier
34+ onMobile m =
35+ style \theme ->
36+ mobileQuery
37+ $ toCSS m
38+ $ theme
39+
40+ -- | Guard a style so that it's only applied in a mobile screen resolution.
41+ mobileQuery :: Style -> Style
42+ mobileQuery style =
43+ css
44+ { " @media (max-width: 859px)" : nested style
45+ }
You can’t perform that action at this time.
0 commit comments