agemon 0.1.0 → 6.3.0
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.
- package/README.md +983 -30
- package/assets/skills/architecture/agemon-architecture/LICENSE +21 -0
- package/assets/skills/architecture/agemon-architecture/NOTICE.md +9 -0
- package/assets/skills/architecture/agemon-architecture/SKILL.md +275 -0
- package/assets/skills/code-quality/agemon-clean-code/LICENSE +21 -0
- package/assets/skills/code-quality/agemon-clean-code/NOTICE.md +9 -0
- package/assets/skills/code-quality/agemon-clean-code/SKILL.md +78 -0
- package/assets/skills/code-quality/agemon-house-rules/SKILL.md +103 -0
- package/assets/skills/commit/agemon-commit/SKILL.md +87 -0
- package/assets/skills/design/agemon-design/LICENSE +21 -0
- package/assets/skills/design/agemon-design/NOTICE.md +43 -0
- package/assets/skills/design/agemon-design/SKILL.md +128 -0
- package/assets/skills/design/agemon-design/references/accessibility.md +182 -0
- package/assets/skills/design/agemon-design/references/actions.md +215 -0
- package/assets/skills/design/agemon-design/references/ai-chat.md +158 -0
- package/assets/skills/design/agemon-design/references/brief.md +190 -0
- package/assets/skills/design/agemon-design/references/color.md +216 -0
- package/assets/skills/design/agemon-design/references/components.md +91 -0
- package/assets/skills/design/agemon-design/references/copy.md +300 -0
- package/assets/skills/design/agemon-design/references/core-rules.md +166 -0
- package/assets/skills/design/agemon-design/references/craft-intent.md +162 -0
- package/assets/skills/design/agemon-design/references/dashboard.md +131 -0
- package/assets/skills/design/agemon-design/references/dataviz.md +197 -0
- package/assets/skills/design/agemon-design/references/finish-bar.md +243 -0
- package/assets/skills/design/agemon-design/references/forms.md +192 -0
- package/assets/skills/design/agemon-design/references/heuristics.md +319 -0
- package/assets/skills/design/agemon-design/references/inspiration.md +287 -0
- package/assets/skills/design/agemon-design/references/layout.md +236 -0
- package/assets/skills/design/agemon-design/references/loops.md +155 -0
- package/assets/skills/design/agemon-design/references/metadata.md +98 -0
- package/assets/skills/design/agemon-design/references/modern-css.md +448 -0
- package/assets/skills/design/agemon-design/references/motion.md +434 -0
- package/assets/skills/design/agemon-design/references/personas.md +206 -0
- package/assets/skills/design/agemon-design/references/preset-dashboard.md +109 -0
- package/assets/skills/design/agemon-design/references/preset-editorial.md +94 -0
- package/assets/skills/design/agemon-design/references/preset-minimal.md +93 -0
- package/assets/skills/design/agemon-design/references/principles-catalog.md +299 -0
- package/assets/skills/design/agemon-design/references/recipe-auth.md +88 -0
- package/assets/skills/design/agemon-design/references/recipe-dashboard.md +130 -0
- package/assets/skills/design/agemon-design/references/recipe-landing.md +120 -0
- package/assets/skills/design/agemon-design/references/responsive.md +168 -0
- package/assets/skills/design/agemon-design/references/review.md +340 -0
- package/assets/skills/design/agemon-design/references/routing.md +143 -0
- package/assets/skills/design/agemon-design/references/sound.md +150 -0
- package/assets/skills/design/agemon-design/references/spec.md +123 -0
- package/assets/skills/design/agemon-design/references/stack.md +522 -0
- package/assets/skills/design/agemon-design/references/stage-assets.md +106 -0
- package/assets/skills/design/agemon-design/references/stage-build.md +46 -0
- package/assets/skills/design/agemon-design/references/stage-critique.md +34 -0
- package/assets/skills/design/agemon-design/references/stage-directions.md +44 -0
- package/assets/skills/design/agemon-design/references/stage-intake.md +34 -0
- package/assets/skills/design/agemon-design/references/stage-verify.md +44 -0
- package/assets/skills/design/agemon-design/references/state-design.md +188 -0
- package/assets/skills/design/agemon-design/references/tells-2026-11.md +32 -0
- package/assets/skills/design/agemon-design/references/themes.md +233 -0
- package/assets/skills/design/agemon-design/references/third-party-licenses.md +323 -0
- package/assets/skills/design/agemon-design/references/tokens.md +350 -0
- package/assets/skills/design/agemon-design/references/typography.md +248 -0
- package/assets/skills/design/agemon-design/scripts/audit-page.js +532 -0
- package/assets/skills/design/agemon-design/scripts/check-source.mjs +358 -0
- package/assets/skills/design/agemon-design/scripts/deal.mjs +231 -0
- package/assets/skills/design/agemon-design/scripts/inventory.mjs +676 -0
- package/assets/skills/essentials/web-design-guidelines/LICENSE +21 -0
- package/assets/skills/essentials/web-design-guidelines/NOTICE.md +14 -0
- package/assets/skills/essentials/web-design-guidelines/SKILL.md +18 -0
- package/assets/skills/essentials/web-design-guidelines/references/guidelines.md +184 -0
- package/assets/skills/essentials/writing-guidelines/LICENSE +21 -0
- package/assets/skills/essentials/writing-guidelines/NOTICE.md +14 -0
- package/assets/skills/essentials/writing-guidelines/SKILL.md +18 -0
- package/assets/skills/essentials/writing-guidelines/references/guidelines.md +250 -0
- package/assets/skills/founder/agemon-founder-board/LICENSE +21 -0
- package/assets/skills/founder/agemon-founder-board/NOTICE.md +11 -0
- package/assets/skills/founder/agemon-founder-board/SKILL.md +111 -0
- package/assets/skills/founder/agemon-founder-board/lenses.md +84 -0
- package/assets/skills/founder/agemon-founder-brand/LICENSE +21 -0
- package/assets/skills/founder/agemon-founder-brand/NOTICE.md +12 -0
- package/assets/skills/founder/agemon-founder-brand/SKILL.md +77 -0
- package/assets/skills/founder/agemon-founder-cfo/LICENSE +21 -0
- package/assets/skills/founder/agemon-founder-cfo/NOTICE.md +12 -0
- package/assets/skills/founder/agemon-founder-cfo/SKILL.md +109 -0
- package/assets/skills/founder/agemon-founder-cfo/example.json +27 -0
- package/assets/skills/founder/agemon-founder-cfo/unit_economics.py +270 -0
- package/assets/skills/founder/agemon-founder-competitors/LICENSE +21 -0
- package/assets/skills/founder/agemon-founder-competitors/NOTICE.md +12 -0
- package/assets/skills/founder/agemon-founder-competitors/SKILL.md +84 -0
- package/assets/skills/founder/agemon-founder-consumer/LICENSE +21 -0
- package/assets/skills/founder/agemon-founder-consumer/NOTICE.md +11 -0
- package/assets/skills/founder/agemon-founder-consumer/SKILL.md +126 -0
- package/assets/skills/founder/agemon-founder-consumer/customer.example.json +34 -0
- package/assets/skills/founder/agemon-founder-consumer/panel.py +424 -0
- package/assets/skills/founder/agemon-founder-consumer/pitch.example.md +3 -0
- package/assets/skills/founder/agemon-founder-launch/LICENSE +21 -0
- package/assets/skills/founder/agemon-founder-launch/NOTICE.md +11 -0
- package/assets/skills/founder/agemon-founder-launch/SKILL.md +65 -0
- package/assets/skills/founder/agemon-founder-marketing/LICENSE +21 -0
- package/assets/skills/founder/agemon-founder-marketing/NOTICE.md +11 -0
- package/assets/skills/founder/agemon-founder-marketing/SKILL.md +80 -0
- package/assets/skills/founder/agemon-founder-offer/LICENSE +21 -0
- package/assets/skills/founder/agemon-founder-offer/NOTICE.md +11 -0
- package/assets/skills/founder/agemon-founder-offer/SKILL.md +75 -0
- package/assets/skills/founder/agemon-founder-ops/LICENSE +21 -0
- package/assets/skills/founder/agemon-founder-ops/NOTICE.md +12 -0
- package/assets/skills/founder/agemon-founder-ops/SKILL.md +77 -0
- package/assets/skills/founder/agemon-founder-plan/LICENSE +21 -0
- package/assets/skills/founder/agemon-founder-plan/NOTICE.md +11 -0
- package/assets/skills/founder/agemon-founder-plan/SKILL.md +88 -0
- package/assets/skills/founder/agemon-founder-plan/compile.py +178 -0
- package/assets/skills/founder/agemon-founder-pricing/LICENSE +21 -0
- package/assets/skills/founder/agemon-founder-pricing/NOTICE.md +12 -0
- package/assets/skills/founder/agemon-founder-pricing/SKILL.md +92 -0
- package/assets/skills/founder/agemon-founder-pricing/van_westendorp.py +172 -0
- package/assets/skills/geo-seo/geo/LICENSE +21 -0
- package/assets/skills/geo-seo/geo/NOTICE.md +18 -0
- package/assets/skills/geo-seo/geo/SKILL.md +145 -0
- package/assets/skills/geo-seo/geo-audit/LICENSE +21 -0
- package/assets/skills/geo-seo/geo-audit/NOTICE.md +17 -0
- package/assets/skills/geo-seo/geo-audit/SKILL.md +371 -0
- package/assets/skills/geo-seo/geo-audit/references/ai-visibility.md +233 -0
- package/assets/skills/geo-seo/geo-audit/references/content.md +329 -0
- package/assets/skills/geo-seo/geo-audit/references/platform-analysis.md +294 -0
- package/assets/skills/geo-seo/geo-audit/references/schema.md +383 -0
- package/assets/skills/geo-seo/geo-audit/references/technical.md +368 -0
- package/assets/skills/geo-seo/geo-brand-mentions/LICENSE +21 -0
- package/assets/skills/geo-seo/geo-brand-mentions/NOTICE.md +15 -0
- package/assets/skills/geo-seo/geo-brand-mentions/SKILL.md +459 -0
- package/assets/skills/geo-seo/geo-citability/LICENSE +21 -0
- package/assets/skills/geo-seo/geo-citability/NOTICE.md +14 -0
- package/assets/skills/geo-seo/geo-citability/SKILL.md +320 -0
- package/assets/skills/geo-seo/geo-content/LICENSE +21 -0
- package/assets/skills/geo-seo/geo-content/NOTICE.md +14 -0
- package/assets/skills/geo-seo/geo-content/SKILL.md +352 -0
- package/assets/skills/geo-seo/geo-crawlers/LICENSE +21 -0
- package/assets/skills/geo-seo/geo-crawlers/NOTICE.md +15 -0
- package/assets/skills/geo-seo/geo-crawlers/SKILL.md +388 -0
- package/assets/skills/geo-seo/geo-llmstxt/LICENSE +21 -0
- package/assets/skills/geo-seo/geo-llmstxt/NOTICE.md +14 -0
- package/assets/skills/geo-seo/geo-llmstxt/SKILL.md +433 -0
- package/assets/skills/geo-seo/geo-platform-optimizer/LICENSE +21 -0
- package/assets/skills/geo-seo/geo-platform-optimizer/NOTICE.md +14 -0
- package/assets/skills/geo-seo/geo-platform-optimizer/SKILL.md +282 -0
- package/assets/skills/geo-seo/geo-report/LICENSE +21 -0
- package/assets/skills/geo-seo/geo-report/NOTICE.md +14 -0
- package/assets/skills/geo-seo/geo-report/SKILL.md +406 -0
- package/assets/skills/geo-seo/geo-report-pdf/LICENSE +21 -0
- package/assets/skills/geo-seo/geo-report-pdf/NOTICE.md +20 -0
- package/assets/skills/geo-seo/geo-report-pdf/SKILL.md +153 -0
- package/assets/skills/geo-seo/geo-report-pdf/templates/geo-report-template.html +548 -0
- package/assets/skills/geo-seo/geo-schema/LICENSE +21 -0
- package/assets/skills/geo-seo/geo-schema/NOTICE.md +16 -0
- package/assets/skills/geo-seo/geo-schema/SKILL.md +396 -0
- package/assets/skills/geo-seo/geo-technical/LICENSE +21 -0
- package/assets/skills/geo-seo/geo-technical/NOTICE.md +15 -0
- package/assets/skills/geo-seo/geo-technical/SKILL.md +566 -0
- package/assets/skills/output-style/agemon-adhd/LICENSE +21 -0
- package/assets/skills/output-style/agemon-adhd/NOTICE.md +13 -0
- package/assets/skills/output-style/agemon-adhd/SKILL.md +138 -0
- package/assets/skills/performance/agemon-performance/NOTICE.md +1 -0
- package/assets/skills/performance/agemon-performance/SKILL.md +76 -0
- package/assets/skills/security/agemon-security/LICENSE +21 -0
- package/assets/skills/security/agemon-security/NOTICE.md +8 -0
- package/assets/skills/security/agemon-security/SKILL.md +356 -0
- package/assets/skills/security/agemon-security-audit/AI-AND-LLM.md +83 -0
- package/assets/skills/security/agemon-security-audit/ATTACK-CLASSES.md +130 -0
- package/assets/skills/security/agemon-security-audit/CLIENT-SIDE.md +83 -0
- package/assets/skills/security/agemon-security-audit/CLOUD-AND-DEPLOYMENT.md +86 -0
- package/assets/skills/security/agemon-security-audit/DATA-ISOLATION-AND-LIFECYCLE.md +84 -0
- package/assets/skills/security/agemon-security-audit/DESKTOP-MOBILE-AND-LOCAL-IPC.md +89 -0
- package/assets/skills/security/agemon-security-audit/HUNTING.md +251 -0
- package/assets/skills/security/agemon-security-audit/LICENSE +21 -0
- package/assets/skills/security/agemon-security-audit/MEMORY-SAFETY-AND-BINARY.md +101 -0
- package/assets/skills/security/agemon-security-audit/NOTICE.md +12 -0
- package/assets/skills/security/agemon-security-audit/PROTOCOLS-RPC-AND-MESSAGING.md +81 -0
- package/assets/skills/security/agemon-security-audit/RECONNAISSANCE.md +156 -0
- package/assets/skills/security/agemon-security-audit/RESOURCE-EXHAUSTION-AND-AVAILABILITY.md +78 -0
- package/assets/skills/security/agemon-security-audit/SKILL.md +192 -0
- package/assets/skills/security/agemon-security-audit/SUPPLY-CHAIN-AND-RELEASE.md +73 -0
- package/assets/skills/security/agemon-security-audit/VALIDATION-AND-REPORTING.md +186 -0
- package/assets/skills/security/agemon-security-audit/WEB-PROTOCOL-AND-AUTH.md +105 -0
- package/assets/skills/security/agemon-security-audit/report-schema.json +461 -0
- package/assets/skills/security/agemon-security-audit/validate-coverage-ledger.cjs +872 -0
- package/assets/skills/security/agemon-security-audit/validate-findings.cjs +773 -0
- package/assets/skills/self-review/agemon-review-intake/LICENSE +21 -0
- package/assets/skills/self-review/agemon-review-intake/NOTICE.md +9 -0
- package/assets/skills/self-review/agemon-review-intake/SKILL.md +205 -0
- package/assets/skills/self-review/agemon-review-request/LICENSE +21 -0
- package/assets/skills/self-review/agemon-review-request/NOTICE.md +9 -0
- package/assets/skills/self-review/agemon-review-request/SKILL.md +104 -0
- package/assets/skills/self-review/agemon-review-request/code-reviewer.md +188 -0
- package/assets/skills/self-review/agemon-root-cause/LICENSE +21 -0
- package/assets/skills/self-review/agemon-root-cause/NOTICE.md +10 -0
- package/assets/skills/self-review/agemon-root-cause/SKILL.md +283 -0
- package/assets/skills/self-review/agemon-root-cause/condition-based-waiting-example.ts +158 -0
- package/assets/skills/self-review/agemon-root-cause/condition-based-waiting.md +115 -0
- package/assets/skills/self-review/agemon-root-cause/defense-in-depth.md +122 -0
- package/assets/skills/self-review/agemon-root-cause/find-polluter.sh +72 -0
- package/assets/skills/self-review/agemon-root-cause/root-cause-tracing.md +169 -0
- package/assets/skills/self-review/agemon-root-cause/test-academic.md +14 -0
- package/assets/skills/self-review/agemon-root-cause/test-pressure-1.md +58 -0
- package/assets/skills/self-review/agemon-root-cause/test-pressure-2.md +68 -0
- package/assets/skills/self-review/agemon-root-cause/test-pressure-3.md +69 -0
- package/assets/skills/self-review/agemon-verify-before-done/LICENSE +21 -0
- package/assets/skills/self-review/agemon-verify-before-done/NOTICE.md +9 -0
- package/assets/skills/self-review/agemon-verify-before-done/SKILL.md +120 -0
- package/assets/skills/team-lead/agemon-plan-rfc/SKILL.md +317 -0
- package/assets/skills/team-lead/prd-generator/SKILL.md +437 -0
- package/assets/skills/team-lead/skill-headofit-audit/SKILL.md +72 -0
- package/assets/skills/team-lead/skill-incident-rca/SKILL.md +66 -0
- package/assets/skills/team-lead/skill-meeting-lifecycle/SKILL.md +63 -0
- package/assets/skills/team-lead/skill-obsidian-vault-sync/SKILL.md +69 -0
- package/assets/skills/team-lead/skill-prd-decomposer/SKILL.md +71 -0
- package/assets/skills/team-lead/skill-sec-check/SKILL.md +70 -0
- package/assets/skills/team-lead/skill-task-extractor/SKILL.md +79 -0
- package/assets/skills/team-lead/skill-tech-spike/SKILL.md +57 -0
- package/assets/skills/team-lead/skill-techlead-reviewer/SKILL.md +81 -0
- package/assets/skills/workflow/agemon-brainstorming/LICENSE +21 -0
- package/assets/skills/workflow/agemon-brainstorming/NOTICE.md +14 -0
- package/assets/skills/workflow/agemon-brainstorming/SKILL.md +287 -0
- package/assets/skills/workflow/agemon-brainstorming/builder-check-prompt.md +23 -0
- package/assets/skills/workflow/agemon-dispatching-parallel-agents/LICENSE +21 -0
- package/assets/skills/workflow/agemon-dispatching-parallel-agents/NOTICE.md +13 -0
- package/assets/skills/workflow/agemon-dispatching-parallel-agents/SKILL.md +167 -0
- package/assets/skills/workflow/agemon-executing-plans/LICENSE +21 -0
- package/assets/skills/workflow/agemon-executing-plans/NOTICE.md +15 -0
- package/assets/skills/workflow/agemon-executing-plans/SKILL.md +322 -0
- package/assets/skills/workflow/agemon-executing-plans/scripts/task-done +55 -0
- package/assets/skills/workflow/agemon-executing-plans/scripts/task-start +32 -0
- package/assets/skills/workflow/agemon-finishing-a-development-branch/LICENSE +21 -0
- package/assets/skills/workflow/agemon-finishing-a-development-branch/NOTICE.md +13 -0
- package/assets/skills/workflow/agemon-finishing-a-development-branch/SKILL.md +225 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/LICENSE +21 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/NOTICE.md +15 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/SKILL.md +339 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/code-reviewer.md +198 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/implementer-prompt.md +154 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/re-review-prompt.md +116 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/references/batching.md +11 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/references/cannot-verify.md +10 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/references/final-review.md +49 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/references/fix-loop.md +77 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/references/handling-reports.md +15 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/references/preflight.md +26 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/references/resuming.md +12 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/references/role-scout.md +18 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/references/role-worker.md +19 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/scripts/review-package +64 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/scripts/sdd-repo +54 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/scripts/sdd-workspace +110 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/scripts/task-brief +108 -0
- package/assets/skills/workflow/agemon-subagent-driven-development/task-reviewer-prompt.md +209 -0
- package/assets/skills/workflow/agemon-test-driven-development/LICENSE +21 -0
- package/assets/skills/workflow/agemon-test-driven-development/NOTICE.md +14 -0
- package/assets/skills/workflow/agemon-test-driven-development/SKILL.md +330 -0
- package/assets/skills/workflow/agemon-test-driven-development/writing-good-tests.md +198 -0
- package/assets/skills/workflow/agemon-using-git-worktrees/LICENSE +21 -0
- package/assets/skills/workflow/agemon-using-git-worktrees/NOTICE.md +13 -0
- package/assets/skills/workflow/agemon-using-git-worktrees/SKILL.md +167 -0
- package/assets/skills/workflow/agemon-writing-plans/LICENSE +21 -0
- package/assets/skills/workflow/agemon-writing-plans/NOTICE.md +13 -0
- package/assets/skills/workflow/agemon-writing-plans/SKILL.md +204 -0
- package/assets/tools/code-review-graph-constraints.txt +1418 -0
- package/assets/tools/package-lock.json +111 -0
- package/assets/tools/package.json +6 -0
- package/dist/chunk-ZZBF3GOV.js +3451 -0
- package/dist/chunk-ZZBF3GOV.js.map +1 -0
- package/dist/fake-subprocess-IV4ML77S.js +636 -0
- package/dist/fake-subprocess-IV4ML77S.js.map +1 -0
- package/dist/index.js +23836 -1945
- package/dist/index.js.map +1 -1
- package/package.json +37 -17
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
# Modern CSS Capabilities
|
|
2
|
+
|
|
3
|
+
CSS capabilities that unlock interaction patterns otherwise requiring JS: View Transitions, CSS Scroll Timelines, Anchor Positioning, Container Queries, `@starting-style`, allow-keywords. Each section: when to reach for the API, what principle it encodes, and the rules that follow from the principle.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## View Transitions API
|
|
8
|
+
|
|
9
|
+
View Transitions preserve scroll position and focus across navigations because the browser captures both before and after states as snapshots, eliminating the layout thrashing and focus loss that hand-rolled JS transitions cause. The browser handles the morph; you name the elements that should persist.
|
|
10
|
+
|
|
11
|
+
**Use View Transitions when:** DOM identity is preserved across views — App Router page transitions, list-to-detail flows where the same element exists on both sides of the navigation.
|
|
12
|
+
|
|
13
|
+
**Don't use View Transitions for:** modal overlays (use `@starting-style` + `display: block` allow-keywords instead), in-page state transitions (use CSS Scroll Timelines or simple transitions), tab-switching within the same page (no view boundary).
|
|
14
|
+
|
|
15
|
+
### Basic Usage
|
|
16
|
+
```js
|
|
17
|
+
document.startViewTransition(() => {
|
|
18
|
+
// Update DOM here
|
|
19
|
+
updatePage();
|
|
20
|
+
});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Named Transitions
|
|
24
|
+
```css
|
|
25
|
+
/* Source element */
|
|
26
|
+
.card-image { view-transition-name: card-hero; }
|
|
27
|
+
|
|
28
|
+
/* Style the transition */
|
|
29
|
+
::view-transition-group(card-hero) {
|
|
30
|
+
animation-duration: 300ms;
|
|
31
|
+
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Rules
|
|
36
|
+
|
|
37
|
+
Each `view-transition-name` must be unique at the moment the transition fires — two elements sharing the same name will cause the transition to fail silently. Names are a handshake between the before and after state; clean them up so stale names don't leak across navigations.
|
|
38
|
+
|
|
39
|
+
- Each `view-transition-name` must be **unique during transition**
|
|
40
|
+
- **Clean up names** after transition completes:
|
|
41
|
+
```js
|
|
42
|
+
sourceImg.style.viewTransitionName = "card";
|
|
43
|
+
document.startViewTransition(() => {
|
|
44
|
+
sourceImg.style.viewTransitionName = "";
|
|
45
|
+
targetImg.style.viewTransitionName = "card";
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
- Use **only for navigation-level changes** — avoid for rapid interactions
|
|
49
|
+
- Interruptibility is limited — avoid for interaction-heavy UI
|
|
50
|
+
- Prefer over JS animation libraries for page transitions
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## @starting-style
|
|
55
|
+
|
|
56
|
+
`@starting-style` defines the element's style on first paint, before the browser computes the transition. Without it there is no "from" state for a newly mounted element — the browser skips the transition entirely. This replaces the `useEffect` → `setMounted(true)` → `data-mounted` pattern with a single CSS block.
|
|
57
|
+
|
|
58
|
+
```css
|
|
59
|
+
.toast {
|
|
60
|
+
opacity: 1;
|
|
61
|
+
transform: translateY(0);
|
|
62
|
+
transition: opacity 400ms ease, transform 400ms ease;
|
|
63
|
+
|
|
64
|
+
@starting-style {
|
|
65
|
+
opacity: 0;
|
|
66
|
+
transform: translateY(100%);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Baseline 2024. Pair with `transition-behavior: allow-discrete` when the element toggles `display`.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## CSS Scroll Timelines
|
|
76
|
+
|
|
77
|
+
Scroll Timelines drive animations from scroll position rather than time, running off the main thread with zero scroll event listeners. The timeline replaces the clock — the progress of the scroll IS the animation progress.
|
|
78
|
+
|
|
79
|
+
### Scroll-Linked
|
|
80
|
+
```css
|
|
81
|
+
.progress-bar {
|
|
82
|
+
animation: grow linear;
|
|
83
|
+
animation-timeline: scroll();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@keyframes grow {
|
|
87
|
+
from { transform: scaleX(0); }
|
|
88
|
+
to { transform: scaleX(1); }
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### View-Linked (element entering viewport)
|
|
93
|
+
```css
|
|
94
|
+
.reveal {
|
|
95
|
+
animation: fade-in linear;
|
|
96
|
+
animation-timeline: view();
|
|
97
|
+
animation-range: entry 0% entry 100%;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@keyframes fade-in {
|
|
101
|
+
from { opacity: 0; transform: translateY(20px); }
|
|
102
|
+
to { opacity: 1; transform: translateY(0); }
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Rules
|
|
107
|
+
|
|
108
|
+
Scroll Timelines exist because polling `scrollY` or attaching scroll event listeners for continuous animation causes layout/paint work on every frame — a Scroll Timeline runs on the compositor thread and costs nothing. Reserve IntersectionObserver for one-shot visibility triggers (wider support, no continuous callback overhead).
|
|
109
|
+
|
|
110
|
+
- Prefer Scroll/View Timelines over JS for scroll-linked motion
|
|
111
|
+
- Never poll scroll position for animation
|
|
112
|
+
- Never use `scroll` event listeners for continuous animation
|
|
113
|
+
- Use IntersectionObserver for visibility/pausing (wider support)
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Container Queries
|
|
118
|
+
|
|
119
|
+
A component's layout should respond to the space it occupies, not the viewport. Viewport media queries break reusable components because the same component in a sidebar and in main content hits the same breakpoints even though the available space is completely different. Container queries fix the unit of measure.
|
|
120
|
+
|
|
121
|
+
```css
|
|
122
|
+
.card-container {
|
|
123
|
+
container-type: inline-size;
|
|
124
|
+
container-name: card;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@container card (min-width: 400px) {
|
|
128
|
+
.card { display: grid; grid-template-columns: 1fr 2fr; }
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@container card (max-width: 399px) {
|
|
132
|
+
.card { display: flex; flex-direction: column; }
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Pseudo-Elements
|
|
139
|
+
|
|
140
|
+
`::before` and `::after` add a layer of styling surface without extra DOM nodes. The most useful application is interactive state overlays — placing a pseudo-element between the element's background and content lets hover/focus states change the overlay without affecting surrounding elements. Hit target expansion is the other dominant use case: extend the interactive area without changing the visible element.
|
|
141
|
+
|
|
142
|
+
### Decorative Content (::before / ::after)
|
|
143
|
+
```css
|
|
144
|
+
/* Background effect without extra DOM */
|
|
145
|
+
.button {
|
|
146
|
+
position: relative;
|
|
147
|
+
z-index: 1;
|
|
148
|
+
}
|
|
149
|
+
.button::before {
|
|
150
|
+
content: "";
|
|
151
|
+
position: absolute;
|
|
152
|
+
inset: 0;
|
|
153
|
+
background: var(--gray-3);
|
|
154
|
+
z-index: -1;
|
|
155
|
+
border-radius: inherit;
|
|
156
|
+
transition: background 150ms ease;
|
|
157
|
+
}
|
|
158
|
+
.button:hover::before {
|
|
159
|
+
background: var(--gray-4);
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Hit Target Expansion
|
|
164
|
+
```css
|
|
165
|
+
.small-icon-button {
|
|
166
|
+
position: relative;
|
|
167
|
+
}
|
|
168
|
+
.small-icon-button::before {
|
|
169
|
+
content: "";
|
|
170
|
+
position: absolute;
|
|
171
|
+
inset: -8px -12px; /* Expand clickable area */
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Rules
|
|
176
|
+
|
|
177
|
+
- `::before`/`::after` **require `content` property** to render
|
|
178
|
+
- Parent must have `position: relative` for absolute pseudo-elements
|
|
179
|
+
- Pseudo-elements need `z-index` for proper layering
|
|
180
|
+
- **Use pseudo-elements for decoration** — don't add extra DOM nodes
|
|
181
|
+
- Native variants: `::backdrop` (dialog/popover backgrounds), `::placeholder` (input text), `::selection` (highlighted text)
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## clip-path for Animation
|
|
186
|
+
|
|
187
|
+
`clip-path: inset()` is the cleaner alternative to animating `width` or `height` for reveal effects — it composites, doesn't reflow, and accepts fractional values. Four inset values map to top/right/bottom/left clipping edges; animate between them for directional reveals.
|
|
188
|
+
|
|
189
|
+
```css
|
|
190
|
+
.hidden { clip-path: inset(0 100% 0 0); } /* clipped from right */
|
|
191
|
+
.visible { clip-path: inset(0 0 0 0); } /* fully visible */
|
|
192
|
+
.element { transition: clip-path 200ms ease-out; }
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Patterns: hold-to-delete (2s linear on `:active`), tab transitions, image reveals on scroll, comparison sliders. In all cases the visible-state value is `inset(0 0 0 0)` — vary the hidden-state edge to control direction.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Useful Modern Properties
|
|
200
|
+
|
|
201
|
+
| Property | Use |
|
|
202
|
+
|----------|-----|
|
|
203
|
+
| `text-wrap: balance` | Balanced line lengths for headings |
|
|
204
|
+
| `text-wrap: pretty` | Better line breaks for body text |
|
|
205
|
+
| `font-variant-numeric: tabular-nums` | Aligned numbers in tables/data |
|
|
206
|
+
| `overscroll-behavior: contain` | Prevent scroll chaining in modals |
|
|
207
|
+
| `scroll-margin-top` | Offset for anchor links with sticky headers |
|
|
208
|
+
| `content-visibility: auto` | Lazy-render off-screen content |
|
|
209
|
+
| `color-scheme: dark` | Native dark mode for scrollbars/forms |
|
|
210
|
+
| `accent-color` | Style form controls (checkboxes, radios) |
|
|
211
|
+
| `scrollbar-gutter: stable` | Reserve the scrollbar track so content never shifts when it appears |
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Edge Fades: `mask-image`, Never a Gradient Overlay
|
|
216
|
+
|
|
217
|
+
A fade to the edge of a scroll area or an image is a **transparency** effect, not a color effect. Build it with `mask-image`, never with a `linear-gradient` overlay from `transparent` to the background color.
|
|
218
|
+
|
|
219
|
+
```css
|
|
220
|
+
/* Wrong — a gradient overlay hardcodes the background */
|
|
221
|
+
.fade { background: linear-gradient(to bottom, transparent, var(--bg)); }
|
|
222
|
+
|
|
223
|
+
/* Right — the mask fades the element itself */
|
|
224
|
+
.fade {
|
|
225
|
+
mask-image: linear-gradient(to bottom, black 60%, transparent);
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**Why:** the overlay is painted in one specific color, so it only reads correctly on that exact background. It breaks the moment the element sits on a tinted surface, inside a card, in dark mode, or over an image — a visible band appears where the fake background meets the real one. A mask removes pixels instead of painting over them, so it is correct on every background by construction. It also survives a theme flip with no dark-mode override.
|
|
230
|
+
|
|
231
|
+
### Rules
|
|
232
|
+
|
|
233
|
+
- **Never fade over a scroll area's leading edge.** A mask at the bottom of a list hides exactly the content the user is scrolling toward. Fade the trailing edge only, or drop the effect.
|
|
234
|
+
- **Ease the stops on any fade over ~200px.** A two-stop gradient bands on wide surfaces; add intermediate stops (`black 60%, rgba(0,0,0,0.6) 80%, transparent`) so the ramp reads smooth.
|
|
235
|
+
- **Prefer masks for image edges and text truncation too** — same reasoning: independent of the surface below.
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## Anchor Positioning
|
|
240
|
+
|
|
241
|
+
Anchor Positioning replaces JS-driven popover positioning — no `getBoundingClientRect()`, no resize observers, no coordinate math. The browser owns the placement and handles viewport overflow through declarative fallback chains. Baseline 2026 (Firefox 147, Safari 26, Chrome 125+). Kills the Floating UI dependency for most cases; pair with the Popover API for a fully declarative menu.
|
|
242
|
+
|
|
243
|
+
```css
|
|
244
|
+
.button {
|
|
245
|
+
anchor-name: --trigger;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.popover {
|
|
249
|
+
position: absolute;
|
|
250
|
+
position-anchor: --trigger;
|
|
251
|
+
position-area: bottom center; /* one-line placement */
|
|
252
|
+
margin-top: 8px;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/* Fallback if there's no room below */
|
|
256
|
+
@position-try --top {
|
|
257
|
+
position-area: top center;
|
|
258
|
+
margin-top: 0;
|
|
259
|
+
margin-bottom: 8px;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.popover {
|
|
263
|
+
position-try-fallbacks: --top;
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Rules
|
|
268
|
+
|
|
269
|
+
Anchor names are scoped to their containing block by default — explicitly declare `position-anchor` in nested contexts to avoid resolution ambiguity. Always define a fallback so viewport-edge popovers don't clip rather than flip.
|
|
270
|
+
|
|
271
|
+
- Anchor names are scoped by default; use `position-anchor` explicitly in nested cases
|
|
272
|
+
- Always define a `position-try-fallbacks` for viewport-edge cases
|
|
273
|
+
- Pair with `<div popover>` for automatic focus and dismiss handling
|
|
274
|
+
- Progressive enhancement: feature-detect with `@supports (anchor-name: --x)`, fall back to JS only for older browsers
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Popover API + `<dialog>`
|
|
279
|
+
|
|
280
|
+
The browser already implements focus trapping, ESC handling, and backdrop rendering for modal and non-modal overlays. Building these in JS means reimplementing browser behavior with more code and more failure modes. Use the platform.
|
|
281
|
+
|
|
282
|
+
```html
|
|
283
|
+
<!-- Popover: lightweight menu, tooltip, dropdown -->
|
|
284
|
+
<button popovertarget="menu">Open menu</button>
|
|
285
|
+
<div id="menu" popover>
|
|
286
|
+
<button>Profile</button>
|
|
287
|
+
<button>Settings</button>
|
|
288
|
+
<button>Sign out</button>
|
|
289
|
+
</div>
|
|
290
|
+
|
|
291
|
+
<!-- Dialog: modal with backdrop -->
|
|
292
|
+
<dialog id="confirm">
|
|
293
|
+
<form method="dialog">
|
|
294
|
+
<p>Delete this workspace?</p>
|
|
295
|
+
<button value="cancel">Cancel</button>
|
|
296
|
+
<button value="delete">Delete</button>
|
|
297
|
+
</form>
|
|
298
|
+
</dialog>
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
```js
|
|
302
|
+
// Open modal dialog (ESC closes, focus trapped)
|
|
303
|
+
document.getElementById('confirm').showModal();
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Rules
|
|
307
|
+
|
|
308
|
+
Native `<dialog>` and `[popover]` enforce correct semantics and ARIA roles automatically — a custom `<div role="dialog">` with manual focus management is always more code for a worse result.
|
|
309
|
+
|
|
310
|
+
- Use `<dialog>` with `showModal()` for modals — get focus trap + backdrop + ESC for free
|
|
311
|
+
- Use `popover` attribute for non-modal overlays (menus, tooltips, combobox panels)
|
|
312
|
+
- Pair Popover with Anchor Positioning for placement instead of JS math
|
|
313
|
+
- Style `::backdrop` for dim/blur behind modals
|
|
314
|
+
- **Anti-pattern:** custom `<div role="dialog">` with manual focus management when `<dialog>` works
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## `interpolate-size: allow-keywords`
|
|
319
|
+
|
|
320
|
+
Browsers historically refused to animate to intrinsic sizes (`height: auto`, `width: max-content`) because the value isn't known until layout. `interpolate-size: allow-keywords` opts in to browser-side interpolation of these values, enabling accordion and disclosure patterns without JS measurement. Baseline 2025 — supported in all current major browsers; keep the JS fallback only if you support older releases.
|
|
321
|
+
|
|
322
|
+
```css
|
|
323
|
+
:root {
|
|
324
|
+
interpolate-size: allow-keywords;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.accordion {
|
|
328
|
+
height: 0;
|
|
329
|
+
overflow: hidden;
|
|
330
|
+
transition: height 300ms var(--ease-out);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.accordion[open] {
|
|
334
|
+
height: auto; /* now animatable */
|
|
335
|
+
}
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
### Rules
|
|
339
|
+
|
|
340
|
+
Set at `:root` so every element in the document inherits the opt-in — scoping it narrower creates inconsistency. The fallback for non-supporting browsers is to measure `scrollHeight` in JS and animate to a pixel value.
|
|
341
|
+
|
|
342
|
+
- Set `interpolate-size: allow-keywords` at `:root` to opt-in globally
|
|
343
|
+
- Works with `height`, `width`, `block-size`, `inline-size` to/from `auto`, `min-content`, `max-content`, `fit-content`
|
|
344
|
+
- Fallback for non-supporting browsers: JS measures scroll height and animates to a pixel value
|
|
345
|
+
- Respect `prefers-reduced-motion` — snap to final size without transition
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
## `color-mix()` for Theming Derivations
|
|
350
|
+
|
|
351
|
+
Hand-tuned shade ladders break every time the base token changes. `color-mix()` derives hover, pressed, muted, and ring variants from a single base token — one change propagates through every derived value. Mix in `oklch` for perceptual uniformity; sRGB mixing produces inconsistent lightness shifts across hues.
|
|
352
|
+
|
|
353
|
+
```css
|
|
354
|
+
:root {
|
|
355
|
+
--accent: oklch(62% 0.15 250);
|
|
356
|
+
--surface: oklch(98% 0.005 250);
|
|
357
|
+
|
|
358
|
+
--accent-hover: color-mix(in oklch, var(--accent) 85%, white);
|
|
359
|
+
--accent-pressed: color-mix(in oklch, var(--accent) 85%, black);
|
|
360
|
+
--accent-muted: color-mix(in oklch, var(--accent) 20%, var(--surface));
|
|
361
|
+
--accent-ring: color-mix(in oklch, var(--accent) 40%, transparent);
|
|
362
|
+
}
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Rules
|
|
366
|
+
|
|
367
|
+
- Mix in `oklch` or `lch` for perceptual uniformity — never `srgb` unless the base is already sRGB
|
|
368
|
+
- Same derivation pattern works for semantic palettes: `--success`, `--warning`, `--danger` each get their own hover/pressed/muted
|
|
369
|
+
- One base change cascades through every derived token — no ladder to re-tune
|
|
370
|
+
- Feature support: Baseline 2024, safe to ship
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
## `transition-behavior: allow-discrete`
|
|
375
|
+
|
|
376
|
+
CSS transitions skip `display: none` by default because `none` is not a numeric value — there is no midpoint to interpolate. `allow-discrete` tells the browser to hold the element visible through the exit transition before applying `display: none`, enabling fade-out on elements that unmount from the DOM.
|
|
377
|
+
|
|
378
|
+
```css
|
|
379
|
+
.menu {
|
|
380
|
+
display: none;
|
|
381
|
+
opacity: 0;
|
|
382
|
+
transition:
|
|
383
|
+
opacity 200ms var(--ease-out),
|
|
384
|
+
display 200ms allow-discrete;
|
|
385
|
+
|
|
386
|
+
@starting-style {
|
|
387
|
+
opacity: 0;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.menu:popover-open {
|
|
392
|
+
display: block;
|
|
393
|
+
opacity: 1;
|
|
394
|
+
}
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### Rules
|
|
398
|
+
|
|
399
|
+
Without `allow-discrete`, popovers and dialogs snap in and out — there is no mechanism to fade them. Without `@starting-style`, the enter keyframe has no "from" state and the element jumps directly to its final state on first paint.
|
|
400
|
+
|
|
401
|
+
- `allow-discrete` enables transitions on `display`, `visibility`, and custom-property changes
|
|
402
|
+
- Combine with `@starting-style` for the enter keyframe — without it, the element jumps to its final state on first paint
|
|
403
|
+
- Essential for `<dialog>` and `[popover]` fade/slide animations
|
|
404
|
+
- Without it, popovers snap in/out — no way to fade them
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
## Container Queries — Deeper Patterns
|
|
409
|
+
|
|
410
|
+
Beyond the basic size query. Use for component-level responsiveness where viewport media queries are the wrong tool.
|
|
411
|
+
|
|
412
|
+
### When to prefer container over media queries
|
|
413
|
+
|
|
414
|
+
- Component reused across sidebar + main + modal at different widths
|
|
415
|
+
- Layout must respond to its slot, not the viewport
|
|
416
|
+
- Design system components meant to be dropped into arbitrary layouts
|
|
417
|
+
|
|
418
|
+
**Anti-pattern:** using `@media (max-width: 768px)` to change a card's layout when the card lives in both a narrow sidebar and a wide main region — the breakpoint fires on both even though only one needs the narrow layout.
|
|
419
|
+
|
|
420
|
+
### Style queries
|
|
421
|
+
```css
|
|
422
|
+
.card {
|
|
423
|
+
container-name: card;
|
|
424
|
+
container-type: inline-size;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
@container card style(--theme: dark) {
|
|
428
|
+
.card__title { color: oklch(95% 0 0); }
|
|
429
|
+
}
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
Style queries read custom properties from the container (custom-property style queries are Baseline 2025 — supported in all current major browsers).
|
|
433
|
+
|
|
434
|
+
### Named containers for predictable scoping
|
|
435
|
+
```css
|
|
436
|
+
.sidebar { container-name: sidebar; container-type: inline-size; }
|
|
437
|
+
.main { container-name: main; container-type: inline-size; }
|
|
438
|
+
|
|
439
|
+
@container sidebar (min-width: 240px) {
|
|
440
|
+
.nav-item { padding-inline: 12px; }
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
@container main (min-width: 720px) {
|
|
444
|
+
.nav-item { padding-inline: 20px; }
|
|
445
|
+
}
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
Same component, different behavior per parent. Viewport media queries can't express this.
|