Foundations
Responsive design
Makes pages and components work from 320 CSS px phones to wide screens and at 400% zoom - viewport meta, fluid type and space, content breakpoints and container queries, no fixed wide boxes, dvh units, touch targets, no hover-only content, orientation and print. Use when building or fixing a layout for mobile, or asked "make this responsive", "it breaks on mobile", "it scrolls sideways".
fe-responsiveevery web project9 rules93 tokens always loaded, 1080 tokens when used, 1971 tokens in references on demand.
Install
init installs this skill when the project uses every web project. Pick your agent to see where its files land.
npx github:dawidolko/frontend-skills init Not tested yet with this runner. npx and pnpm dlx are tested; if this one fails, use one of them.
Without --agents, init finds the agents from what the project already has, and asks when it finds none:
How init finds each of the 17 agents
| Agent | Found by |
|---|---|
| Claude Code | CLAUDE.md .claude CLAUDE.local.md |
| OpenAI Codex | .codex AGENTS.override.md |
| Cursor | .cursor .cursorrules |
| GitHub Copilot | .github/copilot-instructions.md .github/instructions .github/skills .github/prompts |
| Gemini CLI | GEMINI.md .gemini |
| Antigravity CLI | .agents/rules .agent/rules |
| Devin / Windsurf | .devin .windsurf .windsurfrules |
| OpenCode | opencode.json opencode.jsonc .opencode |
| Cline | .clinerules .cline |
| Zed | .rules .zed |
| JetBrains Junie | .junie |
| Kiro | .kiro |
| Augment | .augment .augment-guidelines |
| Trae | .trae |
| Continue | .continue |
| Amazon Q Developer | .amazonq |
| Aider | .aider.conf.yml CONVENTIONS.md |
Where fe-responsive lands for Claude Code
.claude/skills/fe-responsive/SKILL.mdskill.claude/skills/fe-responsive/references/responsive.mdskill.claude/rules/fe-responsive.mdrule fileCLAUDE.mdinstruction block
For every agent also: .frontend-skills/profile.json, .frontend-skills/lessons.md and .frontend-skills/install.json.
Planned by the installer itself for the example React project in the repository.
---
paths:
- "**/*.html"
- "**/*.css"
- "**/*.scss"
- "**/*.less"
- "**/*.jsx"
- "**/*.tsx"
- "**/*.vue"
- "**/*.svelte"
- "**/*.astro"
---
# Responsive design (frontend-skills)
Makes pages and components work from 320 CSS px phones to wide screens and at 400% zoom - viewport meta, fluid type and space, content breakpoints and container queries, no fixed wide boxes, dvh units, touch targets, no hover-only content, orientation and print. Use when building or fixing a layout for mobile, or asked "make this responsive", "it breaks on mobile", "it scrolls sideways".
- Every document has `<meta name="viewport" content="width=device-width, initial-scale=1">` (responsive/viewport-meta).
- Never block zoom: no `user-scalable=no`, no `maximum-scale` below 2 (a11y/zoom-not-blocked).
- Write the narrow layout first and widen it with `min-width` queries placed where the content breaks, in `em`, not device widths.
- Components react to their slot with `@container`; media queries are for page regions.
- No box wider than 320 CSS px without a cap: `max-width` or `min(100%, …)` (responsive/no-fixed-wide-width).
- Fluid type mixes `rem` into the formula, `clamp(1rem, 0.9rem + 1vw, 1.5rem)`, never viewport units alone (responsive/no-viewport-font-size).
- Font sizes in `rem` (the project's helper when it has one) (css/rem-units).
- Full-height sections use `min-height: 100svh` or `100dvh`, not `100vh` (responsive/dynamic-viewport-units).
- Pointer targets are at least 24×24 CSS px, primary touch controls about 44×44.
- Nothing is revealed on hover alone: show it on `:focus-within` and make it reachable on touch (responsive/no-hover-only).
- The page reads at 320 CSS px and 400% zoom without sideways scrolling, in both orientations (responsive/reflow, responsive/orientation).
Before larger changes, read the full skill: `.claude/skills/fe-responsive/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Where fe-responsive lands for OpenAI Codex
.agents/skills/fe-responsive/SKILL.mdskill.agents/skills/fe-responsive/references/responsive.mdskillAGENTS.mdinstruction block
For every agent also: .frontend-skills/profile.json, .frontend-skills/lessons.md and .frontend-skills/install.json.
OpenAI Codex has no rule files scoped to file types; it reads the skills and the instruction block.
Planned by the installer itself for the example React project in the repository.
## Front-end work (frontend-skills)
- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.Where fe-responsive lands for Cursor
.agents/skills/fe-responsive/SKILL.mdskill.agents/skills/fe-responsive/references/responsive.mdskill.cursor/rules/fe-responsive.mdcrule fileAGENTS.mdinstruction block
For every agent also: .frontend-skills/profile.json, .frontend-skills/lessons.md and .frontend-skills/install.json.
Planned by the installer itself for the example React project in the repository.
---
description: Makes pages and components work from 320 CSS px phones to wide screens and at 400% zoom - viewport meta, fluid type and space, content breakpoints and container queries, no fixed wide boxes, dvh units, touch targets, no hover-only content, orientation and print. Use when building or fixing a layout for mobile, or asked "make this responsive", "it breaks on mobile", "it scrolls sideways".
globs: **/*.html, **/*.css, **/*.scss, **/*.less, **/*.jsx, **/*.tsx, **/*.vue, **/*.svelte, **/*.astro
alwaysApply: false
---
# Responsive design (frontend-skills)
- Every document has `<meta name="viewport" content="width=device-width, initial-scale=1">` (responsive/viewport-meta).
- Never block zoom: no `user-scalable=no`, no `maximum-scale` below 2 (a11y/zoom-not-blocked).
- Write the narrow layout first and widen it with `min-width` queries placed where the content breaks, in `em`, not device widths.
- Components react to their slot with `@container`; media queries are for page regions.
- No box wider than 320 CSS px without a cap: `max-width` or `min(100%, …)` (responsive/no-fixed-wide-width).
- Fluid type mixes `rem` into the formula, `clamp(1rem, 0.9rem + 1vw, 1.5rem)`, never viewport units alone (responsive/no-viewport-font-size).
- Font sizes in `rem` (the project's helper when it has one) (css/rem-units).
- Full-height sections use `min-height: 100svh` or `100dvh`, not `100vh` (responsive/dynamic-viewport-units).
- Pointer targets are at least 24×24 CSS px, primary touch controls about 44×44.
- Nothing is revealed on hover alone: show it on `:focus-within` and make it reachable on touch (responsive/no-hover-only).
- The page reads at 320 CSS px and 400% zoom without sideways scrolling, in both orientations (responsive/reflow, responsive/orientation).
Before larger changes, read the full skill: `.agents/skills/fe-responsive/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Where fe-responsive lands for GitHub Copilot
.agents/skills/fe-responsive/SKILL.mdskill.agents/skills/fe-responsive/references/responsive.mdskill.github/instructions/fe-responsive.instructions.mdrule fileAGENTS.mdinstruction block
For every agent also: .frontend-skills/profile.json, .frontend-skills/lessons.md and .frontend-skills/install.json.
Planned by the installer itself for the example React project in the repository.
---
applyTo: "**/*.html,**/*.css,**/*.scss,**/*.less,**/*.jsx,**/*.tsx,**/*.vue,**/*.svelte,**/*.astro"
description: "Makes pages and components work from 320 CSS px phones to wide screens and at 400% zoom - viewport meta, fluid type and space, content breakpoints and container queries, no fixed wide boxes, dvh units, touch targets, no hover-only content, orientation and print. Use when building or fixing a layout for mobile, or asked \"make this responsive\", \"it breaks on mobile\", \"it scrolls sideways\"."
---
# Responsive design (frontend-skills)
- Every document has `<meta name="viewport" content="width=device-width, initial-scale=1">` (responsive/viewport-meta).
- Never block zoom: no `user-scalable=no`, no `maximum-scale` below 2 (a11y/zoom-not-blocked).
- Write the narrow layout first and widen it with `min-width` queries placed where the content breaks, in `em`, not device widths.
- Components react to their slot with `@container`; media queries are for page regions.
- No box wider than 320 CSS px without a cap: `max-width` or `min(100%, …)` (responsive/no-fixed-wide-width).
- Fluid type mixes `rem` into the formula, `clamp(1rem, 0.9rem + 1vw, 1.5rem)`, never viewport units alone (responsive/no-viewport-font-size).
- Font sizes in `rem` (the project's helper when it has one) (css/rem-units).
- Full-height sections use `min-height: 100svh` or `100dvh`, not `100vh` (responsive/dynamic-viewport-units).
- Pointer targets are at least 24×24 CSS px, primary touch controls about 44×44.
- Nothing is revealed on hover alone: show it on `:focus-within` and make it reachable on touch (responsive/no-hover-only).
- The page reads at 320 CSS px and 400% zoom without sideways scrolling, in both orientations (responsive/reflow, responsive/orientation).
Before larger changes, read the full skill: `.agents/skills/fe-responsive/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Where fe-responsive lands for Gemini CLI
.agents/skills/fe-responsive/SKILL.mdskill.agents/skills/fe-responsive/references/responsive.mdskillGEMINI.mdinstruction block
For every agent also: .frontend-skills/profile.json, .frontend-skills/lessons.md and .frontend-skills/install.json.
Gemini CLI: Gemini CLI was replaced by Antigravity CLI for unpaid tiers on 2026-06-18; choose "antigravity" too if you use it.
Gemini CLI has no rule files scoped to file types; it reads the skills and the instruction block.
Planned by the installer itself for the example React project in the repository.
## Front-end work (frontend-skills)
- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.Where fe-responsive lands for Antigravity CLI
.agents/skills/fe-responsive/SKILL.mdskill.agents/skills/fe-responsive/references/responsive.mdskill.agents/rules/fe-responsive.mdrule fileAGENTS.mdinstruction block
For every agent also: .frontend-skills/profile.json, .frontend-skills/lessons.md and .frontend-skills/install.json.
Planned by the installer itself for the example React project in the repository.
---
trigger: glob
globs: "**/*.html, **/*.css, **/*.scss, **/*.less, **/*.jsx, **/*.tsx, **/*.vue, **/*.svelte, **/*.astro"
description: "Makes pages and components work from 320 CSS px phones to wide screens and at 400% zoom - viewport meta, fluid type and space, content breakpoints and container queries, no fixed wide boxes, dvh units, touch targets, no hover-only content, orientation and print. Use when building or fixing a layout for mobile, or asked \"make this responsive\", \"it breaks on mobile\", \"it scrolls sideways\"."
---
# Responsive design (frontend-skills)
- Every document has `<meta name="viewport" content="width=device-width, initial-scale=1">` (responsive/viewport-meta).
- Never block zoom: no `user-scalable=no`, no `maximum-scale` below 2 (a11y/zoom-not-blocked).
- Write the narrow layout first and widen it with `min-width` queries placed where the content breaks, in `em`, not device widths.
- Components react to their slot with `@container`; media queries are for page regions.
- No box wider than 320 CSS px without a cap: `max-width` or `min(100%, …)` (responsive/no-fixed-wide-width).
- Fluid type mixes `rem` into the formula, `clamp(1rem, 0.9rem + 1vw, 1.5rem)`, never viewport units alone (responsive/no-viewport-font-size).
- Font sizes in `rem` (the project's helper when it has one) (css/rem-units).
- Full-height sections use `min-height: 100svh` or `100dvh`, not `100vh` (responsive/dynamic-viewport-units).
- Pointer targets are at least 24×24 CSS px, primary touch controls about 44×44.
- Nothing is revealed on hover alone: show it on `:focus-within` and make it reachable on touch (responsive/no-hover-only).
- The page reads at 320 CSS px and 400% zoom without sideways scrolling, in both orientations (responsive/reflow, responsive/orientation).
Before larger changes, read the full skill: `.agents/skills/fe-responsive/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Where fe-responsive lands for Devin / Windsurf
.agents/skills/fe-responsive/SKILL.mdskill.agents/skills/fe-responsive/references/responsive.mdskill.devin/rules/fe-responsive.mdrule fileAGENTS.mdinstruction block
For every agent also: .frontend-skills/profile.json, .frontend-skills/lessons.md and .frontend-skills/install.json.
Devin / Windsurf: Devin CLI also reads .cursor/rules; with Cursor chosen too, the CLI sees both rule files of a skill.
Planned by the installer itself for the example React project in the repository.
---
trigger: glob
globs: "**/*.html,**/*.css,**/*.scss,**/*.less,**/*.jsx,**/*.tsx,**/*.vue,**/*.svelte,**/*.astro"
---
# Responsive design (frontend-skills)
Makes pages and components work from 320 CSS px phones to wide screens and at 400% zoom - viewport meta, fluid type and space, content breakpoints and container queries, no fixed wide boxes, dvh units, touch targets, no hover-only content, orientation and print. Use when building or fixing a layout for mobile, or asked "make this responsive", "it breaks on mobile", "it scrolls sideways".
- Every document has `<meta name="viewport" content="width=device-width, initial-scale=1">` (responsive/viewport-meta).
- Never block zoom: no `user-scalable=no`, no `maximum-scale` below 2 (a11y/zoom-not-blocked).
- Write the narrow layout first and widen it with `min-width` queries placed where the content breaks, in `em`, not device widths.
- Components react to their slot with `@container`; media queries are for page regions.
- No box wider than 320 CSS px without a cap: `max-width` or `min(100%, …)` (responsive/no-fixed-wide-width).
- Fluid type mixes `rem` into the formula, `clamp(1rem, 0.9rem + 1vw, 1.5rem)`, never viewport units alone (responsive/no-viewport-font-size).
- Font sizes in `rem` (the project's helper when it has one) (css/rem-units).
- Full-height sections use `min-height: 100svh` or `100dvh`, not `100vh` (responsive/dynamic-viewport-units).
- Pointer targets are at least 24×24 CSS px, primary touch controls about 44×44.
- Nothing is revealed on hover alone: show it on `:focus-within` and make it reachable on touch (responsive/no-hover-only).
- The page reads at 320 CSS px and 400% zoom without sideways scrolling, in both orientations (responsive/reflow, responsive/orientation).
Before larger changes, read the full skill: `.agents/skills/fe-responsive/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Where fe-responsive lands for OpenCode
.agents/skills/fe-responsive/SKILL.mdskill.agents/skills/fe-responsive/references/responsive.mdskillAGENTS.mdinstruction block
For every agent also: .frontend-skills/profile.json, .frontend-skills/lessons.md and .frontend-skills/install.json.
OpenCode has no rule files scoped to file types; it reads the skills and the instruction block.
Planned by the installer itself for the example React project in the repository.
## Front-end work (frontend-skills)
- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.Where fe-responsive lands for Cline
.claude/skills/fe-responsive/SKILL.mdskill.claude/skills/fe-responsive/references/responsive.mdskill.clinerules/fe-responsive.mdrule fileAGENTS.mdinstruction block
For every agent also: .frontend-skills/profile.json, .frontend-skills/lessons.md and .frontend-skills/install.json.
Cline: If .clinerules is a single file rather than a folder, Cline rule files are not written; skills still are.
Planned by the installer itself for the example React project in the repository.
---
paths:
- "**/*.html"
- "**/*.css"
- "**/*.scss"
- "**/*.less"
- "**/*.jsx"
- "**/*.tsx"
- "**/*.vue"
- "**/*.svelte"
- "**/*.astro"
---
# Responsive design (frontend-skills)
Makes pages and components work from 320 CSS px phones to wide screens and at 400% zoom - viewport meta, fluid type and space, content breakpoints and container queries, no fixed wide boxes, dvh units, touch targets, no hover-only content, orientation and print. Use when building or fixing a layout for mobile, or asked "make this responsive", "it breaks on mobile", "it scrolls sideways".
- Every document has `<meta name="viewport" content="width=device-width, initial-scale=1">` (responsive/viewport-meta).
- Never block zoom: no `user-scalable=no`, no `maximum-scale` below 2 (a11y/zoom-not-blocked).
- Write the narrow layout first and widen it with `min-width` queries placed where the content breaks, in `em`, not device widths.
- Components react to their slot with `@container`; media queries are for page regions.
- No box wider than 320 CSS px without a cap: `max-width` or `min(100%, …)` (responsive/no-fixed-wide-width).
- Fluid type mixes `rem` into the formula, `clamp(1rem, 0.9rem + 1vw, 1.5rem)`, never viewport units alone (responsive/no-viewport-font-size).
- Font sizes in `rem` (the project's helper when it has one) (css/rem-units).
- Full-height sections use `min-height: 100svh` or `100dvh`, not `100vh` (responsive/dynamic-viewport-units).
- Pointer targets are at least 24×24 CSS px, primary touch controls about 44×44.
- Nothing is revealed on hover alone: show it on `:focus-within` and make it reachable on touch (responsive/no-hover-only).
- The page reads at 320 CSS px and 400% zoom without sideways scrolling, in both orientations (responsive/reflow, responsive/orientation).
Before larger changes, read the full skill: `.claude/skills/fe-responsive/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Where fe-responsive lands for Zed
.agents/skills/fe-responsive/SKILL.mdskill.agents/skills/fe-responsive/references/responsive.mdskillCLAUDE.mdinstruction block
For every agent also: .frontend-skills/profile.json, .frontend-skills/lessons.md and .frontend-skills/install.json.
Zed: Zed reads only the first instruction file of its list; the block is placed in that file.
Zed has no rule files scoped to file types; it reads the skills and the instruction block.
Planned by the installer itself for the example React project in the repository.
## Front-end work (frontend-skills)
- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.Where fe-responsive lands for JetBrains Junie
.agents/skills/fe-responsive/SKILL.mdskill.agents/skills/fe-responsive/references/responsive.mdskillAGENTS.mdinstruction block
For every agent also: .frontend-skills/profile.json, .frontend-skills/lessons.md and .frontend-skills/install.json.
JetBrains Junie: Junie reads .agents/skills only in a trusted project.
JetBrains Junie has no rule files scoped to file types; it reads the skills and the instruction block.
Planned by the installer itself for the example React project in the repository.
## Front-end work (frontend-skills)
- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.Where fe-responsive lands for Kiro
.kiro/skills/fe-responsive/SKILL.mdskill.kiro/skills/fe-responsive/references/responsive.mdskill.kiro/steering/fe-responsive.mdrule fileAGENTS.mdinstruction block
For every agent also: .frontend-skills/profile.json, .frontend-skills/lessons.md and .frontend-skills/install.json.
Planned by the installer itself for the example React project in the repository.
---
inclusion: fileMatch
fileMatchPattern: ["**/*.html", "**/*.css", "**/*.scss", "**/*.less", "**/*.jsx", "**/*.tsx", "**/*.vue", "**/*.svelte", "**/*.astro"]
---
# Responsive design (frontend-skills)
Makes pages and components work from 320 CSS px phones to wide screens and at 400% zoom - viewport meta, fluid type and space, content breakpoints and container queries, no fixed wide boxes, dvh units, touch targets, no hover-only content, orientation and print. Use when building or fixing a layout for mobile, or asked "make this responsive", "it breaks on mobile", "it scrolls sideways".
- Every document has `<meta name="viewport" content="width=device-width, initial-scale=1">` (responsive/viewport-meta).
- Never block zoom: no `user-scalable=no`, no `maximum-scale` below 2 (a11y/zoom-not-blocked).
- Write the narrow layout first and widen it with `min-width` queries placed where the content breaks, in `em`, not device widths.
- Components react to their slot with `@container`; media queries are for page regions.
- No box wider than 320 CSS px without a cap: `max-width` or `min(100%, …)` (responsive/no-fixed-wide-width).
- Fluid type mixes `rem` into the formula, `clamp(1rem, 0.9rem + 1vw, 1.5rem)`, never viewport units alone (responsive/no-viewport-font-size).
- Font sizes in `rem` (the project's helper when it has one) (css/rem-units).
- Full-height sections use `min-height: 100svh` or `100dvh`, not `100vh` (responsive/dynamic-viewport-units).
- Pointer targets are at least 24×24 CSS px, primary touch controls about 44×44.
- Nothing is revealed on hover alone: show it on `:focus-within` and make it reachable on touch (responsive/no-hover-only).
- The page reads at 320 CSS px and 400% zoom without sideways scrolling, in both orientations (responsive/reflow, responsive/orientation).
Before larger changes, read the full skill: `.kiro/skills/fe-responsive/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Where fe-responsive lands for Augment
.agents/skills/fe-responsive/SKILL.mdskill.agents/skills/fe-responsive/references/responsive.mdskillAGENTS.mdinstruction block
For every agent also: .frontend-skills/profile.json, .frontend-skills/lessons.md and .frontend-skills/install.json.
Augment has no rule files scoped to file types; it reads the skills and the instruction block.
Planned by the installer itself for the example React project in the repository.
## Front-end work (frontend-skills)
- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.Where fe-responsive lands for Trae
.trae/skills/fe-responsive/SKILL.mdskill.trae/skills/fe-responsive/references/responsive.mdskill.trae/rules/fe-responsive.mdrule fileAGENTS.mdinstruction block
For every agent also: .frontend-skills/profile.json, .frontend-skills/lessons.md and .frontend-skills/install.json.
Trae: Trae reads AGENTS.md only after it is enabled in its settings.
Planned by the installer itself for the example React project in the repository.
---
description: "Makes pages and components work from 320 CSS px phones to wide screens and at 400% zoom - viewport meta, fluid type and space, content breakpoints and container queries, no fixed wide boxes, dvh units, touch targets, no hover-only content, orientation and print. Use when building or fixing a layout for mobile, or asked \"make this responsive\", \"it breaks on mobile\", \"it scrolls sideways\"."
globs: **/*.html,**/*.css,**/*.scss,**/*.less,**/*.jsx,**/*.tsx,**/*.vue,**/*.svelte,**/*.astro
alwaysApply: false
---
# Responsive design (frontend-skills)
- Every document has `<meta name="viewport" content="width=device-width, initial-scale=1">` (responsive/viewport-meta).
- Never block zoom: no `user-scalable=no`, no `maximum-scale` below 2 (a11y/zoom-not-blocked).
- Write the narrow layout first and widen it with `min-width` queries placed where the content breaks, in `em`, not device widths.
- Components react to their slot with `@container`; media queries are for page regions.
- No box wider than 320 CSS px without a cap: `max-width` or `min(100%, …)` (responsive/no-fixed-wide-width).
- Fluid type mixes `rem` into the formula, `clamp(1rem, 0.9rem + 1vw, 1.5rem)`, never viewport units alone (responsive/no-viewport-font-size).
- Font sizes in `rem` (the project's helper when it has one) (css/rem-units).
- Full-height sections use `min-height: 100svh` or `100dvh`, not `100vh` (responsive/dynamic-viewport-units).
- Pointer targets are at least 24×24 CSS px, primary touch controls about 44×44.
- Nothing is revealed on hover alone: show it on `:focus-within` and make it reachable on touch (responsive/no-hover-only).
- The page reads at 320 CSS px and 400% zoom without sideways scrolling, in both orientations (responsive/reflow, responsive/orientation).
Before larger changes, read the full skill: `.trae/skills/fe-responsive/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Where fe-responsive lands for Continue
.frontend-skills/skills/fe-responsive/SKILL.mdskill.frontend-skills/skills/fe-responsive/references/responsive.mdskill.continue/rules/fe-responsive.mdrule file
For every agent also: .frontend-skills/profile.json, .frontend-skills/lessons.md and .frontend-skills/install.json.
Planned by the installer itself for the example React project in the repository.
---
name: "Responsive design"
description: "Makes pages and components work from 320 CSS px phones to wide screens and at 400% zoom - viewport meta, fluid type and space, content breakpoints and container queries, no fixed wide boxes, dvh units, touch targets, no hover-only content, orientation and print. Use when building or fixing a layout for mobile, or asked \"make this responsive\", \"it breaks on mobile\", \"it scrolls sideways\"."
globs: ["**/*.html", "**/*.css", "**/*.scss", "**/*.less", "**/*.jsx", "**/*.tsx", "**/*.vue", "**/*.svelte", "**/*.astro"]
alwaysApply: false
---
# Responsive design (frontend-skills)
- Every document has `<meta name="viewport" content="width=device-width, initial-scale=1">` (responsive/viewport-meta).
- Never block zoom: no `user-scalable=no`, no `maximum-scale` below 2 (a11y/zoom-not-blocked).
- Write the narrow layout first and widen it with `min-width` queries placed where the content breaks, in `em`, not device widths.
- Components react to their slot with `@container`; media queries are for page regions.
- No box wider than 320 CSS px without a cap: `max-width` or `min(100%, …)` (responsive/no-fixed-wide-width).
- Fluid type mixes `rem` into the formula, `clamp(1rem, 0.9rem + 1vw, 1.5rem)`, never viewport units alone (responsive/no-viewport-font-size).
- Font sizes in `rem` (the project's helper when it has one) (css/rem-units).
- Full-height sections use `min-height: 100svh` or `100dvh`, not `100vh` (responsive/dynamic-viewport-units).
- Pointer targets are at least 24×24 CSS px, primary touch controls about 44×44.
- Nothing is revealed on hover alone: show it on `:focus-within` and make it reachable on touch (responsive/no-hover-only).
- The page reads at 320 CSS px and 400% zoom without sideways scrolling, in both orientations (responsive/reflow, responsive/orientation).
Before larger changes, read the full skill: `.frontend-skills/skills/fe-responsive/SKILL.md`. Explain any rule id with `npx github:dawidolko/frontend-skills explain <id>`.Where fe-responsive lands for Amazon Q Developer
.frontend-skills/skills/fe-responsive/SKILL.mdskill.frontend-skills/skills/fe-responsive/references/responsive.mdskill.amazonq/rules/frontend-skills.mdinstruction block
For every agent also: .frontend-skills/profile.json, .frontend-skills/lessons.md and .frontend-skills/install.json.
Amazon Q Developer: Amazon Q Developer IDE plugins reach end of support on 2027-04-30; AWS points to Kiro.
Amazon Q Developer has no rule files scoped to file types; it reads the skills and the instruction block.
Planned by the installer itself for the example React project in the repository.
## Front-end work (frontend-skills)
- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.
### Skills
- `fe-responsive` (Responsive design): when editing `**/*.html`, `**/*.css`, `**/*.scss`, `**/*.less`, `**/*.jsx`, `**/*.tsx`, `**/*.vue`, `**/*.svelte`, `**/*.astro`, first read `.frontend-skills/skills/fe-responsive/SKILL.md`.Where fe-responsive lands for Aider
.frontend-skills/skills/fe-responsive/SKILL.mdskill.frontend-skills/skills/fe-responsive/references/responsive.mdskillCONVENTIONS.mdinstruction block.aider.conf.ymlconfig
For every agent also: .frontend-skills/profile.json, .frontend-skills/lessons.md and .frontend-skills/install.json.
Aider has no rule files scoped to file types; it reads the skills and the instruction block.
Planned by the installer itself for the example React project in the repository.
## Front-end work (frontend-skills)
- Before front-end work, read `.frontend-skills/profile.json` (the stack) and `.frontend-skills/lessons.md` (confirmed conventions of this project; they win over any skill).
- Use the installed `fe-*` skill that matches the files you edit.
- After changing UI code, run `npx github:dawidolko/frontend-skills audit --changed --json` and fix findings at `serious` and above; `explain <rule id>` gives the reason, the source and the fix.
- Name rule ids (such as `a11y/img-alt`) in reviews and commit messages.
### Skills
- `fe-responsive` (Responsive design): when editing `**/*.html`, `**/*.css`, `**/*.scss`, `**/*.less`, `**/*.jsx`, `**/*.tsx`, `**/*.vue`, `**/*.svelte`, `**/*.astro`, first read `.frontend-skills/skills/fe-responsive/SKILL.md`.How to use it
Once installed, the agent loads the skill by itself when a task matches its description. You can also ask for it in your own words, for example:
Phrases from the skill description that make the agent pick it:
- make this responsive
- it breaks on mobile
- it scrolls sideways
And to check and fix the work:
- Use the fe-responsive skill on this file.
- Run the front-end audit on what I changed and fix everything serious.
- Explain responsive/viewport-meta and fix it here.
Rules it teaches
responsive/viewport-metaEvery HTML document has <meta name="viewport" content="width=device-width, initial-scale=1">.
a11y/zoom-not-blockedThe viewport never disables zoom (no user-scalable=no, no maximum-scale below 2).
responsive/dynamic-viewport-unitsA full-height layout uses 100dvh (or svh) instead of 100vh, which is taller than the visible area on mobile.
responsive/no-viewport-font-sizeText is never sized with viewport units alone (font-size 5vw); fluid type mixes in rem, as in clamp(1rem, 0.9rem + 1vw, 1.5rem).
responsive/no-fixed-wide-widthNo layout box gets a fixed width wider than 320 CSS px; cap it with max-width or min(100%, …) so the page reflows on narrow screens.
responsive/no-hover-onlyNothing is revealed on hover alone; content and controls shown on hover also show on keyboard focus and are reachable on touch.
responsive/reflowThe page reads without sideways scrolling at 320 CSS px and 400% zoom; only tables, maps and similar may scroll both ways.
responsive/orientationThe page works in portrait and landscape; it never locks the orientation or asks people to rotate unless one orientation is essential.
css/rem-unitsFont sizes are written in rem (or em), never px, in projects without a rem helper; with one, css/rem-helper applies.
The rule digest
This part is copied into each agent's scoped rule file, so it stands on its own:
- Every document has
<meta name="viewport" content="width=device-width, initial-scale=1">(responsive/viewport-meta). - Never block zoom: no
user-scalable=no, nomaximum-scalebelow 2 (a11y/zoom-not-blocked). - Write the narrow layout first and widen it with
min-widthqueries placed where the content breaks, inem, not device widths. - Components react to their slot with
@container; media queries are for page regions. - No box wider than 320 CSS px without a cap:
max-widthormin(100%, …)(responsive/no-fixed-wide-width). - Fluid type mixes
reminto the formula,clamp(1rem, 0.9rem + 1vw, 1.5rem), never viewport units alone (responsive/no-viewport-font-size). - Font sizes in
rem(the project's helper when it has one) (css/rem-units). - Full-height sections use
min-height: 100svhor100dvh, not100vh(responsive/dynamic-viewport-units). - Pointer targets are at least 24×24 CSS px, primary touch controls about 44×44.
- Nothing is revealed on hover alone: show it on
:focus-withinand make it reachable on touch (responsive/no-hover-only). - The page reads at 320 CSS px and 400% zoom without sideways scrolling, in both orientations (responsive/reflow, responsive/orientation).
Steps the agent follows
- Fix the document shell once (root layout,
index.html,app.html): viewport meta, no zoom block. Frameworks such as Next.js add a viewport tag; check the rendered HTML. - Set base styles for the narrowest screen; add
@media (width >= 48em)steps only where the content needs them, and@containerfor components. - Make media fluid:
img, video, iframe { max-width: 100%; height: auto; },aspect-ratiofor embeds, wide tables in a scrolling wrapper. - Size type and space with
remandclamp(); give long stringsoverflow-wrap: anywhere. - Give touch targets padding rather than larger icons; enlarge under
(any-pointer: coarse), never shrink underfine. - Add
@media printfor content people print: hide navigation, show link URLs where useful.
How the agent checks the work
npx github:dawidolko/frontend-skills audit --changedreports a missing or wrong viewport, blocked zoom,100vh, viewport-only font sizes, fixed wide boxes and hover-only content.audit --url <page>adds Lighthouse and axe results (meta-viewport,target-size).- By hand: DevTools device mode at 320×640 and 640×320, browser zoom 200% and 400%, Tab through every control, try the menu on a touch device.
Checked by the audit
The static checks of these rules run in audit; this is a real session on the example project:
audit: counts by severity, each rule with its first location, the exit code.Reference files
references/responsive.md1971 tokens