返回 CodeWhale
shell.css
根目录 / web / app / styles / shell.css
1 /* ------------------------------------------------------------------ */
2 /* Site chrome — the header, the mobile sheet, the footer */
3 /* ------------------------------------------------------------------ */
4
5 /* ---------- header ---------- */
6 /* The header floats on the sky: it paints the same ground as the top of the
7 page, pinned to the viewport, so at rest there is no bar at all. No glass,
8 no blur. A hairline marks it once content scrolls beneath. */
9 .site-nav {
10 position: sticky;
11 z-index: 30;
12 top: 0;
13 background: var(--ground, var(--bg));
14 background-attachment: fixed;
15 background-repeat: no-repeat;
16 border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
17 }
18
19 .site-nav-inner {
20 display: flex;
21 width: var(--container);
22 min-height: 4rem;
23 align-items: center;
24 justify-content: space-between;
25 gap: 1.5rem;
26 margin-inline: auto;
27 }
28
29 .paper-nav-inner { padding-block: var(--space-2); }
30
31 .site-wordmark {
32 display: inline-flex;
33 flex-shrink: 0;
34 align-items: center;
35 gap: var(--space-2);
36 color: var(--mark-ink);
37 border-radius: var(--radius-control);
38 }
39
40 .paper-wordmark {
41 flex: 0 1 auto;
42 max-width: 15rem;
43 min-width: 8.75rem;
44 overflow: hidden;
45 }
46
47 .paper-wordmark-text {
48 display: flex;
49 align-items: center;
50 gap: 0.5rem;
51 min-width: 0;
52 }
53
54 /* The mark and the wordmark are one ink (--mark-ink), drawn through masks so
55 both appearances re-ink them without a filter or a second file. */
56 .brand-mark {
57 display: block;
58 flex: 0 0 auto;
59 width: 30px;
60 height: 30px;
61 background: var(--mark-ink);
62 -webkit-mask: url("/brand/mark-mono.svg") no-repeat center / contain;
63 mask: url("/brand/mark-mono.svg") no-repeat center / contain;
64 }
65
66 .paper-wordmark-logo,
67 .wordmark {
68 display: block;
69 flex: 0 1 auto;
70 min-width: 0;
71 width: 128px;
72 max-width: 100%;
73 height: 20px;
74 background: var(--mark-ink);
75 -webkit-mask: url("/brand/wordmark.svg") no-repeat left center / contain;
76 mask: url("/brand/wordmark.svg") no-repeat left center / contain;
77 }
78 [dir="rtl"] .paper-wordmark-logo,
79 [dir="rtl"] .wordmark {
80 -webkit-mask-position: right center;
81 mask-position: right center;
82 }
83
84 @media (forced-colors: active) {
85 .brand-mark,
86 .paper-wordmark-logo,
87 .wordmark { background: CanvasText; }
88 }
89
90 /* The one primary action in the header. */
91 .paper-install-cta {
92 align-items: center;
93 justify-content: center;
94 min-height: 2.25rem;
95 padding-inline: var(--space-4);
96 background: var(--brand-fill);
97 color: var(--on-brand);
98 font-size: var(--text-ui);
99 font-weight: 600;
100 border-radius: var(--radius-control);
101 transition: box-shadow var(--dur-state) var(--ease-out);
102 }
103 .paper-install-cta:hover {
104 background: var(--brand-fill-hover);
105 color: var(--on-brand);
106 box-shadow: var(--glow-focus);
107 }
108
109 /* Actions sit 2px apart, as related rail controls in the GPUI client; the
110 primary action takes a group gap before it. */
111 .site-nav-actions {
112 display: flex;
113 flex-shrink: 0;
114 align-items: center;
115 gap: 2px;
116 }
117 .site-nav-actions > * { flex-shrink: 0; }
118 .site-nav-actions > .paper-install-cta { margin-inline-start: 0.25rem; }
119
120 /* Quiet icon controls: a 40px target around a 20px glyph. Muted at rest,
121 full ink on hover and while expanded; a pressed or current control takes
122 the neutral selected fill. */
123 .nav-icon-button {
124 position: relative;
125 display: inline-flex;
126 width: 2.5rem;
127 height: 2.5rem;
128 align-items: center;
129 justify-content: center;
130 color: var(--muted);
131 border-radius: var(--radius-control);
132 cursor: pointer;
133 transition-property: background-color, color, box-shadow;
134 transition-duration: var(--dur-state);
135 transition-timing-function: var(--ease-out);
136 }
137 .nav-icon-button:hover,
138 .nav-icon-button[aria-expanded="true"] {
139 background: var(--hover);
140 color: var(--text);
141 }
142 .nav-icon-button[aria-pressed="true"],
143 .nav-icon-button[aria-current="page"] {
144 background: var(--selected);
145 color: var(--text);
146 }
147 .nav-icon-button:active { opacity: 0.75; }
148 .nav-icon-button:focus-visible { box-shadow: var(--glow-focus); }
149
150 .nav-icon-button-sm { width: 2rem; height: 2rem; }
151 .nav-icon-button-sm .nav-icon { width: 1rem; height: 1rem; }
152 @media (pointer: coarse) {
153 .nav-icon-button-sm { width: 2.75rem; height: 2.75rem; }
154 }
155
156 .nav-icon { display: block; width: 1.25rem; height: 1.25rem; }
157
158 /* The native <select> stays the control (keyboard, screen readers, the
159 platform picker) but is transparent over the globe glyph, so the icon is
160 the whole hit target. Its focus ring moves to the visible box. */
161 .nav-locale select {
162 position: absolute;
163 inset: 0;
164 width: 100%;
165 height: 100%;
166 opacity: 0;
167 cursor: pointer;
168 font-size: 1rem;
169 }
170 .nav-locale:has(select:focus-visible) {
171 box-shadow: 0 0 0 var(--gpui-focus-width) var(--ring), var(--glow-focus);
172 }
173
174 /* ---------- primary nav links ---------- */
175 /* Hover is a neutral wash. The current page keeps a 2px accent bar under
176 its label: the one place blue marks "here". */
177 .nav-link {
178 position: relative;
179 padding: 0.375rem 0.5rem;
180 margin-inline: -0.5rem;
181 color: var(--text);
182 font-size: var(--text-ui);
183 font-weight: 500;
184 border-radius: var(--radius-control);
185 transition: background-color var(--dur-state) var(--ease-out);
186 }
187 .nav-link:hover { background: var(--hover); }
188 .nav-link::after {
189 content: "";
190 position: absolute;
191 inset-inline: 0.5rem;
192 bottom: -2px;
193 height: 2px;
194 background: var(--accent);
195 box-shadow: var(--glow);
196 opacity: 0;
197 }
198 .nav-link[aria-current="page"]::after { opacity: 1; }
199
200 /* Compact viewports: the strip keeps the home control clickable. */
201 @media (max-width: 520px) {
202 .site-nav-inner { gap: 0.5rem; }
203 .site-nav-actions { min-width: 0; }
204 .paper-wordmark { max-width: 9.75rem; }
205 }
206
207 /* ---------- the mobile sheet ---------- */
208 .mm-list > li + li { border-top: 1px solid var(--line); }
209
210 .mm-link {
211 display: flex;
212 align-items: center;
213 gap: 0.75rem;
214 min-height: 3.25rem;
215 padding-inline: 0.5rem;
216 color: var(--text);
217 font-size: 1.0625rem;
218 border-radius: var(--radius-control);
219 transition: background-color var(--dur-state) var(--ease-out);
220 }
221 .mm-link:hover { background: var(--hover); }
222 .mm-link[aria-current="page"] { background: var(--selected); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
223 @media (forced-colors: active) {
224 .mm-link[aria-current="page"] { outline-style: solid; outline-width: 2px; outline-color: Highlight; outline-offset: -2px; }
225 }
226 .mm-link-chevron { margin-inline-start: auto; color: var(--muted); }
227
228 .mm-action {
229 display: flex;
230 width: 100%;
231 min-height: 2.75rem;
232 margin-top: 0.75rem;
233 }
234 .mm-action.paper-install-cta { margin-top: 1.5rem; }
235
236 /* ---------- footer ---------- */
237 /* The footer sits on the page's own ground under one hairline, in both
238 appearances: four short link columns, folded into four disclosures on a
239 phone. */
240 .site-footer {
241 position: relative;
242 color: var(--muted);
243 border-top: 1px solid var(--line);
244 }
245
246 .site-footer-main,
247 .site-footer-meta {
248 position: relative;
249 width: var(--container);
250 margin-inline: auto;
251 }
252
253 .site-footer-main {
254 display: grid;
255 grid-template-columns: minmax(12rem, 1fr) minmax(0, 2.5fr);
256 gap: var(--space-7);
257 padding-block: var(--space-8) var(--space-7);
258 }
259
260 .site-footer-brand { display: grid; align-content: start; }
261 .site-wordmark-footer { color: var(--text); justify-self: start; }
262
263 .site-footer-links {
264 display: grid;
265 grid-template-columns: repeat(4, minmax(0, 1fr));
266 gap: var(--space-5);
267 }
268 .site-footer-folds { display: none; }
269
270 .site-footer-group { display: grid; gap: var(--space-2); align-content: start; }
271
272 .site-footer-label {
273 color: var(--muted);
274 font-size: var(--text-label);
275 font-weight: 500;
276 }
277
278 .site-footer-list { display: grid; gap: 2px; }
279 .site-footer-list a {
280 display: inline-flex;
281 align-items: center;
282 justify-self: start;
283 min-height: 1.75rem;
284 padding-inline: var(--space-2);
285 margin-inline: calc(-1 * var(--space-2));
286 color: var(--text);
287 font-size: var(--text-ui);
288 border-radius: var(--radius-control);
289 transition: background-color var(--dur-state) var(--ease-out);
290 }
291 .site-footer-list a:hover { background: var(--hover); }
292
293 .site-footer-fold { border-bottom: 1px solid var(--line); }
294 .site-footer-fold:first-child { border-top: 1px solid var(--line); }
295 .site-footer-fold summary {
296 display: flex;
297 align-items: center;
298 justify-content: space-between;
299 min-height: 3rem;
300 color: var(--text);
301 font-size: var(--text-body);
302 font-weight: 500;
303 list-style: none;
304 cursor: pointer;
305 }
306 .site-footer-fold summary::-webkit-details-marker { display: none; }
307 .site-footer-fold summary::after {
308 content: "";
309 width: 0.5rem;
310 height: 0.5rem;
311 margin-inline-end: 0.25rem;
312 border-inline-end: 1.5px solid currentColor;
313 border-block-end: 1.5px solid currentColor;
314 transform: translateY(-25%) rotate(45deg);
315 transition: transform var(--dur-state) var(--ease-out);
316 }
317 .site-footer-fold[open] summary::after { transform: translateY(25%) rotate(-135deg); }
318 .site-footer-fold .site-footer-list { padding-bottom: var(--space-3); }
319 .site-footer-fold .site-footer-list a { min-height: 2.75rem; font-size: var(--text-body); }
320
321 .site-footer-meta {
322 display: flex;
323 flex-wrap: wrap;
324 align-items: center;
325 justify-content: space-between;
326 gap: var(--space-3) var(--space-5);
327 padding-block: var(--space-4) var(--space-6);
328 border-top: 1px solid var(--line);
329 color: var(--muted);
330 font-size: var(--text-label);
331 }
332 .site-footer-meta a {
333 color: var(--text);
334 text-decoration: underline;
335 text-decoration-color: var(--line-strong);
336 text-underline-offset: 0.2em;
337 }
338 .site-footer-meta a:hover { text-decoration-color: currentColor; }
339
340 @media (max-width: 900px) {
341 .site-footer-main { grid-template-columns: 1fr; gap: var(--space-6); padding-block: var(--space-7) var(--space-6); }
342 }
343 @media (max-width: 640px) {
344 .site-footer-links { display: none; }
345 .site-footer-folds { display: block; }
346 .site-footer-meta { border-top: 0; padding-top: 0; }
347 }
348
349 @media print {
350 .site-footer { color: inherit; border-top: 1px solid currentColor; }
351 }
352
353 /* ---------- usage counting: the privacy page's control ---------- */
354 .usage-counting { display: grid; gap: var(--space-3); margin-top: var(--space-2); }
355 .usage-counting-status { color: var(--text); font-weight: 500; }
356 .usage-counting-elsewhere { color: var(--muted); font-size: var(--text-ui); }
357 .usage-counting-button {
358 display: inline-flex;
359 justify-self: start;
360 align-items: center;
361 min-height: 2.5rem;
362 padding-inline: var(--space-4);
363 color: var(--text);
364 background: var(--panel);
365 font-size: var(--text-ui);
366 font-weight: 500;
367 border: 1px solid var(--line-strong);
368 border-radius: var(--radius-control);
369 cursor: pointer;
370 transition: background-color var(--dur-state) var(--ease-out);
371 }
372 .usage-counting-button:hover { background: var(--hover); }
373
373 lines CSS