|
142 | 142 | .section-actions { margin-left: 0; } |
143 | 143 | } |
144 | 144 |
|
| 145 | + /* SR ONLY */ |
| 146 | + .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; } |
| 147 | +
|
145 | 148 | /* REDUCED MOTION */ |
146 | 149 | @media (prefers-reduced-motion: reduce) { |
147 | 150 | html { scroll-behavior: auto; } |
|
199 | 202 | <div class="section-header"> |
200 | 203 | <h2>Skills</h2> |
201 | 204 | <span class="count">{{ skill_count }}</span> |
| 205 | + <div class="section-actions"> |
| 206 | + <button class="btn-sm toggle-section" data-target="skills-body">Collapse</button> |
| 207 | + </div> |
202 | 208 | </div> |
203 | | - <table class="data-table"> |
204 | | - <thead><tr><th>Name</th><th>Description</th></tr></thead> |
205 | | - <tbody> |
206 | | - {% for skill in skills %} |
207 | | - <tr> |
208 | | - <td class="name-cell">{{ skill.name }}</td> |
209 | | - <td>{{ skill.description }}</td> |
210 | | - </tr> |
211 | | - {% endfor %} |
212 | | - </tbody> |
213 | | - </table> |
| 209 | + <details class="cat-group" id="skills-body" open> |
| 210 | + <summary class="sr-only">Skills list</summary> |
| 211 | + <div class="cat-body"> |
| 212 | + <table class="data-table"> |
| 213 | + <thead><tr><th>Name</th><th>Description</th></tr></thead> |
| 214 | + <tbody> |
| 215 | + {% for skill in skills %} |
| 216 | + <tr> |
| 217 | + <td class="name-cell">{{ skill.name }}</td> |
| 218 | + <td>{{ skill.description }}</td> |
| 219 | + </tr> |
| 220 | + {% endfor %} |
| 221 | + </tbody> |
| 222 | + </table> |
| 223 | + </div> |
| 224 | + </details> |
214 | 225 | </section> |
215 | 226 | {% endif %} |
216 | 227 |
|
|
220 | 231 | <div class="section-header"> |
221 | 232 | <h2>Rules</h2> |
222 | 233 | <span class="count">{{ rule_count }}</span> |
| 234 | + <div class="section-actions"> |
| 235 | + <button class="btn-sm toggle-section" data-target="rules-body">Collapse</button> |
| 236 | + </div> |
223 | 237 | </div> |
224 | | - <table class="data-table"> |
225 | | - <thead><tr><th>Name</th><th>Scope</th><th>Description</th></tr></thead> |
226 | | - <tbody> |
227 | | - {% for rule in rules %} |
228 | | - <tr> |
229 | | - <td class="name-cell">{{ rule.name }}</td> |
230 | | - <td class="scope-cell">{{ rule.scope }}</td> |
231 | | - <td>{{ rule.description }}</td> |
232 | | - </tr> |
233 | | - {% endfor %} |
234 | | - </tbody> |
235 | | - </table> |
| 238 | + <details class="cat-group" id="rules-body" open> |
| 239 | + <summary class="sr-only">Rules list</summary> |
| 240 | + <div class="cat-body"> |
| 241 | + <table class="data-table"> |
| 242 | + <thead><tr><th>Name</th><th>Scope</th><th>Description</th></tr></thead> |
| 243 | + <tbody> |
| 244 | + {% for rule in rules %} |
| 245 | + <tr> |
| 246 | + <td class="name-cell">{{ rule.name }}</td> |
| 247 | + <td class="scope-cell">{{ rule.scope }}</td> |
| 248 | + <td>{{ rule.description }}</td> |
| 249 | + </tr> |
| 250 | + {% endfor %} |
| 251 | + </tbody> |
| 252 | + </table> |
| 253 | + </div> |
| 254 | + </details> |
236 | 255 | </section> |
237 | 256 | {% endif %} |
238 | 257 |
|
|
292 | 311 | <!-- Install --> |
293 | 312 | {% if site.installSteps %} |
294 | 313 | <section class="section" id="install"> |
295 | | - <div class="section-header"><h2>Installation</h2></div> |
296 | | - <ol class="install-steps"> |
297 | | - {% for step in site.installSteps %} |
298 | | - <li><span>{{ step | safe }}</span></li> |
299 | | - {% endfor %} |
300 | | - </ol> |
| 314 | + <div class="section-header"> |
| 315 | + <h2>Installation</h2> |
| 316 | + <div class="section-actions"> |
| 317 | + <button class="btn-sm toggle-section" data-target="install-body">Collapse</button> |
| 318 | + </div> |
| 319 | + </div> |
| 320 | + <details class="cat-group" id="install-body" open> |
| 321 | + <summary class="sr-only">Installation steps</summary> |
| 322 | + <div class="cat-body"> |
| 323 | + <ol class="install-steps"> |
| 324 | + {% for step in site.installSteps %} |
| 325 | + <li><span>{{ step | safe }}</span></li> |
| 326 | + {% endfor %} |
| 327 | + </ol> |
| 328 | + </div> |
| 329 | + </details> |
301 | 330 | </section> |
302 | 331 | {% endif %} |
303 | 332 |
|
|
420 | 449 | }); |
421 | 450 | })(); |
422 | 451 |
|
| 452 | + /* Section collapse/expand toggles (Skills, Rules) */ |
| 453 | + (function () { |
| 454 | + document.querySelectorAll('.toggle-section').forEach(function (btn) { |
| 455 | + var targetId = btn.getAttribute('data-target'); |
| 456 | + var details = document.getElementById(targetId); |
| 457 | + if (!details) return; |
| 458 | + function updateLabel() { btn.textContent = details.open ? 'Collapse' : 'Expand'; } |
| 459 | + btn.addEventListener('click', function () { details.open = !details.open; updateLabel(); }); |
| 460 | + details.addEventListener('toggle', updateLabel); |
| 461 | + }); |
| 462 | + })(); |
| 463 | +
|
423 | 464 | /* Scroll spy */ |
424 | 465 | (function () { |
425 | 466 | var links = document.querySelectorAll('.nav-links a[href^="#"]'); |
|
0 commit comments