返回 CodeWhale
docs.css
根目录 / web / app / styles / docs.css
1 /* ------------------------------------------------------------------ */
2 /* Documentation portal */
3 /* ------------------------------------------------------------------ */
4
5 .docs-portal {
6 background: var(--paper);
7 }
8
9 .docs-hub-lede {
10 margin: 0.8rem 0 1.5rem;
11 color: var(--ink-soft);
12 }
13
14 .docs-shell {
15 display: grid;
16 grid-template-columns: minmax(13rem, 0.28fr) minmax(0, 0.72fr);
17 grid-template-areas: "sidebar content";
18 gap: clamp(2rem, 5vw, 4.5rem);
19 align-items: start;
20 padding-block: clamp(2.25rem, 5vw, 4rem);
21 }
22
23 .docs-sidebar {
24 grid-area: sidebar;
25 border-top: 1px solid var(--hairline);
26 }
27
28 .docs-sidebar-heading {
29 padding-block: 0.9rem;
30 border-bottom: 1px solid var(--hairline);
31 color: var(--ink);
32 font-size: 0.82rem;
33 font-weight: 600;
34 }
35
36 .docs-sidebar-heading a {
37 display: flex;
38 align-items: center;
39 justify-content: space-between;
40 gap: 1rem;
41 }
42
43 .docs-sidebar-heading a > span:last-child {
44 color: var(--ink-mute);
45 font-size: 0.75rem;
46 }
47
48 .docs-sidebar-group {
49 padding-block: 0.9rem;
50 border-bottom: 1px solid var(--hairline);
51 }
52
53 .docs-sidebar-category {
54 margin-bottom: 0.35rem;
55 color: var(--ink-mute);
56 font-size: 0.75rem;
57 font-weight: 600;
58 }
59
60 .docs-sidebar-link {
61 display: flex;
62 align-items: center;
63 justify-content: space-between;
64 gap: 0.8rem;
65 padding-block: 0.32rem;
66 color: var(--ink-soft);
67 font-size: 0.8rem;
68 line-height: 1.4;
69 transition: color var(--dur-state) var(--ease-spring);
70 }
71
72 .docs-sidebar-link:hover,
73 .docs-sidebar-link-current {
74 color: var(--docs-accent);
75 }
76
77 .docs-sidebar-link-current {
78 font-weight: 600;
79 }
80
81 .docs-sidebar-link > span:last-child:not(:first-child) {
82 color: var(--ink-mute);
83 font-size: 0.75rem;
84 }
85
86 .docs-content {
87 grid-area: content;
88 width: 100%;
89 max-width: 52rem;
90 }
91
92 .docs-content p {
93 max-width: 70ch;
94 }
95
96 .docs-breadcrumb {
97 margin-bottom: 1.15rem;
98 color: var(--ink-mute);
99 font-family: var(--font-mono);
100 font-size: 0.75rem;
101 }
102
103 .docs-breadcrumb ol {
104 display: flex;
105 flex-wrap: wrap;
106 align-items: baseline;
107 margin: 0;
108 padding: 0;
109 list-style: none;
110 }
111
112 .docs-breadcrumb li:not(:last-child)::after {
113 content: "/";
114 margin-inline: 0.5em;
115 color: var(--ink-mute);
116 }
117
118 .docs-breadcrumb a {
119 color: var(--indigo);
120 }
121
122 .docs-breadcrumb a:hover {
123 text-decoration: underline;
124 }
125
126 .docs-breadcrumb [aria-current="page"] {
127 color: var(--ink);
128 }
129
130 .docs-search-block {
131 margin-bottom: 2.25rem;
132 }
133
134 .docs-search-label {
135 display: block;
136 margin-bottom: 0.55rem;
137 color: var(--ink-mute);
138 font-size: 0.75rem;
139 font-weight: 600;
140 }
141
142 .docs-search-input {
143 min-height: 3rem;
144 padding-right: 3rem;
145 border-color: var(--paper-line-soft);
146 border-radius: var(--radius-control);
147 background: color-mix(in srgb, var(--paper) 88%, transparent);
148 }
149
150 .docs-search-clear {
151 position: absolute;
152 right: 0.9rem;
153 top: 50%;
154 translate: 0 -50%;
155 color: var(--ink-mute);
156 font-size: 0.82rem;
157 }
158
159 .docs-search-clear:hover {
160 color: var(--ink);
161 }
162
163 .docs-search-count {
164 margin-top: 0.55rem;
165 color: var(--ink-mute);
166 font-size: 0.75rem;
167 }
168
169 .docs-result-groups {
170 display: grid;
171 gap: 2.5rem;
172 }
173
174 .docs-result-heading {
175 display: flex;
176 align-items: baseline;
177 justify-content: space-between;
178 gap: 1rem;
179 margin-bottom: 0.55rem;
180 }
181
182 .docs-result-heading h2 {
183 font-size: 1.28rem;
184 letter-spacing: -0.02em;
185 }
186
187 .docs-result-heading > span {
188 color: var(--ink-mute);
189 font-size: 0.75rem;
190 }
191
192 .docs-topic-list {
193 border-top: 1px solid var(--hairline);
194 }
195
196 .docs-topic-row {
197 display: grid;
198 grid-template-columns: minmax(0, 1fr) auto;
199 gap: 1.25rem;
200 align-items: center;
201 padding-block: 1rem;
202 border-bottom: 1px solid var(--hairline);
203 transition: background-color var(--dur-state) var(--ease-spring), color var(--dur-state) var(--ease-spring);
204 }
205
206 .docs-topic-row:hover {
207 color: var(--docs-accent);
208 background: var(--hover);
209 }
210
211 .docs-topic-title {
212 display: flex;
213 flex-wrap: wrap;
214 gap: 0.5rem;
215 align-items: baseline;
216 color: var(--ink);
217 font-size: 0.9rem;
218 font-weight: 600;
219 }
220
221 .docs-topic-title > span:last-child {
222 color: var(--ink-mute);
223 font-size: 0.75rem;
224 font-weight: 500;
225 }
226
227 .docs-topic-main p {
228 margin-top: 0.28rem;
229 color: var(--ink-soft);
230 font-size: 0.78rem;
231 line-height: 1.55;
232 }
233
234 .docs-topic-arrow {
235 color: var(--ink-mute);
236 font-size: 0.78rem;
237 }
238
239 /* A topic row and, beside it, the files it is written from. */
240 .docs-topic-item {
241 display: grid;
242 grid-template-columns: minmax(0, 1fr) auto;
243 align-items: start;
244 column-gap: 1rem;
245 border-bottom: 1px solid var(--hairline);
246 }
247 .docs-topic-item > .docs-topic-row { border-bottom: 0; }
248 .docs-topic-details { padding-block: 1rem; }
249 .docs-topic-details > summary {
250 color: var(--ink-mute);
251 font-size: 0.75rem;
252 cursor: pointer;
253 border-radius: var(--radius-control);
254 }
255 .docs-topic-details > summary:hover { color: var(--ink); }
256 .docs-topic-details { max-width: 15rem; text-align: end; }
257 .docs-topic-source {
258 margin-top: 0.4rem;
259 color: var(--ink-mute);
260 font-size: 0.75rem;
261 line-height: 1.6;
262 overflow-wrap: anywhere;
263 }
264 .docs-topic-source code { font-family: var(--font-mono); }
265
266 .docs-source-note {
267 margin-top: 2.5rem;
268 padding-top: 1.25rem;
269 border-top: 1px solid var(--hairline);
270 }
271
272 .docs-source-note p {
273 max-width: 70ch;
274 color: var(--ink-mute);
275 font-size: 0.75rem;
276 line-height: 1.6;
277 }
278
279 @media (max-width: 900px) {
280 .docs-shell {
281 grid-template-columns: 1fr;
282 grid-template-areas:
283 "content"
284 "sidebar";
285 }
286
287 /* The one docs nav stays reachable below the article: the groups reflow
288 into columns so 23 topics read as an index, not a scroll of links. */
289 .docs-sidebar nav {
290 display: grid;
291 grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
292 column-gap: 2rem;
293 }
294
295 .docs-sidebar-group:last-child { border-bottom: 0; }
296 }
297
298 @media (max-width: 640px) {
299 .docs-topic-row { gap: 0.6rem 1rem; }
300 }
301
302 /* ------------------------------------------------------------------ */
303 /* Docs theme */
304 /* */
305 /* The docs sheet follows the site-wide theme like every other page: */
306 /* the OS appearance by default, or the choice pinned by the theme */
307 /* toggle. The sheet inks (`--docs-*`) are declared beside :root in */
308 /* both schemes, so nothing here is scoped to a dark region. */
309 /* ------------------------------------------------------------------ */
310
311 .docs-theme {
312 background: var(--paper);
313 color: var(--ink);
314 }
315
316 .docs-theme .portal-button-secondary {
317 border-color: var(--docs-button-border);
318 background: var(--docs-button-bg);
319 color: var(--docs-button-text);
320 }
321
322 .docs-theme .portal-button-secondary:hover {
323 background: var(--hover);
324 }
325
326 .release-truth.dotline {
327 font-size: var(--text-body);
328 }
329
330 .release-truth .release-truth-label {
331 font-size: inherit;
332 }
333
333 lines CSS