-
Notifications
You must be signed in to change notification settings - Fork 14
/
styles.js
47 lines (42 loc) · 998 Bytes
/
styles.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
39
40
41
42
43
44
45
46
47
/** @jsx jsx */
import { css, jsx } from "@emotion/core";
/*This function is usually for hover events and such
col: is the color in hex
amt: is how much you want to darken or lighten, 20 is a good start.
*/
export const breakpoints = {
xs: 481,
sm: 578,
md: 764,
base: 764,
lg: 992,
xl: 1325
};
export const theme = {
spacing: {
xxs: "0.17rem",
xs: "0.33rem",
sm: "0.5rem",
md: "1.0rem",
base: "1.0rem",
lg: "1.3rem",
xl: "2rem",
xxl: "3rem",
xxxl: "4.5rem"
}
};
/* eslint-disable security/detect-object-injection */
export const mediaQuery = Object.keys(breakpoints).reduce(
(accumulator, label) => {
let prefix = typeof breakpoints[label] === "string" ? "" : "max-width:";
let suffix = typeof breakpoints[label] === "string" ? "" : "px";
accumulator[label] = cls =>
css`
@media screen and (${prefix + breakpoints[label] + suffix}) {
${cls};
}
`;
return accumulator;
},
{}
);