File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ module Lumi.Styles.Responsive where
2+
3+ import Prelude
4+
5+ import Lumi.Components (PropsModifier )
6+ import Lumi.Styles (Style , css , nested , styleModifier )
7+
8+ -- | Create a style modifier that, only in a desktop-sized screen, applies the
9+ -- | styles accumulated in the modifier passed in as argument.
10+ -- |
11+ -- | NOTE: the value passed in as argument must be a props modifier that touches
12+ -- | no component-specific props, a property that currently defines style
13+ -- | modifiers.
14+ onDesktop :: forall props . PropsModifier () -> PropsModifier props
15+ onDesktop m =
16+ styleModifier \theme ->
17+ desktopQuery
18+ $ (m identity { className: " " , css: mempty }).css
19+ $ theme
20+
21+ -- | Guard a style so that it's only applied in a desktop resolution.
22+ desktopQuery :: Style -> Style
23+ desktopQuery style =
24+ css
25+ { " @media (min-width: 860px)" : nested style
26+ }
You can’t perform that action at this time.
0 commit comments