-
Notifications
You must be signed in to change notification settings - Fork 10
/
styles.js
57 lines (49 loc) 路 1.39 KB
/
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
import { buttonReset } from '../../styles/helpers';
import { tokens } from '@sparkpost/design-tokens';
export const tabStyles = ({ selected, fitted }) => `
${buttonReset}
display: inline-block;
cursor: pointer;
position: relative;
flex: ${fitted ? '1' : '0'};
text-decoration: none;
padding: 0 ${tokens.spacing_200};
margin: 0 ${!fitted ? `${tokens.sizing_450}` : '0'};
font-size: ${tokens.fontSize_200};
font-weight: ${tokens.fontWeight_medium};
line-height: ${tokens.sizing_750};
white-space: nowrap;
&, &:visited {
color: ${selected ? tokens.color_blue_700 : tokens.color_gray_700};
}
&:after {
display: block;
position: absolute;
content: '';
bottom: 0px;
left: 0;
right: 0;
height: ${tokens.spacing_100};
background: ${selected ? tokens.color_blue_700 : 'transparent'};
transition: ${tokens.motionDuration_fast} ${tokens.motionEase_in_out};
}
&:hover {
${!selected ? `color: ${tokens.color_gray_900};` : ''};
&:after {
${!selected ? `background: ${tokens.color_gray_400};` : ''}
}
}
`;
export const overflowTabs = ({ isOverflowing }) => `
position: absolute;
left: 0;
top: 0;
right:0;
display: flex;
visibility: ${isOverflowing ? 'hidden' : 'visible'};
pointer-events: ${isOverflowing ? 'none' : 'auto'};
`;
export const containerStyles = () => `
position: relative;
height: ${tokens.sizing_750};
`;