File tree Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ const componentLoaders = [
75
75
"Pagination" ,
76
76
"Pill" ,
77
77
"Progress" ,
78
+ "Responsive" ,
78
79
"Row" ,
79
80
"Select" ,
80
81
"Slider" ,
Original file line number Diff line number Diff line change
1
+ module Lumi.Components.Examples.Responsive where
2
+
3
+ import Prelude
4
+
5
+ import Lumi.Components.Column (column_ )
6
+ import Lumi.Components.Example (example )
7
+ import Lumi.Components.Responsive (desktop , mobile )
8
+ import Lumi.Components.Text (body_ , h2_ )
9
+ import React.Basic (JSX )
10
+
11
+ docs :: JSX
12
+ docs =
13
+ column_ $
14
+ [ h2_ " Desktop and mobile"
15
+ , example $
16
+ column_
17
+ [ mobile $ body_ " Mobile: this text only is only visible on mobile-sized screens."
18
+ , desktop $ body_ " Desktop: this text only is only visible on desktop-sized screens."
19
+ ]
20
+ ]
Original file line number Diff line number Diff line change
1
+ module Lumi.Components.Responsive where
2
+
3
+ import Prelude
4
+
5
+ import JSS (JSS , jss )
6
+ import React.Basic (JSX , element )
7
+ import React.Basic.DOM (unsafeCreateDOMComponent )
8
+
9
+ mobile :: JSX -> JSX
10
+ mobile = lumiMobileElement <<< { children: _ }
11
+ where
12
+ lumiMobileElement = element (unsafeCreateDOMComponent " lumi-mobile" )
13
+
14
+ desktop :: JSX -> JSX
15
+ desktop = lumiDesktopElement <<< { children: _ }
16
+ where
17
+ lumiDesktopElement = element (unsafeCreateDOMComponent " lumi-desktop" )
18
+
19
+ styles :: JSS
20
+ styles = jss
21
+ { " @global" :
22
+ { " @media (max-width: 860px)" :
23
+ { " lumi-desktop" :
24
+ { " display" : " none"
25
+ }
26
+ }
27
+ , " @media (min-width: 861px)" :
28
+ { " lumi-mobile" :
29
+ { " display" : " none"
30
+ }
31
+ }
32
+ }
33
+ }
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import Lumi.Components.NativeSelect as NativeSelect
34
34
import Lumi.Components.Navigation as Navigation
35
35
import Lumi.Components.Pagination as Pagination
36
36
import Lumi.Components.Pill as Pill
37
+ import Lumi.Components.Responsive as Responsive
37
38
import Lumi.Components.Row as Row
38
39
import Lumi.Components.Select as Select
39
40
import Lumi.Components.Slider as Slider
@@ -87,6 +88,7 @@ attachGlobalComponentStyles = do
87
88
, Navigation .styles
88
89
, Pagination .styles
89
90
, Pill .styles
91
+ , Responsive .styles
90
92
, Row .styles
91
93
, Select .styles
92
94
, Slider .styles
You can’t perform that action at this time.
0 commit comments