rendering-content-visibility — Claude Code rule for deferred rendering
The rendering-content-visibility rule applies content-visibility: auto to long lists so off-screen items can wait before rendering. It fits message feeds and other scrollable collections.
no license ★ 1,064 updated 2026-01-21
.claude/rules/rendering-content-visibility.mdWhat rendering-content-visibility does
The rule describes a CSS technique for long lists: set content-visibility: auto on list items and provide a placeholder size with contain-intrinsic-size. The browser can defer layout and painting for items outside the visible area.
Its example uses messages inside a scrollable container. Each item gets an estimated height of 80px; if actual items differ substantially, that placeholder may need adjustment to match the list’s layout. For Claude Code, place the rule file at .claude/rules/rendering-content-visibility.md.
What it helps with
- defer rendering for items outside a long list’s viewport
- apply
content-visibility: autoto messages in a scrollable feed - set a placeholder size for items that have not been rendered
Example prompts for the agent
- Apply the rule to this long message feed and show the CSS changes.
- Update the scrollable list so off-screen items can be rendered later.
- Check how to size placeholders for list items using
content-visibility: auto.
How to install rendering-content-visibility
Manually: put the files in place
.claude/rules/rendering-content-visibility.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/rendering-content-visibility.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/rendering-content-visibility.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/rendering-content-visibility.mdManually: put the files in place
.clinerules/rendering-content-visibility.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about rendering-content-visibility
How do I install rendering-content-visibility in Claude Code?
Add the rule file at .claude/rules/rendering-content-visibility.md.
What does rendering-content-visibility do?
It describes using content-visibility: auto to defer rendering list items that are outside the viewport.
Why does the rule use contain-intrinsic-size?
It provides a placeholder size for items that have not been rendered yet. The example sets it to 0 80px for messages.