-
Notifications
You must be signed in to change notification settings - Fork 30
/
styled.js
55 lines (48 loc) · 1.01 KB
/
styled.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
48
49
50
51
52
53
54
55
import styled, { css } from "styled-components";
import { spacing } from "@common/constants";
const sif = prop => styles => props => props[prop] && styles;
const bgColor = ({ bgColor }) =>
bgColor &&
css`
background: ${bgColor};
`;
const color = ({ color }) =>
color &&
css`
color: ${color};
`;
const margin = ({ margin }) =>
margin &&
css`
margin: ${margin};
`;
const padding = ({ padding }) =>
padding &&
css`
padding: ${padding};
`;
const wrapperStyles = css`
margin-right: auto;
margin-left: auto;
max-width: ${spacing.globalWidth}px;
padding: 0 60px;
@media (max-width: 800px) {
padding: 0 25px;
}
width: 100%;
flex-grow: 1;
position: relative;
z-index: 20;
${padding};
${margin};
`;
const defaultWrapper = styled.div`
${wrapperStyles};
display: flex;
align-items: center;
justify-content: space-between;
@media (max-width: 800px) {
display: block;
}
`;
export { wrapperStyles, defaultWrapper, sif, bgColor, color, margin, padding };