-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.css
More file actions
226 lines (198 loc) · 5.46 KB
/
Copy pathpopup.css
File metadata and controls
226 lines (198 loc) · 5.46 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
/* Same palette as theme.css. The popup previously used cool navy (#1a1a2e), which
read as a different product sitting on top of a warm site. */
:root {
--nwd-canvas: #1a1817;
--nwd-surface: #272320;
--nwd-raised: #302b27;
--nwd-line: #46403b;
--nwd-line-soft: #383330;
--nwd-text: #ede8e3;
--nwd-body: #cfc7c0;
--nwd-muted: #9c928a;
--nwd-accent: #d9a54a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
width: 292px;
padding: 18px 20px 16px;
font: 13px/1.45 "FK Grotesk Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: var(--nwd-canvas);
color: var(--nwd-body);
}
.title {
display: flex;
align-items: center;
gap: 9px;
/* NextWork sets its display type in a serif; matching it is most of what makes
the popup read as part of the same product. */
font-family: "Rockwell", "Georgia", ui-serif, serif;
font-size: 17px;
font-weight: 600;
letter-spacing: -0.01em;
color: var(--nwd-text);
padding-bottom: 14px;
}
.mark {
flex: none;
display: block;
opacity: 0.92;
}
.rows { list-style: none; }
.row {
border-top: 1px solid var(--nwd-line-soft);
}
.switch {
display: flex;
align-items: center;
gap: 14px;
padding: 13px 2px;
cursor: pointer;
border-radius: 8px;
-webkit-user-select: none;
user-select: none;
-webkit-transition: background-color 0.15s ease;
transition: background-color 0.15s ease;
}
.switch:hover { background-color: var(--nwd-surface); }
.switch__text { flex: 1 1 auto; }
.switch__name {
display: block;
font-size: 13.5px;
font-weight: 500;
color: var(--nwd-text);
}
.switch__hint {
display: block;
margin-top: 3px;
font-size: 11px;
line-height: 1.4;
color: var(--nwd-muted);
}
.switch__control {
position: relative;
flex: none;
width: 42px;
height: 24px;
}
/* Full-size and topmost so a real click lands on the control itself. Never
width:0/height:0/display:none -- a zero-size input is what made the original
tutorial's switch unhittable. No border-radius either: a radius on a
transparent inset:0 input makes the corner hit-test fall through. */
.switch__input {
-webkit-appearance: none;
appearance: none;
position: absolute;
inset: 0;
margin: 0;
width: 100%;
height: 100%;
opacity: 0;
cursor: pointer;
z-index: 1;
}
.switch__track {
position: absolute;
inset: 0;
border-radius: 24px;
background: #3d3733;
border: 1px solid var(--nwd-line);
-webkit-transition: background-color 0.22s ease, border-color 0.22s ease;
transition: background-color 0.22s ease, border-color 0.22s ease;
}
/* A sibling span rather than a pseudo-element on the input: older WebKit does
not reliably render ::before on form controls. */
.switch__thumb {
position: absolute;
top: 3px;
left: 3px;
width: 18px;
height: 18px;
border-radius: 50%;
background: #cfc7c0;
-webkit-transition: -webkit-transform 0.22s ease, background-color 0.22s ease;
transition: transform 0.22s ease, background-color 0.22s ease;
}
/* Amber rather than blue: it is one of the site's own accents, and blue was the
single most out-of-place colour in the old popup. */
.switch__input:checked + .switch__track {
background: var(--nwd-accent);
border-color: #e0b464;
}
.switch__input:checked + .switch__track .switch__thumb {
background: #1a1817;
-webkit-transform: translateX(18px);
transform: translateX(18px);
}
/* :focus is duplicated because older WebKit lacks :focus-visible, which would
otherwise leave the control with no visible focus ring. */
.switch__input:focus + .switch__track,
.switch__input:focus-visible + .switch__track {
outline: 2px solid var(--nwd-accent);
outline-offset: 2px;
}
.row.disabled .switch { cursor: default; }
.row.disabled .switch:hover { background-color: transparent; }
.row.disabled .switch__text { opacity: 0.4; }
.row.disabled .switch__control { opacity: 0.4; }
.action {
display: flex;
align-items: center;
justify-content: center;
gap: 7px;
width: 100%;
margin-top: 14px;
padding: 10px 12px;
border: 1px solid var(--nwd-line);
border-radius: 9px;
background: var(--nwd-surface);
color: var(--nwd-text);
font: inherit;
font-size: 12.5px;
font-weight: 500;
cursor: pointer;
-webkit-transition: background-color 0.15s ease, border-color 0.15s ease;
transition: background-color 0.15s ease, border-color 0.15s ease;
}
.action:hover {
background: var(--nwd-raised);
border-color: #554e48;
}
.action:focus-visible,
.action:focus {
outline: 2px solid var(--nwd-accent);
outline-offset: 2px;
}
.action__arrow {
flex: none;
opacity: 0.65;
-webkit-transition: -webkit-transform 0.15s ease;
transition: transform 0.15s ease;
}
.action:hover .action__arrow {
-webkit-transform: translateX(2px);
transform: translateX(2px);
}
/* When the tab is already NextWork the button becomes a no-op, so it reads as
inert rather than inviting a pointless click. */
.action.is-current {
cursor: default;
color: var(--nwd-muted);
background: transparent;
border-color: var(--nwd-line-soft);
}
.action.is-current:hover {
background: transparent;
border-color: var(--nwd-line-soft);
}
.action.is-current .action__arrow { display: none; }
.status {
/* <output> is inline by default; the divider rule and centring below both
assume the full-width box the <p> this replaced gave for free. */
display: block;
margin-top: 12px;
padding-top: 12px;
border-top: 1px solid var(--nwd-line-soft);
font-size: 11px;
color: var(--nwd-muted);
text-align: center;
}