Skip to content

Commit f0c739e

Browse files
💄🔧:keep the docs index styles off the docs pages
The index and every page under it carry the same `docs` body class, so the index's resets reached all thirteen: `margin: 0` on their headings, paragraphs and lists, and `list-style: none` on the lists. 123 paragraphs, 31 headings and 14 lists rendered without spacing, and the lists without bullets. Scoping the resets to `main` was not enough, because the pages have a `main` of their own. The index now carries `docs-index` as well and its styles read that, so `docs` means only what the navigation reads it for. Signed-off-by: Derek Lewis <DerekNonGeneric@inf.is> Assisted-by: Claude-Code:claude-opus-5 PR-URL: #1845
1 parent 6ec3c4c commit f0c739e

2 files changed

Lines changed: 39 additions & 38 deletions

File tree

‎_assets/styles/_docs.scss‎

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,34 @@ $docs-flag-text: shade-color($quaternary, 25%);
2121
// Scoped to `main` to keep the resets off the navbar and footer, which are
2222
// its siblings under the same body class. The padding replaces what
2323
// `main > .container` gives the footer elsewhere.
24-
.docs main {
24+
.docs-index main {
2525
padding-bottom: 104px;
2626
}
2727

28-
.docs main h1,
29-
.docs main h2,
30-
.docs main p,
31-
.docs main dl,
32-
.docs main dd,
33-
.docs main ul {
28+
.docs-index main h1,
29+
.docs-index main h2,
30+
.docs-index main p,
31+
.docs-index main dl,
32+
.docs-index main dd,
33+
.docs-index main ul {
3434
margin: 0;
3535
}
3636

37-
.docs main ul {
37+
.docs-index main ul {
3838
padding: 0;
3939
list-style: none;
4040
}
4141

42-
.docs main a {
42+
.docs-index main a {
4343
color: $docs-link;
4444
}
4545

46-
.docs main :focus-visible {
46+
.docs-index main :focus-visible {
4747
outline: 2px solid $body-color;
4848
outline-offset: 2px;
4949
}
5050

51-
.docs .wrap {
51+
.docs-index .wrap {
5252
max-width: $docs-wrap;
5353
padding-inline: $docs-gutter;
5454
margin-inline: auto;
@@ -151,30 +151,30 @@ $docs-flag-text: shade-color($quaternary, 25%);
151151

152152
// Links on the ink. `.docs main a` is (0,1,2), so a band rule needs `main`
153153
// to reach them.
154-
.docs main .docs-head a {
154+
.docs-index main .docs-head a {
155155
color: $body-bg;
156156
}
157157

158158
// The treatment `.join-row a` gives the home page's equivalent link.
159-
.docs main .invite-row a {
159+
.docs-index main .invite-row a {
160160
font-family: $font-family-monospace;
161161
font-weight: 700;
162162
color: $body-bg;
163163
}
164164

165165
/* --- Shared section furniture ------------------------------------------ */
166166

167-
.docs .band {
167+
.docs-index .band {
168168
padding-block: clamp(2.5rem, 6vw, 4rem);
169169
}
170170

171171
// The handbook is the substance of this page, so it sits on its own ground.
172-
.docs .band-quiet {
172+
.docs-index .band-quiet {
173173
background-color: color.mix($tertiary, $body-bg, 12%);
174174
border-block: 1px solid $docs-hairline;
175175
}
176176

177-
.docs .section-head {
177+
.docs-index .section-head {
178178
display: flex;
179179
flex-wrap: wrap;
180180
gap: 0.5rem 1rem;
@@ -184,18 +184,18 @@ $docs-flag-text: shade-color($quaternary, 25%);
184184
border-bottom: 2px solid $body-color;
185185
}
186186

187-
.docs .section-title {
187+
.docs-index .section-title {
188188
font-size: 1.125rem;
189189
font-weight: 700;
190190
letter-spacing: -0.01em;
191191
}
192192

193-
.docs .section-more {
193+
.docs-index .section-more {
194194
font-family: $font-family-monospace;
195195
font-size: 0.8125rem;
196196
}
197197

198-
.docs .section-count {
198+
.docs-index .section-count {
199199
font-family: $font-family-monospace;
200200
font-size: 0.8125rem;
201201
color: $docs-muted;
@@ -208,24 +208,24 @@ $docs-flag-text: shade-color($quaternary, 25%);
208208
as the home page's "How we work".
209209
*/
210210

211-
.docs .part-list {
211+
.docs-index .part-list {
212212
display: grid;
213213
grid-template-columns: repeat(2, minmax(0, 1fr));
214214
gap: 0 clamp(1.5rem, 4vw, 3rem);
215215
margin-top: 1.75rem !important;
216216
}
217217

218-
.docs .part-item {
218+
.docs-index .part-item {
219219
padding-block: 1.375rem;
220220
border-bottom: 1px solid $docs-hairline;
221221
}
222222

223-
.docs .part-name {
223+
.docs-index .part-name {
224224
font-size: 1.0625rem;
225225
font-weight: 700;
226226
}
227227

228-
.docs .part-what {
228+
.docs-index .part-what {
229229
margin-top: 0.375rem !important;
230230
font-size: 0.9375rem;
231231
line-height: 1.6;
@@ -237,33 +237,33 @@ $docs-flag-text: shade-color($quaternary, 25%);
237237
read as an index. The numeral uses `.area-num`'s recipe from the home page.
238238
*/
239239

240-
.docs .handbook-lede {
240+
.docs-index .handbook-lede {
241241
max-width: 60ch;
242242
margin-top: 1.25rem !important;
243243
font-size: 0.9375rem;
244244
line-height: 1.65;
245245
color: $docs-muted;
246246
}
247247

248-
.docs .rule-list {
248+
.docs-index .rule-list {
249249
margin-top: 1.75rem !important;
250250
}
251251

252-
.docs .rule {
252+
.docs-index .rule {
253253
display: grid;
254254
grid-template-columns: minmax(0, 19rem) minmax(0, 1fr);
255255
gap: 0.25rem 2rem;
256256
padding-block: 0.875rem;
257257
border-bottom: 1px solid rgb(167 151 139 / 35%);
258258
}
259259

260-
.docs .rule:first-child {
260+
.docs-index .rule:first-child {
261261
border-top: 1px solid rgb(167 151 139 / 35%);
262262
}
263263

264264
// A grid, so the numeral keeps its own column and stays beside the first
265265
// line of a title long enough to wrap.
266-
.docs .rule-name {
266+
.docs-index .rule-name {
267267
display: grid;
268268
grid-template-columns: 1.375rem minmax(0, 1fr);
269269
gap: 0.5rem;
@@ -272,27 +272,27 @@ $docs-flag-text: shade-color($quaternary, 25%);
272272
font-weight: 700;
273273
}
274274

275-
.docs .rule-num {
275+
.docs-index .rule-num {
276276
font-family: $font-family-monospace;
277277
font-size: 0.75rem;
278278
font-weight: 400;
279279
color: $docs-link;
280280
}
281281

282-
.docs .rule-heading {
282+
.docs-index .rule-heading {
283283
display: flex;
284284
flex-wrap: wrap;
285285
gap: 0.5rem;
286286
align-items: baseline;
287287
}
288288

289-
.docs .rule-point {
289+
.docs-index .rule-point {
290290
font-size: 0.9375rem;
291291
line-height: 1.6;
292292
}
293293

294294
// The chip carries the state in text, so it does not rest on colour alone.
295-
.docs .rule-flag {
295+
.docs-index .rule-flag {
296296
padding: 0.0625rem 0.4375rem;
297297
font-family: $font-family-monospace;
298298
font-size: 0.6875rem;
@@ -303,7 +303,7 @@ $docs-flag-text: shade-color($quaternary, 25%);
303303
background-color: $docs-flag-bg;
304304
}
305305

306-
.docs .handbook-gap {
306+
.docs-index .handbook-gap {
307307
max-width: 60ch;
308308
margin-top: 1.5rem !important;
309309
font-size: 0.9375rem;
@@ -316,11 +316,11 @@ $docs-flag-text: shade-color($quaternary, 25%);
316316
third pillar the page does not have.
317317
*/
318318

319-
.docs .band-tail {
319+
.docs-index .band-tail {
320320
padding-block: clamp(1.5rem, 3vw, 2rem);
321321
}
322322

323-
.docs .tail-title {
323+
.docs-index .tail-title {
324324
font-family: $font-family-monospace;
325325
font-size: 0.75rem;
326326
font-weight: 700;
@@ -329,7 +329,7 @@ $docs-flag-text: shade-color($quaternary, 25%);
329329
letter-spacing: 0.08em;
330330
}
331331

332-
.docs .tail-what {
332+
.docs-index .tail-what {
333333
max-width: 60ch;
334334
margin-top: 0.625rem !important;
335335
font-size: 0.9375rem;
@@ -346,12 +346,12 @@ $docs-flag-text: shade-color($quaternary, 25%);
346346
}
347347

348348
@media (width < 760px) {
349-
.docs .part-list {
349+
.docs-index .part-list {
350350
grid-template-columns: minmax(0, 1fr);
351351
}
352352

353353
// The name column stops earning its width once the point beside it wraps.
354-
.docs .rule {
354+
.docs-index .rule {
355355
grid-template-columns: minmax(0, 1fr);
356356
gap: 0.375rem;
357357
}

‎collections/_pages/docs.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
How to take part in OpenINF, and the house style the work is written in.
77
body_classes:
88
- docs
9+
- docs-index
910
eleventyImport:
1011
collections: ['handbook', 'communityDocs']
1112
---

0 commit comments

Comments
 (0)