返回 CodeWhale
utilities.css
根目录 / web / app / styles / utilities.css
1 /* ------------------------------------------------------------------ */
2 /* Utilities — focus, selection, links, sheet motion */
3 /* ------------------------------------------------------------------ */
4
5 /* ---------- focus + selection ---------- */
6 /* The one focus treatment on the site: a 2px ring at a 3px offset in the
7 accent. Components may add the bioluminescent halo (--glow-focus) as a
8 box-shadow; none restyles or removes the ring. */
9 ::selection { background: var(--selection); }
10 :focus-visible { outline: var(--gpui-focus-width) solid var(--ring); outline-offset: var(--gpui-focus-offset); }
11
12 /* ---------- links ---------- */
13 a { color: inherit; text-decoration: none; }
14
15 /* A link in running text: accent ink, a quiet underline that firms on
16 hover. `.body-link` is the legacy name for the same recipe. */
17 .link,
18 a.body-link,
19 .prose a {
20 color: var(--accent);
21 text-decoration: underline;
22 text-decoration-thickness: 1px;
23 text-underline-offset: 0.2em;
24 text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
25 transition: text-decoration-color var(--dur-state) var(--ease-out);
26 }
27 .link:hover,
28 a.body-link:hover,
29 .prose a:hover { text-decoration-color: var(--accent); }
30 .link .icon { margin-inline-start: 0.25em; }
31
32 /* ---------- the mobile sheet ---------- */
33 /* The sheet arrives (opacity plus a 4px rise) and leaves faster than it
34 came. No per-item stagger. Reduced motion mounts and unmounts at once. */
35 @media (prefers-reduced-motion: no-preference) {
36 .mm-panel {
37 animation: mm-in var(--dur-arrive) var(--ease-out) both;
38 }
39
40 .mm-panel.mm-closing {
41 animation: mm-out var(--dur-exit) var(--ease-in) both;
42 pointer-events: none;
43 }
44
45 /* Content that arrives after an action (a retried feed, a result set). */
46 .arrive {
47 animation: mm-in var(--dur-arrive) var(--ease-out) both;
48 }
49 }
50
51 @keyframes mm-in {
52 from { opacity: 0; transform: translateY(-0.25rem); }
53 to { opacity: 1; transform: translateY(0); }
54 }
55
56 @keyframes mm-out {
57 from { opacity: 1; transform: translateY(0); }
58 to { opacity: 0; transform: translateY(-0.25rem); }
59 }
60
61 /* ---------- responsive chrome ---------- */
62 @media (max-width: 900px) {
63 .site-nav-inner { gap: 1rem; }
64 .site-github-link { display: none; }
65 }
66
67 /* Anchor fallback; page-level scroll-mt utilities can override it. */
68 :where([id]) { scroll-margin-top: 5rem; }
69
70 [dir="rtl"] .icon-flip { transform: scaleX(-1); }
71
71 lines CSS