@capagents/forgeqe 3.1.0 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/HOW_TO_USE.md +465 -95
  2. package/README.md +21 -6
  3. package/THIRD_PARTY_NOTICES.md +210 -1
  4. package/dist/docs-site/CREDITS.md +6 -0
  5. package/dist/docs-site/architecture-map/index.html +1 -1
  6. package/dist/docs-site/docs/app-theme.css +100 -8
  7. package/dist/docs-site/docs/architecture/index.html +210 -214
  8. package/dist/docs-site/docs/area-api/index.html +350 -0
  9. package/dist/docs-site/docs/area-automated-tests/index.html +967 -0
  10. package/dist/docs-site/docs/area-browser/index.html +430 -0
  11. package/dist/docs-site/docs/area-data/index.html +605 -0
  12. package/dist/docs-site/docs/area-desktop/index.html +755 -0
  13. package/dist/docs-site/docs/area-mobile/index.html +631 -0
  14. package/dist/docs-site/docs/area-operations/index.html +1069 -0
  15. package/dist/docs-site/docs/area-pull-requests/index.html +208 -0
  16. package/dist/docs-site/docs/area-quality/index.html +365 -0
  17. package/dist/docs-site/docs/area-release/index.html +320 -0
  18. package/dist/docs-site/docs/area-setup/index.html +1192 -0
  19. package/dist/docs-site/docs/area-systems/index.html +207 -0
  20. package/dist/docs-site/docs/area-test-cases/index.html +694 -0
  21. package/dist/docs-site/docs/containers/index.html +97 -104
  22. package/dist/docs-site/docs/cost-architecture/index.html +108 -112
  23. package/dist/docs-site/docs/custom-agents-first-run/index.html +19 -23
  24. package/dist/docs-site/docs/desktop/index.html +172 -162
  25. package/dist/docs-site/docs/desktop-ci/index.html +26 -33
  26. package/dist/docs-site/docs/evidence/index.html +253 -257
  27. package/dist/docs-site/docs/feature-test-prompts/index.html +66 -70
  28. package/dist/docs-site/docs/get-started/index.html +495 -0
  29. package/dist/docs-site/docs/graphify/index.html +42 -46
  30. package/dist/docs-site/docs/guardrails/index.html +17 -21
  31. package/dist/docs-site/docs/index.html +17 -6708
  32. package/dist/docs-site/docs/mobile/index.html +155 -162
  33. package/dist/docs-site/docs/model-routing/index.html +44 -51
  34. package/dist/docs-site/docs/overview/index.html +176 -0
  35. package/dist/docs-site/docs/product-graph/index.html +52 -55
  36. package/dist/docs-site/docs/product-knowledge/index.html +11 -15
  37. package/dist/docs-site/docs/product-views/index.html +53 -57
  38. package/dist/docs-site/docs/reference/index.html +379 -0
  39. package/dist/docs-site/docs/search.js +1 -1
  40. package/dist/docs-site/docs/using/index.html +480 -0
  41. package/dist/docs-site/docs/web-app/index.html +147 -93
  42. package/dist/docs-site/security/index.html +930 -0
  43. package/dist/docs-site/security/security-theme.css +161 -0
  44. package/dist/docs-site/security/security.js +1465 -0
  45. package/dist/docs-site/vendor/react-18.3.1.production.min.js +31 -0
  46. package/dist/docs-site/vendor/react-dom-18.3.1.production.min.js +267 -0
  47. package/dist/docs-site/vendor/reactflow-11.11.4.umd.js +10 -0
  48. package/dist/forgeqe.js +2251 -1886
  49. package/dist/web/THIRD_PARTY_NOTICES.md +0 -136
  50. package/dist/web/assets/Agent-CPhmZdFX.js +8 -0
  51. package/dist/web/assets/AgentWork-BXdN9xgi.js +2 -0
  52. package/dist/web/assets/ApiTests-Do3xLjfB.js +10 -0
  53. package/dist/web/assets/Browse-WVkJT6Bs.js +2 -0
  54. package/dist/web/assets/Chat-CDc9UcQX.js +3 -0
  55. package/dist/web/assets/CommandPalette-BAZm62lV.js +1 -0
  56. package/dist/web/assets/Compare-Br6n9T9L.js +1 -0
  57. package/dist/web/assets/Cost-BBUyBu3Y.js +1 -0
  58. package/dist/web/assets/Data-Ch2DPEWp.js +6 -0
  59. package/dist/web/assets/Desktop-Qzoq-cQv.js +1 -0
  60. package/dist/web/assets/DesktopReview-CF_jQYAM.js +1 -0
  61. package/dist/web/assets/Evidence-C72Lj5_Q.js +1 -0
  62. package/dist/web/assets/Explore-ObkEpUyS.js +2 -0
  63. package/dist/web/assets/Features-CQzNo_WP.js +1 -0
  64. package/dist/web/assets/Flags-0-RniPJm.js +2 -0
  65. package/dist/web/assets/Flaky-BPJvNLCA.js +1 -0
  66. package/dist/web/assets/Impact-CfccsL_k.js +3 -0
  67. package/dist/web/assets/Jobs-T6m4zhDy.js +5 -0
  68. package/dist/web/assets/KindPage-BDUvWe2p.js +6 -0
  69. package/dist/web/assets/Migration-Dqeh4x5u.js +2 -0
  70. package/dist/web/assets/PageAgent-DNjzIgeY.js +1 -0
  71. package/dist/web/assets/Product-nYV_scOV.js +7 -0
  72. package/dist/web/assets/Production-CGSbEWVa.js +1 -0
  73. package/dist/web/assets/Quality-BIypojZm.js +1 -0
  74. package/dist/web/assets/Readiness-BlRjwJRg.js +1 -0
  75. package/dist/web/assets/Record-v2KLI-_Z.js +1 -0
  76. package/dist/web/assets/Regression-B-jSt4Jz.js +5 -0
  77. package/dist/web/assets/RelationGraph-8J98lOVG.js +1 -0
  78. package/dist/web/assets/Reports-GI4u6SyW.js +2 -0
  79. package/dist/web/assets/Response-mhBThq2b.js +9 -0
  80. package/dist/web/assets/Responsive-DXu7Ra7K.js +3 -0
  81. package/dist/web/assets/RunDiff-D0SHDNp0.js +1 -0
  82. package/dist/web/assets/Runs-C1Gjdi9M.js +2 -0
  83. package/dist/web/assets/Settings-BGGeuvyF.js +21 -0
  84. package/dist/web/assets/Steps-D-YG0eJy.js +2 -0
  85. package/dist/web/assets/TestCases-DC4w77eQ.js +1 -0
  86. package/dist/web/assets/TestData-CvKWRVVV.js +2 -0
  87. package/dist/web/assets/TestDebt-D8YzN29_.js +1 -0
  88. package/dist/web/assets/TestManagement-C5cDCqrD.js +1 -0
  89. package/dist/web/assets/Tosca-BGUv3RiJ.js +3 -0
  90. package/dist/web/assets/WhatsNew-B_Gyuv8O.js +1 -0
  91. package/dist/web/assets/agents-C0Jg2pN8.js +1 -0
  92. package/dist/web/assets/coverage-BMP6ELFJ.js +5 -0
  93. package/dist/web/assets/dataParts-DbeCj9ga.js +3 -0
  94. package/dist/web/assets/diff-BStuTmsN.js +2 -0
  95. package/dist/web/assets/families-BBFFrUlo.js +1 -0
  96. package/dist/web/assets/filters-CnAMr286.js +1 -0
  97. package/dist/web/assets/fold-D_O_VZui.js +1 -0
  98. package/dist/web/assets/head-CRo48rPt.js +1 -0
  99. package/dist/web/assets/highlight-BcFZIf59.js +4 -0
  100. package/dist/web/assets/index-B3JsM7tv.js +64 -0
  101. package/dist/web/assets/index-CafApcbZ.css +2 -0
  102. package/dist/web/assets/input-CtzK50ZF.js +1 -0
  103. package/dist/web/assets/jsx-runtime-LKYXHABd.js +1 -0
  104. package/dist/web/assets/line-icons-rdF8DYDJ.js +1 -0
  105. package/dist/web/assets/logos-D4oVWzqa.js +1 -0
  106. package/dist/web/assets/palette-DAaGSao7.js +1 -0
  107. package/dist/web/assets/paletteCommands-Co-RlQ8q.js +1 -0
  108. package/dist/web/assets/parts-D357Wolo.js +1 -0
  109. package/dist/web/assets/productParts-B8oHRCJF.js +1 -0
  110. package/dist/web/assets/qualityParts-BLkmIfDY.js +1 -0
  111. package/dist/web/assets/recordTest-Cez2sDJO.js +1 -0
  112. package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  113. package/dist/web/assets/route-BloYJWgw.js +1 -0
  114. package/dist/web/index.html +12 -12
  115. package/docs/ARCHITECTURE.md +1 -1
  116. package/docs/BASAL.md +1 -1
  117. package/docs/DESKTOP.md +20 -1
  118. package/docs/EVIDENCE.md +1 -1
  119. package/docs/MOBILE.md +4 -4
  120. package/docs/PRODUCT_KNOWLEDGE.md +2 -0
  121. package/docs/WEB_APP.md +114 -51
  122. package/docs/user-guide.html +463 -87
  123. package/forgeqe.example.yaml +3 -3
  124. package/package.json +1 -1
  125. package/prompts/page-differs.md +1 -1
  126. package/prompts/requests-rule.md +1 -1
  127. package/prompts/responsive-review.md +38 -0
  128. package/prompts/responsive-split.md +40 -0
  129. package/prompts/responsive.md +42 -0
  130. package/prompts/test-reviewer.md +1 -1
  131. package/prompts/test-rules.md +3 -4
  132. package/skills/web-guidance/LICENSE +202 -0
  133. package/skills/web-guidance/SKILL.md +76 -0
  134. package/skills/web-guidance/UPSTREAM +67 -0
  135. package/skills/web-guidance/references/accessibility/accessibility.md +585 -0
  136. package/skills/web-guidance/references/accessibility/accessible-error-announcement.md +302 -0
  137. package/skills/web-guidance/references/accessibility/accessible-generated-content.md +41 -0
  138. package/skills/web-guidance/references/accessibility/respect-os-text-scale.md +127 -0
  139. package/skills/web-guidance/references/css/responsive-design.md +16 -0
  140. package/skills/web-guidance/references/forms/autofill-address-form.md +86 -0
  141. package/skills/web-guidance/references/forms/autofill-payment-form.md +142 -0
  142. package/skills/web-guidance/references/forms/autofill-sign-in-form.md +145 -0
  143. package/skills/web-guidance/references/forms/autofill-sign-up-form.md +155 -0
  144. package/skills/web-guidance/references/forms/forms.md +415 -0
  145. package/skills/web-guidance/references/forms/ime-safe-enter-submit.md +115 -0
  146. package/skills/web-guidance/references/forms/required-field-feedback.md +317 -0
  147. package/skills/web-guidance/references/forms/select-menu-interaction.md +310 -0
  148. package/skills/web-guidance/references/forms/slider.md +184 -0
  149. package/skills/web-guidance/references/forms/sms-otp-form.md +208 -0
  150. package/skills/web-guidance/references/forms/switch.md +60 -0
  151. package/skills/web-guidance/references/forms/validate-input-after-interaction.md +406 -0
  152. package/skills/web-guidance/references/performance/break-up-long-tasks.md +64 -0
  153. package/skills/web-guidance/references/performance/identify-heavy-scripts.md +69 -0
  154. package/skills/web-guidance/references/performance/identify-inp-causes.md +105 -0
  155. package/skills/web-guidance/references/performance/interaction-paint-timing.md +200 -0
  156. package/skills/web-guidance/references/performance/optimize-image-priority.md +73 -0
  157. package/skills/web-guidance/references/performance/performance.md +384 -0
  158. package/skills/web-guidance/references/privacy/privacy.md +247 -0
  159. package/skills/web-guidance/references/security/passkey-authentication.md +218 -0
  160. package/skills/web-guidance/references/security/passkey-management.md +310 -0
  161. package/skills/web-guidance/references/security/passkey-reauthentication.md +142 -0
  162. package/skills/web-guidance/references/security/passkey-registration.md +186 -0
  163. package/skills/web-guidance/references/security/passkeys.md +39 -0
  164. package/skills/web-guidance/references/security/sanitize-untrusted-html.md +105 -0
  165. package/skills/web-guidance/references/security/secure-external-subresources.md +202 -0
  166. package/skills/web-guidance/references/security/security.md +390 -0
  167. package/skills/web-guidance/references/security/trusted-types.md +141 -0
  168. package/skills/web-guidance/references/security/validate-origins.md +197 -0
  169. package/skills/web-guidance/references/security/verify-email-ownership.md +235 -0
  170. package/skills/web-guidance/references/ui-atoms/position-aware-tooltips.md +173 -0
  171. package/skills/web-guidance/references/ui-atoms/responsive-table.md +122 -0
  172. package/skills/web-guidance/references/ui-atoms/viewport-aware-dropdowns.md +178 -0
  173. package/skills/web-guidance/references/ui-behaviors/drag-and-drop.md +108 -0
  174. package/skills/web-guidance/references/ui-behaviors/light-dismiss-a-dialog.md +89 -0
  175. package/skills/web-guidance/references/ui-behaviors/motion.md +97 -0
  176. package/skills/web-guidance/references/ui-behaviors/platform-controls-dismiss-dialog.md +40 -0
  177. package/skills/web-guidance/references/ui-behaviors/prevent-page-scroll-under-modal-dialog.md +59 -0
  178. package/skills/web-guidance/references/ui-behaviors/search-hidden-content.md +141 -0
  179. package/skills/web-guidance/references/ui-behaviors/sortable-table.md +140 -0
  180. package/skills/web-guidance/references/ui-components/accordion.md +343 -0
  181. package/skills/web-guidance/references/ui-components/breadcrumbs.md +168 -0
  182. package/skills/web-guidance/references/ui-components/carousel.md +206 -0
  183. package/skills/web-guidance/references/ui-components/checkbox.md +144 -0
  184. package/skills/web-guidance/references/ui-components/dialog.md +218 -0
  185. package/skills/web-guidance/references/ui-components/hovercard.md +391 -0
  186. package/skills/web-guidance/references/ui-components/menu.md +415 -0
  187. package/skills/web-guidance/references/ui-components/navbar.md +281 -0
  188. package/skills/web-guidance/references/ui-components/navigation-drawer.md +429 -0
  189. package/skills/web-guidance/references/ui-components/persistent-toast-notifications.md +185 -0
  190. package/skills/web-guidance/references/ui-components/progress.md +181 -0
  191. package/skills/web-guidance/references/ui-components/spinner.md +179 -0
  192. package/skills/web-guidance/references/ui-components/tabs.md +371 -0
  193. package/skills/web-guidance/references/ui-components/toolbar.md +277 -0
  194. package/skills/web-guidance/references/user-experience/form-factor-adaptation.md +120 -0
  195. package/skills/web-guidance/references/user-experience/natural-interactions.md +155 -0
  196. package/skills/web-guidance/references/visual-design/color.md +43 -0
  197. package/skills/web-guidance/references/visual-design/dark-mode.md +350 -0
  198. package/dist/web/assets/AgentWork-C3KdZh5M.js +0 -2
  199. package/dist/web/assets/ApiTests-BLnl7JGO.js +0 -10
  200. package/dist/web/assets/Browse-C-Enjpmd.js +0 -2
  201. package/dist/web/assets/Chat-Bt6jZI68.js +0 -3
  202. package/dist/web/assets/Choices-D5eTFinz.js +0 -3
  203. package/dist/web/assets/CommandPalette-D89NM2_E.js +0 -1
  204. package/dist/web/assets/Compare-YfFYHwfK.js +0 -1
  205. package/dist/web/assets/Cost-ClaDz0YR.js +0 -1
  206. package/dist/web/assets/Data-jSFgAfej.js +0 -6
  207. package/dist/web/assets/Desktop-BofKeLVf.js +0 -1
  208. package/dist/web/assets/DesktopReview--WjeZh3w.js +0 -1
  209. package/dist/web/assets/Evidence-CJNzSQpY.js +0 -1
  210. package/dist/web/assets/Explore-BdFvqgF4.js +0 -2
  211. package/dist/web/assets/Features-CIBbw6PG.js +0 -1
  212. package/dist/web/assets/Flags-B62v4uWR.js +0 -2
  213. package/dist/web/assets/Flaky-Cut1kZw6.js +0 -1
  214. package/dist/web/assets/Impact-jOSl5Q0k.js +0 -3
  215. package/dist/web/assets/Jobs-DMJGgWtQ.js +0 -5
  216. package/dist/web/assets/KindPage-BbQWH5wa.js +0 -6
  217. package/dist/web/assets/Migration-BBgv7xXo.js +0 -2
  218. package/dist/web/assets/PageAgent-txbNoP6u.js +0 -1
  219. package/dist/web/assets/Product-BrXH81Ns.js +0 -7
  220. package/dist/web/assets/Production-CCVtFNGQ.js +0 -1
  221. package/dist/web/assets/Quality-Dxh-60A8.js +0 -1
  222. package/dist/web/assets/Readiness-DyJvSOLN.js +0 -1
  223. package/dist/web/assets/Record-Dnlkimjb.js +0 -1
  224. package/dist/web/assets/Regression-D2DDTwzs.js +0 -5
  225. package/dist/web/assets/Reports-ClcY7M0Q.js +0 -2
  226. package/dist/web/assets/Response-D9FYUvHg.js +0 -9
  227. package/dist/web/assets/RunDiff-CNImaEdz.js +0 -1
  228. package/dist/web/assets/Runs-CFvmdULI.js +0 -2
  229. package/dist/web/assets/Steps-BS66s0E1.js +0 -2
  230. package/dist/web/assets/TestCases-CrQEUtfD.js +0 -1
  231. package/dist/web/assets/TestData-e3IX0xwG.js +0 -2
  232. package/dist/web/assets/TestDebt-tXPoexMF.js +0 -1
  233. package/dist/web/assets/TestManagement-wjGaoZzI.js +0 -1
  234. package/dist/web/assets/Tosca-C5YaMLS0.js +0 -3
  235. package/dist/web/assets/WhatsNew-CwnRbDnd.js +0 -1
  236. package/dist/web/assets/azuredevops-BcQ5AFOM.js +0 -1
  237. package/dist/web/assets/crew-CWfjZIxE.js +0 -1
  238. package/dist/web/assets/families-DWilSDct.js +0 -1
  239. package/dist/web/assets/filters-CVzIOjPG.js +0 -1
  240. package/dist/web/assets/fold-tvLGnxD1.js +0 -1
  241. package/dist/web/assets/frame-Deu1IqzV.js +0 -13
  242. package/dist/web/assets/index-BWMIKyPB.js +0 -76
  243. package/dist/web/assets/index-C2Yq55oT.css +0 -2
  244. package/dist/web/assets/line-icons-C_amZ5-o.js +0 -1
  245. package/dist/web/assets/logos-C1NBtBMc.js +0 -1
  246. package/dist/web/assets/logos-DFyhMw0i.js +0 -1
  247. package/dist/web/assets/markdown-DC2HA0yZ.js +0 -10
  248. package/dist/web/assets/paletteCommands-Qxm5DZIs.js +0 -1
  249. package/dist/web/assets/parts-BR6dUwqn.js +0 -1
  250. package/dist/web/assets/productParts-BxdHuSBa.js +0 -1
  251. package/dist/web/assets/qualityParts-lz6eYVxC.js +0 -1
  252. package/dist/web/assets/recordTest-CcplpTS6.js +0 -1
  253. package/dist/web/assets/today-DuQFapJM.js +0 -1
  254. package/dist/web/assets/when-CHnpLdYw.js +0 -1
@@ -0,0 +1,343 @@
1
+ # Accordion
2
+
3
+ Build accordions from a set of adjacent `details` elements.
4
+
5
+ If the accordion is a distinct section of the page, group its items in an element with an accessible name, such as a `section` labeled by the group heading.
6
+
7
+ ```html
8
+ <section class="accordion" aria-labelledby="faq-heading">
9
+ <h2 id="faq-heading">Frequently Asked Questions</h2>
10
+ <details>
11
+ <summary>Lorem ipsum dolor sit amet?</summary>
12
+ <!-- answer 1 -->
13
+ </details>
14
+ <details>
15
+ <summary>Consectetur adipiscing elit?</summary>
16
+ <!-- answer 2 -->
17
+ </details>
18
+ </section>
19
+ ```
20
+
21
+ **Warning:** Do not put headings inside `summary`. JAWS and TalkBack expose `summary` as a button and drop any heading inside it, so their users cannot move between items by heading.
22
+ If each item needs its own heading, build a custom accordion instead (see below).
23
+
24
+ Accessibility notes:
25
+ - Do not wrap every small accordion in a landmark or `region`; that adds navigation noise for screen reader users.
26
+ - Do not add arrow key navigation, roving `tabindex`, or `Home`/`End` handling.
27
+ Accordion contents are often long enough to need scrolling, and arrow keys on a focused trigger are how keyboard users scroll.
28
+ - If a heading for the entire accordion is not desirable, use an `aria-label` on the container element to provide an accessible name for the group.
29
+
30
+ ## Exclusive accordions
31
+
32
+ An exclusive accordion only allows one item to be open at a time.
33
+
34
+ To make an accordion exclusive, add the same `name` to each `details` element that should be part of the exclusive group.
35
+ Ensure that `name` is not used elsewhere on the page unless it is intended to be part of the same exclusive accordion group.
36
+
37
+ ```html
38
+ <section class="accordion" aria-labelledby="faq-heading">
39
+ <h2 id="faq-heading">Frequently Asked Questions</h2>
40
+ <details name="faq-question">
41
+ <summary>Lorem ipsum dolor sit amet?</summary>
42
+ <!-- answer 1 -->
43
+ </details>
44
+ <details name="faq-question">
45
+ <summary>Consectetur adipiscing elit?</summary>
46
+ <!-- answer 2 -->
47
+ </details>
48
+ </section>
49
+ ```
50
+
51
+ Avoid exclusive accordions, as they can produce suboptimal user experience:
52
+ - Sometimes users want to reference between the contents of multiple items, which exclusive accordions prevent.
53
+ - They also can cause content to shift out of the user’s view which can cause significant problems for those using screen magnifiers.
54
+
55
+ ### Keeping one item always open
56
+
57
+ To require that one item is always open, stop the open item’s `summary` from closing it and expose it as disabled. Opening another item still closes it through `name`. This compounds the downsides above, since users can never reclaim the space, so only use it when the layout depends on an item being open.
58
+
59
+ ```html
60
+ <section class="accordion always-open" aria-labelledby="plans-heading">
61
+ <h2 id="plans-heading">Plans</h2>
62
+ <details name="plan" open>
63
+ <!-- Mirrors the open state; the script keeps it in sync -->
64
+ <summary aria-disabled="true">Basic</summary>
65
+ <!-- Basic plan -->
66
+ </details>
67
+ <details name="plan">
68
+ <summary>Pro</summary>
69
+ <!-- Pro plan -->
70
+ </details>
71
+ </section>
72
+ ```
73
+
74
+ ```javascript
75
+ // Enter and Space on a summary also dispatch click, so this covers keyboard too
76
+ document.addEventListener("click", event => {
77
+ if (event.target.closest(".accordion.always-open details[open] > summary")) event.preventDefault();
78
+ });
79
+
80
+ // toggle does not bubble, hence capture
81
+ document.addEventListener("toggle", event => {
82
+ if (!event.target.matches(".accordion.always-open details")) return;
83
+ event.target.querySelector(":scope > summary").setAttribute("aria-disabled", event.target.open);
84
+ }, { capture: true });
85
+ ```
86
+
87
+ Keep the disabled `summary` focusable so focus is not lost when the item a user just opened becomes disabled, but exclude it from hover and pointer styles so it does not look clickable:
88
+
89
+ ```css
90
+ /* :where() keeps the guard from raising specificity */
91
+ summary:where(:not([aria-disabled="true"])) {
92
+ cursor: pointer;
93
+
94
+ &:hover {
95
+ background: var(--color-hover);
96
+ }
97
+ }
98
+ ```
99
+
100
+ ## Optional: Expand/Collapse All button
101
+
102
+ For non-exclusive accordions, a single button that expands or collapses every item can improve user experience.
103
+ Give it `aria-expanded` and keep it in sync with the items, so screen readers announce the change (VoiceOver does not reliably announce a label change on its own).
104
+ Mark it expanded only once every item is open; in a mixed state it reads "Expand all" and pressing it opens everything.
105
+
106
+ ```html
107
+ <section class="accordion" id="support-accordion" aria-labelledby="support">
108
+ <h2 id="support">Support</h2>
109
+ <button type="button" commandfor="support-accordion" command="--toggle-all" aria-expanded="false">
110
+ <span class="expand">Expand all</span>
111
+ <span class="collapse">Collapse all</span>
112
+ </button>
113
+ <!-- Accordion items -->
114
+ </section>
115
+ ```
116
+
117
+ ```css
118
+ /* Show the label for the action the button will perform */
119
+ [command="--toggle-all"][aria-expanded="true"] .expand,
120
+ [command="--toggle-all"][aria-expanded="false"] .collapse {
121
+ display: none;
122
+ }
123
+ ```
124
+
125
+ ```javascript
126
+ document.addEventListener("command", event => {
127
+ if (event.command !== "--toggle-all") return;
128
+ const expand = event.source.getAttribute("aria-expanded") !== "true";
129
+
130
+ // Command events fire on the commandfor target
131
+ for (const details of event.target.querySelectorAll(":scope > details")) {
132
+ details.open = expand;
133
+ }
134
+ }, { capture: true }); // Command events do not bubble, hence capture
135
+
136
+ // Items also open and close individually, so derive the button state from them
137
+ document.addEventListener("toggle", event => {
138
+ if (!event.target.matches(".accordion > details")) return;
139
+ const accordion = event.target.parentElement;
140
+ const button = accordion.querySelector(':scope > [command="--toggle-all"]');
141
+ if (!button) return;
142
+
143
+ const items = accordion.querySelectorAll(":scope > details");
144
+ button.setAttribute("aria-expanded", Array.prototype.every.call(items, details => details.open));
145
+ }, { capture: true }); // toggle does not bubble, hence capture
146
+ ```
147
+
148
+ Separate buttons are also possible and improve discoverability, at the cost of _feedback_: there are states where one of the buttons will produce no visible result, and disabling it accessibly introduces challenges and increases complexity.
149
+
150
+ ## Styling
151
+
152
+ The disclosed content lives in the `::details-content` pseudo-element. While closed it is hidden with `content-visibility: hidden`, not `display: none`, which is what keeps it findable and lets its size animate. Style the item on `details`, the trigger on `summary`, and the content on `details::details-content`.
153
+
154
+ ### Customizing the marker
155
+
156
+ `summary` renders as a list item, so its disclosure triangle is a `::marker`. Remove it with `list-style: none` and draw your own with `::before`, which unlike `::marker` can be sized, positioned, and animated.
157
+ Render the icon as a mask so it follows the text color, and rotate it for the closed state so one icon serves both states and both writing directions.
158
+ See `icons` for more details on including and customizing icons via CSS.
159
+
160
+ Prefer keeping the marker directly next to the label text, not pushed to the opposite edge of the summary, especially for accordions that can get wide.
161
+ A marker far from its label makes it harder for users to associate with the correct label, and falls outside the field of view of users with low vision or screen magnification.
162
+ Right before the label text is preferable to right after, as it facilitates vertical scanning.
163
+
164
+ ```css
165
+ summary {
166
+ /* Removes the default triangle */
167
+ list-style: none;
168
+ display: flex;
169
+ align-items: center;
170
+ gap: 0.5ch;
171
+
172
+ &::before {
173
+ content: "";
174
+ inline-size: 1em;
175
+ block-size: 1em;
176
+ flex-shrink: 0;
177
+ background-color: currentColor;
178
+ /* Example chevron pointing down, the open state; any single-color SVG works */
179
+ mask: url("icons/chevron-down.svg") no-repeat center / contain;
180
+ /* Closed: point toward the inline end */
181
+ rotate: -90deg;
182
+ }
183
+
184
+ &:dir(rtl)::before {
185
+ rotate: 90deg;
186
+ }
187
+
188
+ /* Rotate rather than swap icons, so the change can animate */
189
+ details[open] > &::before {
190
+ rotate: 0deg;
191
+ }
192
+
193
+ @media (prefers-reduced-motion: no-preference) {
194
+ &::before {
195
+ transition: rotate 0.2s;
196
+ }
197
+ }
198
+ }
199
+ ```
200
+
201
+ ### Slide up/down animation
202
+
203
+ To animate opening and closing, transition `block-size` between `0` and its intrinsic size, and transition `content-visibility` discretely so the content stays rendered until the collapse finishes.
204
+
205
+ ```css
206
+ details::details-content {
207
+ /* Lets block-size transition to and from its intrinsic auto size */
208
+ interpolate-size: allow-keywords;
209
+ overflow: clip;
210
+ /* Keeps layout containment constant across states; otherwise content-visibility toggling it
211
+ makes the transition jitter when the content has outward margins (e.g. a nested p) */
212
+ contain: layout;
213
+ }
214
+
215
+ details:not([open])::details-content {
216
+ block-size: 0;
217
+ }
218
+
219
+ /* Only animate for users who have not asked for reduced motion */
220
+ @media (prefers-reduced-motion: no-preference) {
221
+ details::details-content {
222
+ transition: block-size, content-visibility, display;
223
+ /* Example duration; match the surrounding motion design */
224
+ transition-duration: 0.3s;
225
+ transition-timing-function: ease-in-out;
226
+ /* Defers content-visibility: hidden until the collapse ends */
227
+ transition-behavior: allow-discrete;
228
+ }
229
+ }
230
+ ```
231
+
232
+ See `animate-to-intrinsic-sizes` for more details.
233
+
234
+ ## Excluding a `details` element’s contents from find-in-page
235
+
236
+ If it’s undesirable for a `details` element’s contents to be included in what’s matched with the browser’s find-in-page feature, hide the closed contents with `display: none`. To keep the slide animation, set the collapsed size in `@starting-style`. See `animate-element-entry-exit` for more details.
237
+
238
+ ```css
239
+ .accordion.unsearchable > details {
240
+ /* Excludes the contents from find-in-page */
241
+ &:not([open])::details-content {
242
+ display: none;
243
+ }
244
+
245
+ /* Where the opening transition starts from, since display: none has no size */
246
+ &[open]::details-content {
247
+ @starting-style {
248
+ block-size: 0;
249
+ }
250
+ }
251
+ }
252
+ ```
253
+
254
+ ## Custom accordion
255
+
256
+ Use a custom accordion only when each item is a section of the page that needs its own heading, such as a FAQ or a long reference page where screen reader users move between items by heading.
257
+ It costs JavaScript for every behavior, including exclusivity, so prefer `details` everywhere else.
258
+
259
+ Place the `button` inside the heading so the heading keeps its semantics, and put the content element immediately after the heading.
260
+ Hide the content with `hidden="until-found"` so it stays findable, or with plain `hidden` to exclude it from find-in-page.
261
+ `aria-controls` on the trigger is optional; screen readers gain nothing from it.
262
+
263
+ ```html
264
+ <section class="accordion" aria-labelledby="faq-heading">
265
+ <h2 id="faq-heading">Frequently Asked Questions</h2>
266
+ <h3>
267
+ <button type="button" commandfor="answer-1" command="--toggle" aria-expanded="false">How do I reset my password?</button>
268
+ </h3>
269
+ <div id="answer-1" hidden="until-found"><!-- Answer --></div>
270
+ </section>
271
+ ```
272
+
273
+ ```javascript
274
+ document.addEventListener("command", event => {
275
+ if (event.command !== "--toggle") return;
276
+ const content = event.target;
277
+
278
+ content.hidden = content.hidden ? false : "until-found";
279
+ event.source.setAttribute("aria-expanded", !content.hidden);
280
+ }, { capture: true }); // Command events do not bubble, hence capture
281
+
282
+ // Find-in-page reveals the content directly, so mirror that into the trigger
283
+ document.addEventListener("beforematch", event => {
284
+ document.querySelector(`[commandfor="${CSS.escape(event.target.id)}"]`)?.setAttribute("aria-expanded", "true");
285
+ });
286
+ ```
287
+
288
+ To make it exclusive, hide the other items' content and reset their triggers in both handlers, since find-in-page can also open an item.
289
+ See `custom-button-actions` for more details on custom commands and `search-hidden-content` (references/ui-behaviors/search-hidden-content.md) for `hidden="until-found"`.
290
+
291
+ ## Fallback strategies
292
+
293
+ ### Mutually exclusive `details`
294
+
295
+ Baseline status for Mutually exclusive <details> elements: Newly available. It's been Baseline since 2024-09-03.
296
+ Supported by: Chrome 120 (Dec 2023), Edge 120 (Dec 2023), Firefox 130 (Sep 2024), and Safari 17.2 (Dec 2023).
297
+
298
+ In browsers that don't support `name` on `details`, several items stay open, which is still a working (non-exclusive) accordion.
299
+ If the exclusivity is crucial to the user experience, you can implement a fallback. It also keeps always-open accordions working, since the open item still closes when another opens:
300
+
301
+ ```javascript
302
+ // Only needed where the name attribute is unsupported
303
+ if (!Object.hasOwn(HTMLDetailsElement.prototype, "name")) {
304
+ document.addEventListener("toggle", event => {
305
+ const details = event.target;
306
+ if (!(details instanceof HTMLDetailsElement) || !details.open || !details.hasAttribute("name")) return;
307
+
308
+ const name = CSS.escape(details.getAttribute("name"));
309
+ for (const other of document.querySelectorAll(`details[name="${name}"]`)) {
310
+ if (other !== details) other.open = false;
311
+ }
312
+ }, { capture: true }); // toggle does not bubble, hence capture
313
+ }
314
+ ```
315
+
316
+ ### Expand all and Collapse all
317
+
318
+ Baseline status for Invoker commands: Newly available. It's been Baseline since 2025-12-12.
319
+ Supported by: Chrome 135 (Apr 2025), Edge 135 (Apr 2025), Firefox 144 (Oct 2025), and Safari 26.2 (Dec 2025).
320
+
321
+ If your Baseline target does not support invoker commands, the button does nothing. Feature-detect with `Object.hasOwn(HTMLButtonElement.prototype, "commandForElement")` and fall back to a `click` listener that runs the same loop. See `custom-button-actions` for more details.
322
+
323
+ ### Open and close animation
324
+
325
+ Baseline status for ::details-content: Newly available. It's been Baseline since 2025-09-16.
326
+ Supported by: Chrome 131 (Nov 2024), Edge 131 (Nov 2024), Firefox 143 (Sep 2025), and Safari 18.4 (Mar 2025).
327
+
328
+ Browser support for interpolate-size: Limited availability.
329
+ Supported by: Chrome 129 (Sep 2024) and Edge 129 (Sep 2024).
330
+ Unsupported in: Firefox and Safari.
331
+
332
+ Baseline status for transition-behavior: Newly available. It's been Baseline since 2024-08-06.
333
+ Supported by: Chrome 117 (Sep 2023), Edge 117 (Sep 2023), Firefox 129 (Aug 2024), and Safari 17.4 (Mar 2024).
334
+
335
+ The animation is a progressive enhancement and needs no fallback. Without `interpolate-size`, items open and close instantly. Without `transition-behavior`, the content hides at the start of the collapse and the height animates empty, while opening still animates.
336
+
337
+ ### Custom accordion
338
+
339
+ Browser support for hidden="until-found": Limited availability.
340
+ Supported by: Chrome 102 (May 2022), Edge 102 (May 2022), and Firefox 148 (Feb 2026).
341
+ Unsupported in: Safari.
342
+
343
+ Where `until-found` is unsupported, the attribute behaves as plain `hidden`: the content is hidden but not findable, and the accordion still works.
@@ -0,0 +1,168 @@
1
+ # Build breadcrumbs
2
+
3
+ Breadcrumbs show where the user is in a site hierarchy and link to each ancestor page.
4
+
5
+ This is not for switching between views of the same page (tabs) or for site-wide navigation (a navbar).
6
+
7
+ ## 1. Semantics
8
+
9
+ - Wrap the trail in `<nav aria-label="Breadcrumbs">` containing an ordered list (`<ol>`) of `<li>` items, each holding an `<a>`. Order conveys hierarchy, so use `ol`, not `ul`.
10
+ - Give each `<nav>` a unique label if a page has several landmarks (e.g. "Breadcrumbs").
11
+ - Mark the current page, the last item, as a link with `aria-current="page"`. Keep it a link (not plain text) so the trail structure stays consistent.
12
+ - Dividers are decorative. Do not put them in the markup as text. Generate them in CSS with an empty alt so they stay out of the accessibility tree:
13
+
14
+ ```css
15
+ /* The empty alt text after the slash hides the divider from screen readers; li + li skips the first item */
16
+ .breadcrumb > ol > li + li::before { content: "/" / ""; }
17
+ ```
18
+
19
+ - A styled character (`/`, `›`, `>`) generated as above is the simplest divider. For an icon divider such as a chevron, render it the way the codebase renders icons and keep it decorative; see `icons`.
20
+
21
+ ## 2. Styling
22
+
23
+ - Lay out with `display: flex; flex-wrap: wrap; align-items: center; gap` on the `<ol>`; reset list styles.
24
+ - Whatever the visual style, the trail must read as a path: each step visibly follows the previous one through a separator (slash or chevron) or an arrow or slant shape. Plain links with a separator are the default and the safest choice.
25
+ - **DO NOT** drop the separator in chip-like styles. Pills, tags and a segmented bar without one look like tabs or filters (items on the same level), not a hierarchy. Plain text with no divider is also weak, since order is then the only cue; avoid it.
26
+ - Choose a visual variant:
27
+ - **Plain (slash or chevron):** use when the trail should stay visually quiet. Underline links at rest, or at least on hover and focus, so they never rely on color alone.
28
+ - **Bar:** one bordered, segmented container with `overflow: clip`; use when segments need large, clear touch targets. Keep a separator in each segment after the first. A bar must not wrap: when its segments no longer fit on one row, stack it in a column in a container query set just above the bar's natural width (measure it and round up, so it stacks only when it would not fit), with compact rows (smaller block padding), separated by a 1px `border-block-start` and the chevron turned to point down and use a fixed `border-radius` for a joined pill, since `999px` becomes an oval once it grows tall. For a joined pill, round the container (`border-radius: 999px`) and separate segments with a 1px `border-inline-start` and no gap. Give the current page's `<li>` the same background as its link, so the chevron outside the link does not sit on the bar's background. Round the container, not the individual links, so the clip handles the end caps, and give the end links the same end radius so an inset focus ring follows the rounded ends instead of being cut off.
29
+ - **Pills / tags:** use rounded or shaped links when the trail is a prominent control, with a separator between them. Show backgrounds only on hover for tags.
30
+ - Style the current page distinctly (weight, color) and non-current links with a hover state.
31
+ - Custom palettes must meet WCAG AA contrast (4.5:1 for text) for links, hover, and the current page against their actual backgrounds (e.g. dark red on light gray). Keep a non-color cue on the current page, such as font weight.
32
+ - Provide a clear `:focus-visible` outline that has a contrast of at least `3:1` with the background color. For shaped or clipped segments use a negative `outline-offset` or a background/color change, since outlines get clipped.
33
+ - Lift the focused link above its neighbors (`position: relative; z-index: 1` on `a:focus-visible`). Neighbors that overlap it (shaped segments) are painted later and cover an outside ring.
34
+ - In `forced-colors: active`, restore borders and an underline on `[aria-current="page"]` since backgrounds are removed. An icon divider drawn as a masked background also needs `forced-color-adjust: none` and a system color such as `CanvasText`, since forced colors replaces the background.
35
+
36
+ ### Shaped segments
37
+
38
+ Pick the simplest technique that produces the shape, and use **one** shape per trail. The snippets are alternatives, not meant to be combined.
39
+
40
+ - Selectors are illustrative; use your own hook (`.breadcrumb` here). Scope to `> ol > li > a`.
41
+ - Make the slant or point size responsive with `clamp()` and container units (`cqi`).
42
+ - Pair state colors with the shape: hover and current-page styles must use background or text color, not border color. Keep the focus style visually distinct from hover.
43
+ - Use a negative `outline-offset` for focus, since outside outlines are covered by neighbors.
44
+
45
+ #### Overlapping segments
46
+
47
+ Overlapping segments communicate hierarchy even without a separator. Pull each segment under the previous one with a negative inline margin, and stack them in reverse source order so each earlier segment sits above the next. `sibling-index()` and `sibling-count()` make this possible without per-item rules:
48
+
49
+ ```css
50
+ .breadcrumb > ol > li { position: relative; z-index: calc(sibling-count() - sibling-index()); }
51
+ /* The focused segment sits above every other segment (the li is the stacking context, so lift it, not the link) */
52
+ .breadcrumb > ol > li:has(> a:focus-visible) { z-index: calc(sibling-count() + 1); }
53
+ ```
54
+
55
+ #### Simple irregular shapes (`corner-shape`)
56
+
57
+ Prefer `corner-shape: bevel` with an irregular `border-radius` for parallelograms and arrows. It has better browser support than `border-shape` and keeps normal border flexibility (per-side widths, colors and styles), whereas `border-shape` needs explicit inner and outer shapes or is limited to a uniform stroke. Use logical corner properties so RTL mirrors automatically; no `:dir(rtl)` rule is needed.
58
+
59
+ Slant (`/`): bevel the start-start and end-end corners with a horizontal radius of the slant and a vertical radius of 100%.
60
+
61
+ Arrow (`>`): bevel both end corners with a horizontal radius of the point and a vertical radius of 50%. Overlap the next segment so the tip of each segment covers the flat start edge of the next.
62
+
63
+ ```css
64
+ .breadcrumb { --slant: clamp(.4rem, 2cqi, .75rem); }
65
+ .breadcrumb > ol, .breadcrumb > ol > li { gap: 0; }
66
+ .breadcrumb > ol > li > a {
67
+ display: block;
68
+ corner-shape: bevel;
69
+ /* Extra inline padding equal to the slant keeps text out of the angled corners */
70
+ padding: .55rem calc(var(--slant) + .8rem);
71
+ }
72
+ /* The shape shows direction, so drop the separator */
73
+ .breadcrumb > ol > li + li::before { content: none; }
74
+
75
+ /* SLANT ONLY: leans like "/" in LTR and "\" in RTL */
76
+ .breadcrumb > ol > li > a {
77
+ border-start-start-radius: var(--slant) 100%;
78
+ border-end-end-radius: var(--slant) 100%;
79
+ }
80
+ /* Overlap by the slant, minus a small visible gap (example .25rem), so the angled edges run parallel */
81
+ .breadcrumb > ol > li + li { margin-inline-start: calc(.25rem - var(--slant)); }
82
+
83
+ /* ARROW ONLY: tip on the end side; a contrasting segment border separates the overlapped edges */
84
+ .breadcrumb > ol > li > a {
85
+ border-start-end-radius: var(--slant) 50%;
86
+ border-end-end-radius: var(--slant) 50%;
87
+ }
88
+ .breadcrumb > ol > li + li { margin-inline-start: calc(var(--slant) * -1); }
89
+ ```
90
+
91
+ #### Fully irregular shapes (`border-shape`)
92
+
93
+ Use `border-shape` only for shapes `corner-shape` cannot make, such as a notched arrow with a concave leading edge. Define the polygon in a custom property (`--shape`) and apply it with `border-shape` so borders and focus outlines follow the shape. Polygons are physically directional and logical properties don't flip `polygon()` coordinates, so each shape needs an explicit `:dir(rtl)` mirror.
94
+
95
+ ```css
96
+ /* The first item drops the inner notch vertex so its leading edge stays flat */
97
+ .breadcrumb > ol > li > a {
98
+ --shape: polygon(0 0, calc(100% - var(--point)) 0, 100% 50%, calc(100% - var(--point)) 100%, 0 100%, var(--point) 50%);
99
+ padding: .55rem calc(var(--point) + .8rem);
100
+ border-shape: var(--shape);
101
+ }
102
+ .breadcrumb > ol > li:first-child > a {
103
+ --shape: polygon(0 0, calc(100% - var(--point)) 0, 100% 50%, calc(100% - var(--point)) 100%, 0 100%);
104
+ }
105
+ /* Overlap by slightly less than --point so the notch and tip interlock */
106
+ .breadcrumb > ol > li + li { margin-inline-start: calc(.25rem - var(--point)); }
107
+ /* RTL mirror: swap 0 with 100% and calc(100% - var(--point)) with var(--point) in each x coordinate */
108
+ .breadcrumb:dir(rtl) > ol > li > a {
109
+ --shape: polygon(100% 0, var(--point) 0, 0 50%, var(--point) 100%, 100% 100%, calc(100% - var(--point)) 50%);
110
+ }
111
+ .breadcrumb:dir(rtl) > ol > li:first-child > a {
112
+ --shape: polygon(100% 0, var(--point) 0, 0 50%, var(--point) 100%, 100% 100%);
113
+ }
114
+ ```
115
+
116
+ ## 3. Optional UX enhancements
117
+
118
+ These are optional. Implement them only when the trail needs them, and choose the implementation yourself.
119
+
120
+ - **Sibling menus:** when ancestors have meaningful siblings (e.g. docs sections), let an ancestor expose its siblings in a menu. Keep the ancestor link navigating and put the toggle in a separate button, never inside the `<a>`. For menu mechanics, see `menu` (references/ui-components/menu.md).
121
+ - **Long trails:** collapse the middle of a trail with more than 3 items on narrow containers instead of letting it wrap, keeping the first item and the last two. Put the hidden links in a popup opened from a "…" button, and keep the full trail when script is unavailable.
122
+ - **Long labels:** keep every item on one line and never truncate the current page. See `single-line-overflow` for techniques for truncating ancestor labels and revealing the full label on demand without UX friction.
123
+
124
+ ## Fallback strategy
125
+
126
+ ### `corner-shape`
127
+
128
+ Browser support for corner-shape: Limited availability.
129
+ Supported by: Chrome 139 (Aug 2025) and Edge 139 (Aug 2025).
130
+ Unsupported in: Firefox and Safari.
131
+
132
+ - Rounded corners are not an acceptable fallback for slants and arrows. Keep plain bordered rectangular segments with a separator (`li + li::before`) as the base style, and put everything from the shape snippets that makes the shape (`corner-shape`, the radii, the padding, the overlap margins and `content: none` on the separator) inside `@supports (corner-shape: bevel)`, so unshaped segments neither overlap nor lose their separator.
133
+
134
+ ### `sibling-index()` and `sibling-count()`
135
+
136
+ Baseline status for sibling-count() and sibling-index(): Newly available. It's been Baseline since 2026-08-18.
137
+ Supported by: Chrome 138 (Jun 2025), Edge 138 (Jun 2025), Firefox 154 (Aug 2026), and Safari 26.2 (Dec 2025).
138
+
139
+ - Without support, later segments paint on top: slants are unaffected, but arrow tips are hidden. Put the stacking rules in `@supports (z-index: sibling-index())`, and gate the arrow shape on both `corner-shape` and `sibling-index()` so it stays plain with a separator otherwise:
140
+
141
+ ```css
142
+ @supports (corner-shape: bevel) and (z-index: sibling-index()) {
143
+ /* Arrow-only shape, overlap and stacking rules from above */
144
+ }
145
+ ```
146
+
147
+ ### `border-shape`
148
+
149
+ Browser support for border-shape: Limited availability.
150
+ Supported by: Chrome 147 (Apr 2026) and Edge 147 (Apr 2026).
151
+ Unsupported in: Firefox and Safari.
152
+
153
+ - Use `clip-path: var(--shape)` with the same polygon as the base style, and enhance inside `@supports (border-shape: polygon(0 0, 100% 0, 100% 100%))` by setting `clip-path: none` and applying `border-shape`.
154
+ - `clip-path` clips borders and outlines, so under the fallback use a color/background change plus negative `outline-offset` for focus instead of an outside outline.
155
+ - `clip-path` also cuts the slanted sides off a border, and `forced-colors: active` removes the background that draws the shape, so a clipped segment loses its outline. Under forced colors, drop the clip and use plain bordered segments with a text separator so the trail still reads as a path:
156
+
157
+ ```css
158
+ @media (forced-colors: active) {
159
+ /* Only without border-shape: with it, the border follows the shape and needs no change */
160
+ @supports not (border-shape: polygon(0 0, 100% 0, 100% 100%)) {
161
+ .breadcrumb > ol > li > a { clip-path: none; border: 2px solid LinkText; }
162
+ .breadcrumb > ol > li + li { margin-inline-start: 0; } /* undo the shape overlap */
163
+ .breadcrumb > ol > li + li::before { content: "›" / ""; } /* the shape no longer shows direction */
164
+ }
165
+ }
166
+ ```
167
+
168
+ - The trail remains fully functional; only borders and outlines differ.