-
Notifications
You must be signed in to change notification settings - Fork 9
/
stylers.stories.styles.js
82 lines (65 loc) · 1.71 KB
/
stylers.stories.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import styled from "styled-components";
import tokens from "@paprika/tokens";
import stylers from "@paprika/stylers";
export const Box = styled.div`
border: 1px solid ${tokens.border.color};
border-radius: ${tokens.border.radius};
margin-bottom: ${stylers.spacer(2)};
padding: ${stylers.spacer(2)};
width: 280px;
`;
export const TruncatedBox = styled(Box)`
${stylers.truncateText};
`;
export const UntruncatedBox = styled(TruncatedBox)`
${stylers.noTruncateText};
`;
export const InvisibleBox = styled(Box)`
${stylers.visuallyHidden};
`;
export const InputWithPlaceholder = styled.input`
${stylers.placeholders};
`;
export const FontScale = styled.div``;
export const FontStep = styled.span`
${props => stylers.fontSize(props.scale)};
display: inline-flex;
flex-direction: column;
line-height: 1;
> span {
padding: 0 ${tokens.space};
text-align: center;
&:last-child {
opacity: 0.7;
${stylers.fontSize(-5)};
}
}
`;
export const LeadingStep = styled(Box)`
${props => stylers.lineHeight(props.scale)}
code {
opacity: 0.7;
}
`;
const zOffset = 30;
const zStyles = props => `
left: ${zOffset * props.level}px;
top: ${(zOffset / 4) * props.level}px;
${stylers.z(props.level)};
`;
export const ZBox = styled(Box)`
height: ${stylers.spacer(15)};
position: relative;
`;
export const ZStep = styled.span`
position: absolute;
width: ${stylers.spacer(6)};
height: ${stylers.spacer(6)};
margin: ${tokens.space} 0 0 ${tokens.space};
background: rgba(164, 164, 164, 0.9); // TODO: need rgba mixin
border: 1px solid ${tokens.color.blackLighten20};
color: ${tokens.color.white};
line-height: ${stylers.spacer(6)};
text-align: center;
${zStyles}
`;