-
Notifications
You must be signed in to change notification settings - Fork 272
Expand file tree
/
Copy pathindex.styles.ts
More file actions
142 lines (134 loc) · 3.82 KB
/
index.styles.ts
File metadata and controls
142 lines (134 loc) · 3.82 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import { css, Theme } from '@emotion/react';
import pixelsToRem from '#app/utilities/pixelsToRem';
import { GROUP_B_MIN_WIDTH } from '#app/components/ThemeProvider/fontMediaQueries';
import { MAX_NAV_ITEM_HEIGHT } from '../index.styles';
export default {
dropdown: ({ palette, mq }: Theme) =>
css({
position: 'absolute',
top: '100%',
left: 0,
width: '100%',
zIndex: 99999,
backgroundColor: palette.WHITE,
borderBottom: `${pixelsToRem(3)}rem solid ${palette.POSTBOX}`,
clear: 'both',
overflow: 'hidden',
height: 0,
transition: 'all 0.2s ease-out',
transitionTimingFunction: 'cubic-bezier(0, 0, 0.58, 1)',
visibility: 'hidden',
[mq.GROUP_3_MIN_WIDTH]: {
display: 'none',
visibility: 'hidden',
},
'@media (prefers-reduced-motion: reduce)': {
transition: 'none',
},
}),
dropdownOpen: css({
visibility: 'visible',
}),
ampDropdown: ({ palette, mq }: Theme) =>
css({
position: 'absolute',
top: '100%',
left: 0,
width: '100%',
zIndex: 99999,
backgroundColor: palette.WHITE,
borderBottom: `${pixelsToRem(3)}rem solid ${palette.POSTBOX}`,
clear: 'both',
[mq.GROUP_3_MIN_WIDTH]: {
display: 'none',
visibility: 'hidden',
},
}),
dropdownList: css({
listStyleType: 'none',
margin: 0,
padding: 0,
}),
dropdownListItem: ({ palette }: Theme) =>
css({
padding: 0,
borderBottom: `${pixelsToRem(1)}rem solid ${palette.GREY_3}`,
'&:last-child': {
border: 0,
},
}),
dropdownLink: ({ palette, spacings, fontSizes, fontVariants }: Theme) =>
css({
...fontSizes.pica,
...fontVariants.sansRegular,
color: palette.GREY_10,
textDecoration: 'none',
display: 'block',
position: 'relative',
padding: `${pixelsToRem(12)}rem ${spacings.FULL}rem`,
'&:hover': {
backgroundColor: palette.GREY_3,
textDecoration: 'none',
'&::before': {
opacity: 1,
},
},
'&::before': {
content: '""',
position: 'absolute',
top: 0,
insetInlineStart: 0,
height: '100%',
width: `${pixelsToRem(4)}rem`,
background: palette.POSTBOX,
display: 'block',
opacity: 0,
},
'&:focus-visible': {
textDecoration: 'underline',
textDecorationColor: palette.POSTBOX,
outlineOffset: `-${pixelsToRem(3)}rem`,
},
}),
// Active link indicator: inline-start border + padding for the current page item
currentLink: ({ palette, spacings }: Theme) =>
css({
borderInlineStart: `${pixelsToRem(4)}rem solid ${palette.POSTBOX}`,
paddingInlineStart: `${spacings.FULL}rem`,
}),
menuButton: ({ palette, mq }: Theme) =>
css({
position: 'relative',
padding: 0,
margin: 0,
border: 0,
flexShrink: 0, // never let the flex container squeeze the button off-screen
float: 'inline-start',
backgroundColor: palette.POSTBOX,
color: palette.WHITE,
width: `${pixelsToRem(MAX_NAV_ITEM_HEIGHT)}rem`,
height: `${pixelsToRem(MAX_NAV_ITEM_HEIGHT)}rem`,
[mq.GROUP_3_MIN_WIDTH]: {
display: 'none',
visibility: 'hidden',
},
[GROUP_B_MIN_WIDTH]: {
width: `${pixelsToRem(MAX_NAV_ITEM_HEIGHT)}rem`,
height: `${pixelsToRem(MAX_NAV_ITEM_HEIGHT)}rem`,
},
svg: {
verticalAlign: 'middle',
fill: palette.WHITE,
},
'&:hover, &:focus': {
cursor: 'pointer',
boxShadow: `inset 0 0 0 ${pixelsToRem(4)}rem ${palette.WHITE}`,
'&::after': {
content: "''",
position: 'absolute',
inset: 0,
border: `${pixelsToRem(4)}rem solid ${palette.BLACK}`,
},
},
}),
};