css-render-performance
Skill2 starsChanged 9 days agoMITView on GitHub
Guide CSS render performance analysis and optimization. Use this skill when reviewing or writing CSS animations, transitions, scroll-heavy UIs, or long lists — even if they just say "this animation is janky" or "optimize the CSS". Covers compositor layer promotion, paint vs composite, and content-visibility. Not for accessibility-auditor, ui-ux-optimize.
In this repository63 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/avoid-ai-writing/AGENTS.mdAGENTS.md
- .agents/skills/do-web-doc-resolver/AGENTS.mdAGENTS.md
- .agents/skills/skill-evaluator/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms-full.txtllms.txt
- llms.txtllms.txt
- accessibility-auditorSkill
- agent-browserSkill
- agentic-abstentionSkill
- agents-mdSkill
- api-design-firstSkill
- architecture-diagramSkill
- avoid-ai-writingSkill
- cicd-pipelineSkill
- cloudflare-worker-apiSkill
- codacySkill
- codeberg-apiSkill
- code-review-assistantSkill
- database-devopsSkill
- debuggerSkill
- delegateSkill
- dependency-upgradesSkill
- dist-channel-selectionSkill
- docs-hookSkill
- document-rendering-and-locatorsSkill
- dogfoodSkill
- dora-reportSkill
- do-web-doc-resolverSkill
- durable-objectsSkill
- eu-ai-act-complianceSkill
- git-github-workflowSkill
- goap-agentSkill
- implementerSkill
- intent-classifierSkill
- iterative-refinementSkill
- jules-delegatorSkill
- learnSkill
- lifecycle-managementSkill
- local-context-sanitizationSkill
- memory-contextSkill
- migration-refactoringSkill
- nested-build-isolationSkill
- privacy-firstSkill
- progressive-deliverySkill
- pwa-offline-syncSkill
- reader-ui-uxSkill
- readme-best-practicesSkill
- secrets-managementSkill
- secure-invite-and-accessSkill
- security-code-auditorSkill
- shell-script-qualitySkill
- skill-creatorSkill
- skill-evaluatorSkill
- static-analysisSkill
- testing-strategySkill
- test-runnerSkill
- triz-solverSkill
- turso-dbSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 49
Use will-change sparingly — it tells the browser to pre-allocate GPU memory.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CSS Render Performance
Guide CSS render performance analysis and optimization for smooth, jank-free user interfaces.
When to Use
- User asks about CSS animation performance or janky transitions
- Reviewing scroll-heavy UIs or long lists for render performance
- Even if they just say "this animation is janky" or "optimize the CSS"
Quick Check
- Profile with Chrome DevTools Performance tab (look for Long Frames)
- Check which CSS properties trigger layout vs paint vs composite
- Verify
will-changeis used sparingly (max 2-3 elements simultaneously) - Test on throttled CPU (4x) and slow network to simulate user devices
- Confirm no layout-triggering properties in animations (width, height, top, left)
Core Concepts
| Phase | What It Does | Cost | CSS Properties That Trigger It |
| Layout | Calculate geometry | Expensive | width, height, margin, padding, border, position, display, flex, grid |
| Paint | Fill in pixels | Expensive | color, background, box-shadow, visibility, border-radius |
| Composite | Layer on GPU | Cheap | transform, opacity |
Goal: Animate only composite-layer properties (transform, opacity) to avoid layout and paint.
Optimization Strategies
Promote Layers
Force elements onto their own compositing layer for GPU-accelerated animation:
.animated-element {
transform: translateZ(0); /* or will-change: transform */
}Use will-change sparingly — it tells the browser to pre-allocate GPU memory.
CSS Containment
Isolate DOM sub-trees to limit layout/paint scope:
.card {
contain: layout paint;
}Content Visibility
Skip rendering for off-screen content in long lists:
.offscreen-item {
content-visibility: auto;
contain-intrinsic-size: 0 500px;
}Decision Flowchart
Is the element animating?
├── Yes → Which property?
│ ├── transform or opacity → ✓ Safe (composite only)
│ ├── width, height, top, left → ✗ Triggers layout — refactor
│ ├── background, color → ⚠ Triggers paint — use contain or promote layer
│ └── Multiple properties → Consider FLIP technique or Web Animations API
└── No → Is it in a scrollable container?
├── Yes → Apply content-visibility: auto
└── No → Check for unnecessary repaints on state changesGotchas
will-change: allon many elements wastes GPU memory and causes mobile jank — budget to 2-3 elements max.transform: translateZ(0)on a parent promotes ALL children — can cause unexpected memory usage.- Animating
width/heighttriggers layout for EVERY frame — usetransform: scale()instead. content-visibility: autocan cause layout shifts ifcontain-intrinsic-sizeis wrong.- Developer hardware is fast — always profile on throttled CPU to see what users experience.
Rationalizations
| Rationalization | Reality |
| "The UI feels fine on my machine" | Developer hardware is faster than user devices; profile on throttled CPU and slow networks. |
| "will-change: all is safe for animations" | Premature layer promotion wastes GPU memory and causes compositing jank on mobile. |
| "content-visibility doesn't matter for small pages" | Even small pages benefit from skipping paint for off-screen content during scroll. |
Red Flags
- Using will-change on too many elements simultaneously
- Animating layout-triggering properties (width, height, top, left)
- Ignoring paint and composite costs when adding CSS transitions
- Not testing on throttled CPU or mobile devices
References
- Performance Checklist - CSS property cost table, layer promotion triggers, and optimization patterns.
See Also
ui-ux-optimize— UI/UX optimization with swarm agents
Voice & Context
- Default:
professional+blog - Reference:
voice-profilesskill for definitions and auto-detection.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

