@capagents/forgeqe 3.1.1 → 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 (247) hide show
  1. package/HOW_TO_USE.md +435 -78
  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 -6729
  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 +1902 -1895
  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 -6
  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 +404 -81
  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/test-reviewer.md +1 -1
  128. package/prompts/test-rules.md +3 -4
  129. package/skills/web-guidance/LICENSE +202 -0
  130. package/skills/web-guidance/SKILL.md +76 -0
  131. package/skills/web-guidance/UPSTREAM +67 -0
  132. package/skills/web-guidance/references/accessibility/accessibility.md +585 -0
  133. package/skills/web-guidance/references/accessibility/accessible-error-announcement.md +302 -0
  134. package/skills/web-guidance/references/accessibility/accessible-generated-content.md +41 -0
  135. package/skills/web-guidance/references/accessibility/respect-os-text-scale.md +127 -0
  136. package/skills/web-guidance/references/css/responsive-design.md +16 -0
  137. package/skills/web-guidance/references/forms/autofill-address-form.md +86 -0
  138. package/skills/web-guidance/references/forms/autofill-payment-form.md +142 -0
  139. package/skills/web-guidance/references/forms/autofill-sign-in-form.md +145 -0
  140. package/skills/web-guidance/references/forms/autofill-sign-up-form.md +155 -0
  141. package/skills/web-guidance/references/forms/forms.md +415 -0
  142. package/skills/web-guidance/references/forms/ime-safe-enter-submit.md +115 -0
  143. package/skills/web-guidance/references/forms/required-field-feedback.md +317 -0
  144. package/skills/web-guidance/references/forms/select-menu-interaction.md +310 -0
  145. package/skills/web-guidance/references/forms/slider.md +184 -0
  146. package/skills/web-guidance/references/forms/sms-otp-form.md +208 -0
  147. package/skills/web-guidance/references/forms/switch.md +60 -0
  148. package/skills/web-guidance/references/forms/validate-input-after-interaction.md +406 -0
  149. package/skills/web-guidance/references/performance/break-up-long-tasks.md +64 -0
  150. package/skills/web-guidance/references/performance/identify-heavy-scripts.md +69 -0
  151. package/skills/web-guidance/references/performance/identify-inp-causes.md +105 -0
  152. package/skills/web-guidance/references/performance/interaction-paint-timing.md +200 -0
  153. package/skills/web-guidance/references/performance/optimize-image-priority.md +73 -0
  154. package/skills/web-guidance/references/performance/performance.md +384 -0
  155. package/skills/web-guidance/references/privacy/privacy.md +247 -0
  156. package/skills/web-guidance/references/security/passkey-authentication.md +218 -0
  157. package/skills/web-guidance/references/security/passkey-management.md +310 -0
  158. package/skills/web-guidance/references/security/passkey-reauthentication.md +142 -0
  159. package/skills/web-guidance/references/security/passkey-registration.md +186 -0
  160. package/skills/web-guidance/references/security/passkeys.md +39 -0
  161. package/skills/web-guidance/references/security/sanitize-untrusted-html.md +105 -0
  162. package/skills/web-guidance/references/security/secure-external-subresources.md +202 -0
  163. package/skills/web-guidance/references/security/security.md +390 -0
  164. package/skills/web-guidance/references/security/trusted-types.md +141 -0
  165. package/skills/web-guidance/references/security/validate-origins.md +197 -0
  166. package/skills/web-guidance/references/security/verify-email-ownership.md +235 -0
  167. package/skills/web-guidance/references/ui-atoms/position-aware-tooltips.md +173 -0
  168. package/skills/web-guidance/references/ui-atoms/responsive-table.md +122 -0
  169. package/skills/web-guidance/references/ui-atoms/viewport-aware-dropdowns.md +178 -0
  170. package/skills/web-guidance/references/ui-behaviors/drag-and-drop.md +108 -0
  171. package/skills/web-guidance/references/ui-behaviors/light-dismiss-a-dialog.md +89 -0
  172. package/skills/web-guidance/references/ui-behaviors/motion.md +97 -0
  173. package/skills/web-guidance/references/ui-behaviors/platform-controls-dismiss-dialog.md +40 -0
  174. package/skills/web-guidance/references/ui-behaviors/prevent-page-scroll-under-modal-dialog.md +59 -0
  175. package/skills/web-guidance/references/ui-behaviors/search-hidden-content.md +141 -0
  176. package/skills/web-guidance/references/ui-behaviors/sortable-table.md +140 -0
  177. package/skills/web-guidance/references/ui-components/accordion.md +343 -0
  178. package/skills/web-guidance/references/ui-components/breadcrumbs.md +168 -0
  179. package/skills/web-guidance/references/ui-components/carousel.md +206 -0
  180. package/skills/web-guidance/references/ui-components/checkbox.md +144 -0
  181. package/skills/web-guidance/references/ui-components/dialog.md +218 -0
  182. package/skills/web-guidance/references/ui-components/hovercard.md +391 -0
  183. package/skills/web-guidance/references/ui-components/menu.md +415 -0
  184. package/skills/web-guidance/references/ui-components/navbar.md +281 -0
  185. package/skills/web-guidance/references/ui-components/navigation-drawer.md +429 -0
  186. package/skills/web-guidance/references/ui-components/persistent-toast-notifications.md +185 -0
  187. package/skills/web-guidance/references/ui-components/progress.md +181 -0
  188. package/skills/web-guidance/references/ui-components/spinner.md +179 -0
  189. package/skills/web-guidance/references/ui-components/tabs.md +371 -0
  190. package/skills/web-guidance/references/ui-components/toolbar.md +277 -0
  191. package/skills/web-guidance/references/user-experience/form-factor-adaptation.md +120 -0
  192. package/skills/web-guidance/references/user-experience/natural-interactions.md +155 -0
  193. package/skills/web-guidance/references/visual-design/color.md +43 -0
  194. package/skills/web-guidance/references/visual-design/dark-mode.md +350 -0
  195. package/dist/web/assets/AgentWork-DwAI0_Of.js +0 -2
  196. package/dist/web/assets/ApiTests-C0vFSHmM.js +0 -10
  197. package/dist/web/assets/Browse-5jfdtRc5.js +0 -2
  198. package/dist/web/assets/Chat-B3uhI94O.js +0 -3
  199. package/dist/web/assets/CommandPalette-D2J4nf5y.js +0 -1
  200. package/dist/web/assets/Compare-CN75w1p9.js +0 -1
  201. package/dist/web/assets/Cost-QoxyjR95.js +0 -1
  202. package/dist/web/assets/Data-BAvkcBVt.js +0 -6
  203. package/dist/web/assets/Desktop-BXdOIalN.js +0 -1
  204. package/dist/web/assets/DesktopReview-Bl2SrPP0.js +0 -1
  205. package/dist/web/assets/Evidence-BJ_I52CD.js +0 -1
  206. package/dist/web/assets/Explore-D9AuyTip.js +0 -2
  207. package/dist/web/assets/Features-CusGMDR9.js +0 -1
  208. package/dist/web/assets/Flags-CycGFuUP.js +0 -2
  209. package/dist/web/assets/Flaky-BcSzJogN.js +0 -1
  210. package/dist/web/assets/Impact-CJHnyZ21.js +0 -3
  211. package/dist/web/assets/Jobs-4xcFzEFo.js +0 -5
  212. package/dist/web/assets/KindPage-BielEIej.js +0 -6
  213. package/dist/web/assets/Migration-NwanKpJg.js +0 -2
  214. package/dist/web/assets/PageAgent-CNw4NXva.js +0 -1
  215. package/dist/web/assets/Product-DS3LJZ4P.js +0 -7
  216. package/dist/web/assets/Production-D3zsyNIS.js +0 -1
  217. package/dist/web/assets/Quality-Ctj2YpC4.js +0 -1
  218. package/dist/web/assets/Readiness-DGcRr_co.js +0 -1
  219. package/dist/web/assets/Record-Cc-wGe_Y.js +0 -1
  220. package/dist/web/assets/Regression-DcsbrRa1.js +0 -5
  221. package/dist/web/assets/Reports-BkCn0-Sf.js +0 -2
  222. package/dist/web/assets/Response-BP0UwQcW.js +0 -9
  223. package/dist/web/assets/Responsive-C8U7dumd.js +0 -3
  224. package/dist/web/assets/RunDiff-BhABuhF_.js +0 -1
  225. package/dist/web/assets/Runs-OwdWEYBv.js +0 -2
  226. package/dist/web/assets/Steps-BvzbQyoD.js +0 -2
  227. package/dist/web/assets/TestCases-CLq_6JA5.js +0 -1
  228. package/dist/web/assets/TestData-B0oKAhp6.js +0 -2
  229. package/dist/web/assets/TestDebt-8NLQ5YV_.js +0 -1
  230. package/dist/web/assets/TestManagement-2LYQ7vsN.js +0 -1
  231. package/dist/web/assets/Tosca-DfvMpPTG.js +0 -3
  232. package/dist/web/assets/WhatsNew-BGFNGwqN.js +0 -1
  233. package/dist/web/assets/families-DYlN5v0i.js +0 -1
  234. package/dist/web/assets/filters-faaSnoIq.js +0 -1
  235. package/dist/web/assets/fold-CUjwWAK3.js +0 -1
  236. package/dist/web/assets/frame-BLPdAXUq.js +0 -13
  237. package/dist/web/assets/head-CsTxBsO0.js +0 -1
  238. package/dist/web/assets/index-CxiCvGZq.js +0 -78
  239. package/dist/web/assets/index-dOIsrzhD.css +0 -2
  240. package/dist/web/assets/line-icons-CwZWt93L.js +0 -1
  241. package/dist/web/assets/logos-dGuc1jIM.js +0 -1
  242. package/dist/web/assets/markdown-BI3F-SJ1.js +0 -10
  243. package/dist/web/assets/paletteCommands-QJiCuUEr.js +0 -1
  244. package/dist/web/assets/parts-CdF1f7yS.js +0 -1
  245. package/dist/web/assets/productParts-hNLD9fN0.js +0 -1
  246. package/dist/web/assets/qualityParts-CT25lBWU.js +0 -1
  247. package/dist/web/assets/recordTest-P792aBUt.js +0 -1
@@ -0,0 +1,120 @@
1
+ # Adapt to the form factor
2
+
3
+ The same interface runs on phones, laptops, and foldables, with touch, mouse, or keyboard. Size controls for the input, let components adapt to their container, and keep text and controls clear of system UI.
4
+
5
+ For page-level responsive techniques (dynamic viewport units, aspect ratios, and fluid type), see `responsive-design` (references/css/responsive-design.md).
6
+
7
+ ## Implementation
8
+
9
+ ### Size targets for the input method
10
+
11
+ Make every control at least 24×24 CSS pixels (WCAG 2.5.8), and at least 44×44 on touch screens, where a fingertip is less precise than a mouse pointer (WCAG 2.5.5). Links inside sentences are exempt. For checkboxes and radios, wrap the input in its `<label>` and size the label. To keep small icons visually compact, extend their hit area with a pseudo-element. Leave enough space around controls so extended hit areas do not overlap each other or reach past the edge of the screen.
12
+
13
+ ```css
14
+ :root { --target-size: 24px; }
15
+ @media (pointer: coarse) {
16
+ :root { --target-size: 44px; }
17
+ }
18
+ :where(button, select, textarea, input:not([type="checkbox"], [type="radio"]), [role="button"], nav a, label:has(input[type="checkbox"], input[type="radio"])) {
19
+ min-block-size: var(--target-size);
20
+ min-inline-size: var(--target-size);
21
+ }
22
+ :where([role="button"], nav a, label:has(input[type="checkbox"], input[type="radio"])) { display: inline-flex; align-items: center; }
23
+ .icon-button { position: relative; }
24
+ .icon-button::after {
25
+ content: "";
26
+ position: absolute;
27
+ inset: -10px;
28
+ }
29
+ ```
30
+
31
+ ### Let components respond to their container
32
+
33
+ Use container queries instead of viewport-width media queries for component layout, so a component adapts wherever it is placed. Keep media queries for what a container can't know: the input device (such as `pointer: coarse` for touch screens) and user settings (such as `prefers-color-scheme`).
34
+
35
+ ```css
36
+ .product-list {
37
+ /* Name containers so queries inside nested containers target the right ancestor. */
38
+ container: products / inline-size;
39
+ }
40
+ /* A container query styles the container's descendants, never the container itself. */
41
+ @container products (inline-size > 40rem) {
42
+ .product-card { display: grid; grid-template-columns: 10rem 1fr; }
43
+ }
44
+ ```
45
+
46
+ DO NOT query `height` or `block-size` on an `inline-size` container: it measures only width. Use `container-type: size` only on a container with a definite height.
47
+
48
+ - For more container query patterns, such as card layouts, see `size-aware-styling`.
49
+ - To change a component's layout based on what child elements it contains (for example, switching a card to a side-by-side layout when it includes an image), see `content-based-styling`.
50
+
51
+ ### Keep UI clear of notches and system bars
52
+
53
+ When drawing edge to edge with `<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">`, pad fixed and edge-anchored UI by the safe-area insets.
54
+
55
+ ```css
56
+ .bottom-bar {
57
+ position: fixed;
58
+ left: 0;
59
+ right: 0;
60
+ bottom: 0;
61
+ padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
62
+ padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
63
+ padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
64
+ }
65
+ ```
66
+
67
+ Pad UI anchored to the top edge the same way with `safe-area-inset-top`.
68
+
69
+ Fixed bars cover the content that scrolls under them, so a focused element can end up hidden behind one. Set `scroll-padding-bottom` (or `scroll-padding-top` for a top bar) on the scroll container to at least the bar's height, including its safe-area padding, so the browser scrolls focused elements clear of the bar (WCAG 2.4.11 Focus Not Obscured (Minimum) requires a focused element to be at least partly visible).
70
+
71
+ ```css
72
+ html {
73
+ scroll-padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
74
+ }
75
+ ```
76
+
77
+ ### Balance headings and prettify body text
78
+
79
+ Apply `text-wrap: balance` to short headings (`h1, h2, h3`) and `text-wrap: pretty` to body text (`p, li`) to prevent typographic orphans. For full text-wrapping rules, see `improve-text-layout-and-legibility`. DO NOT apply either property to `*`: both incur layout overhead, and `balance` only helps short blocks of text.
80
+
81
+ ### Label icon-only buttons
82
+
83
+ Give every icon-only button an accessible name using `aria-label`, an `<img alt>`, or visually hidden text, and hide decorative icons with `aria-hidden="true"`. For more accessible naming patterns, see `accessibility` (references/accessibility/accessibility.md).
84
+
85
+ ### Keep content inside its box
86
+
87
+ Ensure text and controls are never clipped, squished to zero dimensions, or overflowing at any viewport width down to 320 CSS pixels (WCAG 1.4.10). Content that needs a two-dimensional layout to be understood, such as data tables, maps, and diagrams, may scroll horizontally inside its own container while the page doesn't. Make that container keyboard-scrollable with `tabindex="0"`, and give it `role="region"` and an accessible name. For making data tables adapt to smaller viewports, see `responsive-table` (references/ui-atoms/responsive-table.md).
88
+
89
+ ```css
90
+ /* Media never overflows its column. */
91
+ img, video { max-inline-size: 100%; block-size: auto; }
92
+ /* Long words and URLs wrap instead of widening the page. */
93
+ body { overflow-wrap: break-word; }
94
+ /* Long URLs and code also wrap inside flex items and table cells. */
95
+ :where(a, code) { overflow-wrap: anywhere; }
96
+ /* Flex and grid items don't shrink below their content by default. Let non-control items shrink so controls keep their minimum size. */
97
+ :where(.toolbar > :not(button, input, select, textarea, a, [role="button"], label)) { min-inline-size: 0; }
98
+ .toolbar { display: flex; }
99
+ /* The target-size minimum lets controls in a crowded row shrink below their text, so let nav bars and toolbars that are already rows wrap. */
100
+ :where(nav, nav ul, .toolbar) { flex-wrap: wrap; }
101
+ ```
102
+
103
+ - Use `min-block-size` instead of a fixed `height` on anything that contains text.
104
+ - Use `overflow-wrap: break-word` for text, and `anywhere` only on elements that hold long unbroken strings, such as links and code: `anywhere` also lets flex items and table cells shrink below their longest word, which breaks ordinary words mid-word.
105
+ - DO NOT truncate headings with `text-overflow: ellipsis`, and do not clip controls with `overflow: hidden` on their parents.
106
+ - DO NOT set `overflow-x: hidden` or `clip` on `html` or `body` to stop the page scrolling sideways: content past the edge is cut off and users can't scroll to it. Make the element that is too wide fit instead.
107
+ - To allow text and layouts to scale with operating system accessibility settings, see `respect-os-text-scale` (references/accessibility/respect-os-text-scale.md). To size form controls dynamically as users type, see `form-fields-automatically-fit-contents`.
108
+
109
+ ## Fallback strategies
110
+
111
+ ### Text wrapping
112
+
113
+ Baseline status for text-wrap: balance: Newly available. It's been Baseline since 2024-05-13.
114
+ Supported by: Chrome 114 (May 2023), Edge 114 (Jun 2023), Firefox 121 (Dec 2023), and Safari 17.5 (May 2024).
115
+
116
+ Browser support for text-wrap: pretty: Limited availability.
117
+ Supported by: Chrome 117 (Sep 2023), Edge 117 (Sep 2023), and Safari 26 (Sep 2025).
118
+ Unsupported in: Firefox.
119
+
120
+ Browsers without support ignore `text-wrap: balance` and `text-wrap: pretty` and wrap text normally. No fallback is needed.
@@ -0,0 +1,155 @@
1
+ # Implement natural interactions
2
+
3
+ Interfaces feel natural when every input gets an immediate response, motion behaves like a physical object, content follows the user's finger, and nothing depends on a mouse.
4
+
5
+ ## Implementation
6
+
7
+ ### Give every control hover, press, and focus feedback
8
+
9
+ ```css
10
+ :where(button) {
11
+ /* example durations */
12
+ transition: box-shadow 150ms ease-out, scale 150ms ease-out;
13
+ }
14
+ button:hover { box-shadow: 0 2px 8px rgb(0 0 0 / 0.2); }
15
+ a:hover { text-decoration-thickness: 2px; }
16
+ button:active { scale: 0.97; } /* example value */
17
+
18
+ :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
19
+ outline: 2px solid CanvasText;
20
+ outline-offset: 3px;
21
+ }
22
+ ```
23
+
24
+ - Use `:focus-visible` so keyboard users always see a clear focus ring, without showing it on mouse clicks.
25
+ - DO NOT remove focus outlines (`outline: none` or `outline: 0`) without providing an equally visible replacement with at least a 3:1 contrast ratio against the page (WCAG 1.4.11). `CanvasText` is the text color for the page's `color-scheme`, so it contrasts with the default page background in light mode, in dark mode (with `color-scheme: light dark`), and in forced colors. If you set your own page background, pick a ring color with 3:1 against it. `currentColor` fails when a button's text color matches the page.
26
+ - Make each interaction state look different, including combinations: hover, press, pressing while hovering, and keyboard focus. In the example, hover adds a shadow, press a scale, and focus an outline, so any combination shows each of its parts.
27
+
28
+ ### Open disclosures from their trigger
29
+
30
+ Popovers and dropdowns should visibly open from the control that triggered them: scale out from the corner touching the trigger, or slide out from its side. Menus and hovercards have their own open motion; follow `menu` (references/ui-components/menu.md) and `hovercard` (references/ui-components/hovercard.md). For other popovers, place the popover next to its trigger and align `transform-origin` with the corner that touches it. To flip dropdowns at viewport edges, see `viewport-aware-dropdowns` (references/ui-atoms/viewport-aware-dropdowns.md).
31
+
32
+ ```css
33
+ .dropdown {
34
+ /* popovertarget makes the trigger the popover's anchor. */
35
+ position-area: bottom span-right;
36
+ inset: auto;
37
+ margin: 0;
38
+ /* The corner touching the trigger; change it whenever the placement changes. */
39
+ transform-origin: top left;
40
+ }
41
+ /* example durations */
42
+ .dropdown:is(:popover-open, .\:popover-open) { animation: fade-in 150ms ease-out both; }
43
+ @media (prefers-reduced-motion: no-preference) {
44
+ .dropdown:is(:popover-open, .\:popover-open) {
45
+ /* optional example spring curve, written inline */
46
+ animation: grow 300ms linear(0, 0.45 15%, 1.08 35%, 0.97 55%, 1.01 75%, 1) both, fade-in 150ms ease-out both;
47
+ }
48
+ }
49
+ @keyframes grow { from { scale: 0.9; } }
50
+ @keyframes fade-in { from { opacity: 0; } }
51
+ ```
52
+
53
+ - Keep animations on the compositor (`transform`, its individual properties, and `opacity`) and respect reduced-motion preferences; see `motion` (references/ui-behaviors/motion.md). This example animates the opening only; for exit transitions, see `animate-to-from-top-layer`.
54
+ - Trigger popovers declaratively using `<button popovertarget="dropdown-id">` (see `declarative-dialog-popover-control`) to get native click, keyboard, and dismiss behavior without JavaScript.
55
+ - For a springy open, use a `linear()` curve that overshoots slightly before settling (an output value above 1); see `physics-based-easing`.
56
+
57
+ ### Make horizontal scrollers swipeable
58
+
59
+ Any horizontally scrollable row of items, such as a carousel, gallery, or row of chips, should scroll natively and snap to its items.
60
+
61
+ ```css
62
+ .scroller {
63
+ display: flex;
64
+ gap: 1rem;
65
+ overflow-x: auto;
66
+ scroll-snap-type: x mandatory;
67
+ }
68
+ .scroller > * {
69
+ flex: 0 0 85%; /* example item width */
70
+ scroll-snap-align: start;
71
+ }
72
+ ```
73
+
74
+ - Native overflow scrolling gives swiping its physics and momentum, and snapping makes each swipe come to rest on an item, with no touch listeners.
75
+ - If none of the scroller's items contains a link, button, or other focusable element, make the scroller itself focusable and labeled (`<div class="scroller" role="region" aria-label="Featured items" tabindex="0">`), so keyboard users can reach it and scroll it with the arrow keys. When items are focusable, tabbing to them already scrolls them into view.
76
+ - To highlight the item that snaps into place, see `carousel-snap-highlights`. To swipe a list item aside to reveal actions, see `swipe-to-reveal`. For side menus that close when swiped away, see `navigation-drawer` (references/ui-components/navigation-drawer.md).
77
+ - For carousel controls such as previous and next buttons and scroll markers, see `carousel` (references/ui-components/carousel.md).
78
+
79
+ ### Add motion blur to large, fast movements (optional)
80
+
81
+ For large, rapid translations (such as a full-screen sheet sliding into view), a subtle, temporary blur softens the movement. `filter` doesn't run only on the compositor, so keep blur to large, brief movements, skip it for small controls or slow transitions, and always guard it with a reduced-motion media query.
82
+
83
+ ```css
84
+ @media (prefers-reduced-motion: no-preference) {
85
+ .sheet.is-open { animation: sheet-in 300ms ease-out both; } /* example duration */
86
+ }
87
+ @keyframes sheet-in {
88
+ from { translate: 0 100%; filter: blur(6px); } /* example blur radius */
89
+ }
90
+ ```
91
+
92
+ ### Make every action reachable without a mouse
93
+
94
+ - Use `<button>` for actions and `<a>` with an `href` for navigation. Both receive keyboard focus and activate on <kbd>Enter</kbd>; buttons also activate on <kbd>Space</kbd>.
95
+ - Menus and dropdowns may open on hover, but never only on hover: they also open on click, tap, and keyboard activation, stay open while the pointer moves onto them, and close with <kbd>Esc</kbd> (WCAG 2.1.1, 1.4.13).
96
+ - Controls or details revealed in place on hover, such as card actions, must also appear on keyboard focus and be visible by default on devices without hover:
97
+
98
+ ```css
99
+ .card .actions {
100
+ opacity: 0;
101
+
102
+ .card:hover &,
103
+ .card:focus-within & { opacity: 1; }
104
+
105
+ @media (hover: none) { opacity: 1; }
106
+ }
107
+ ```
108
+
109
+ For tooltips and previews triggered on hover, focus, or long-press, see `interest-triggered-tooltips` and `interest-triggered-action-previews`.
110
+
111
+ ## Fallback strategies
112
+
113
+ ### Fallbacks & browser support for Popover
114
+
115
+ Baseline status for Popover: Newly available. It's been Baseline since 2025-01-27.
116
+ Supported by: Chrome 116 (Aug 2023), Edge 116 (Aug 2023), Firefox 125 (Apr 2024), Safari 17 (Sep 2023), and Safari iOS 18.3 (Jan 2025).
117
+
118
+ The Popover API is mostly **progressive enhancement**, but its defining behaviors — top-layer promotion, light-dismiss, and `popovertarget` invocation — have no CSS-only equivalent. Older browsers need a polyfill, or a manual fallback if you would rather not ship one.
119
+
120
+ **Polyfill:** To support the `popover` attribute in older browsers, conditionally load [`@oddbird/popover-polyfill`](https://github.com/oddbird/popover-polyfill). **MANDATORY:** Feature detect by checking for the `popover` property on `HTMLElement.prototype`, and load the polyfill **only** when native support is missing — do NOT load it unconditionally.
121
+
122
+ With a bundler or import map:
123
+
124
+ ```js
125
+ // MANDATORY: Feature detect 'popover' on HTMLElement.prototype.
126
+ if (!Object.hasOwn(HTMLElement.prototype, "popover")) {
127
+ import("@oddbird/popover-polyfill");
128
+ }
129
+ ```
130
+
131
+ If not using a package manager, import from a CDN, e.g. `"https://unpkg.com/@oddbird/popover-polyfill@latest/dist/popover.min.js"`.
132
+
133
+ Caveats when using the polyfill:
134
+ - Do NOT use the `popover` IDL attribute for any code that may run before the polyfill is fully loaded. It will not be mirrored as an attribute, the popover will not be picked up by the polyfill, and the property will be shadowing the accessor the polyfill adds forever. Use `setAttribute()`/`removeAttribute()` instead.
135
+ - **Styling caveat:** The polyfill cannot define the real `:popover-open` pseudo-class, so it applies a `.\:popover-open` class instead. **MANDATORY:** Combine the two with `:is()` or `:where()`, otherwise browsers that lack `:popover-open` discard the entire rule:
136
+
137
+ ```css
138
+ [popover]:is(:popover-open, .\:popover-open) {
139
+ display: block;
140
+ }
141
+ ```
142
+
143
+ ### Anchor positioning
144
+
145
+ Baseline status for the html.elements.button.popovertarget.implicit_anchor_reference capability: Newly available. It's been Baseline since 2026-01-13.
146
+ Supported by: Chrome 133 (Feb 2025), Edge 133 (Feb 2025), Firefox 147 (Jan 2026), and Safari 26 (Sep 2025).
147
+
148
+ Without support, `inset: auto` leaves the popover at the top-left corner of the viewport. When `CSS.supports('position-area: bottom')` is false, set the popover's `top` and `left` from the trigger's `getBoundingClientRect()` in a `beforetoggle` event listener.
149
+
150
+ ### Linear easing
151
+
152
+ Baseline status for linear() easing: Widely available. It's been Baseline since 2023-12-11.
153
+ Supported by: Chrome 113 (May 2023), Edge 113 (May 2023), Firefox 112 (Apr 2023), and Safari 17.2 (Dec 2023).
154
+
155
+ Browsers without `linear()` drop the declaration that uses it, so precede it with one that uses a keyword such as `ease-out`, as the fade-in above does. Write `linear()` inline, not through a custom property, or the earlier declaration is discarded too.
@@ -0,0 +1,43 @@
1
+ # Color
2
+
3
+ ## Accessible color
4
+
5
+ **Don't use color alone to indicate the presence of a user interface component or its state**: Use iconography and/or shape to help differentiate. Do not denote success/errors ONLY with color. Use icons or text (WCAG 1.4.1 Use of Color).
6
+
7
+ ```html
8
+ <!-- Good: Denotes state without colors alone -->
9
+ <div class="error-msg">
10
+ <span aria-hidden="true">❌</span>
11
+ <span>The password entered was invalid.</span>
12
+ </div>
13
+ ```
14
+
15
+ ### Contrast
16
+
17
+ - **Minimum contrast standards**: Maintain 4.5:1 for normal text and 3:1 for large text (at least 24px, or at least 18.66px bold) or icons (WCAG 1.4.3 Contrast (Minimum) for text, WCAG 1.4.11 Non-text Contrast for icons).
18
+ - **Ensure non-text contrast standards**: Maintain a minimum contrast ratio of 3:1 for user interface component boundaries and states (WCAG 1.4.11 Non-text Contrast).
19
+ - This includes visual elements (borders, backgrounds, box-shadows, underlines) that form the boundary or indicate the presence of a UI component (e.g., input field borders).
20
+ - This also includes visual elements indicating active states within a component (e.g., checkbox checkmarks, switch thumbs or custom focus indicators).
21
+ - **Caveat**: Meeting 3:1 non-text contrast can challenge minimalistic designs. Soft gradients or subtle inset/outset shadows can soften visual boundaries while satisfying accessibility requirements.
22
+ - **Use `prefers-contrast` only when warranted**: Reach for `@media (prefers-contrast: more)` when the design uses low-contrast accents (e.g., subtle borders, muted secondary text) that need to be reinforced; most sites that already meet baseline contrast won't need it. It strengthens colors that already meet the minimums above; it doesn't fix a default that fails them, because it only reaches users who have turned on the setting.
23
+
24
+ ### Light and dark color schemes
25
+
26
+ - **Support light and dark color schemes**: Honor `@media (prefers-color-scheme: dark)` and pair it with the `color-scheme` CSS property so form controls, scrollbars, and other UA-rendered surfaces match.
27
+ See `dark-mode` (references/visual-design/dark-mode.md) for more details.
28
+
29
+ ### Forced Colors Mode
30
+
31
+ - **Support Forced Colors Mode**: In Forced Colors Mode (High Contrast on Windows), the browser overrides author colors with system keywords, removes `box-shadow`, `text-shadow`, and gradient backgrounds, and may also remove `border-image`. `url()` background images can't be relied on either: they may be removed, or kept in their own colors, which may not contrast with the system colors. Define system color fallbacks for color tokens using `@media (forced-colors: active)`.
32
+ - **Use `forced-color-adjust: none` only where color is essential information** (syntax highlighter, color picker swatch). **DON'T** use `forced-color-adjust: none` just to preserve aesthetics. Where the element contains text, set both its text and background colors to a pair that meets the minimums above, because a transparent background shows what is behind it, usually the user's system `Canvas` color, which can be light or dark.
33
+ - **Don't rely on `background-image`, `box-shadow`, or `border-image` to convey borders, separators, or state**: In forced colors they disappear or keep their own colors, which may not contrast with the system colors (and they often disappear in print too). If you must, ensure there's an alternative in forced colors mode, such as `outline` or `border` with system color keywords (`CanvasText`, `LinkText`, `ButtonText`, `Highlight`, `GrayText`, etc.).
34
+
35
+ ## Generating tints
36
+
37
+ Before generating tints dynamically, check if you can use an existing, predefined, design token. This allows much more designer control and ensures consistency.
38
+
39
+ If you need to generate lighter or darker colors dynamically:
40
+ - **DO NOT** just adjust the lightness channel in `oklch`/`oklab` or `lch`/`lab`, e.g. `oklab(from var(--primary) 0.9 a b)`. While that is theoretically the correct way, browsers do not yet implement gamut mapping, so the resulting color is unpredictable.
41
+ - You can use `color-mix()` to mix with white or black (default to `in oklab` unless you have a reason to use a different color space for mixing). This keeps the color safely in gamut, but tends to over-desaturate colors and produce washed out tints and shades. Never use `in oklch` when mixing with neutrals. `oklch` confers no benefit in that case and due to a Chromium bug (565837690) low-chroma colors (`chroma < 0.02`) are treated as having powerless hue that resolves to `0deg` (magenta-red) in Chromium, producing an unintended reddish or pink tint.
42
+ - You MAY combine lightness adjustment with any of the other methods (e.g. `color-mix(in oklab, oklch(from var(--primary) 0.9 c h), white 30%)`) for a balance between the two, but avoid going above 30% for the lightness adjustment.
43
+