-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsystem.js
38 lines (34 loc) · 966 Bytes
/
system.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// @flow
import * as React from "react";
import { Box, useSystem, useResponsive } from "../src/system.js";
const Page = (): React.Node => {
const { media } = useSystem();
const responsive = useResponsive();
return (
<>
<div>
<Box css={media({ display: ["block", "none"] })}>
media: mobile screen
</Box>
<Box css={media({ display: ["none", "block", "none"] })}>
media: tablet screen
</Box>
<Box css={media({ display: ["none", "none", "block", "none"] })}>
media: desktop screen
</Box>
<Box css={media({ display: ["none", "none", "none", "block"] })}>
media: large screen
</Box>
</div>
<div>
{responsive([
"responsive: mobile screen",
"responsive: tablet screen",
"responsive: desktop screen",
"responsive: large screen",
])}
</div>
</>
);
};
export default Page;