svg-inline
What it does
This skill reviews SVG graphics written directly into HTML or components. It is for developers who want faster pages without losing the design.
When to use it
- āWhen a page contains large inline SVG drawings that make the HTML heavy.
- āWhen the same icon is copied into many places on a site.
- āWhen reviewing whether an SVG needs to be inline or could be a separate image file.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/svg-inline/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentās skills folder.
Example of what to ask your AI
āMy homepage is slow and the HTML is huge. Some of it is a big SVG logo pasted in directly. Can you check it?ā
5 new skills a week. 1 minute to read.
How it works
The agent measures each inline SVG, checks whether it repeats, and checks whether it needs to be inline at all. It then recommends smaller or external options.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Manage inline SVG size and complexity
A complex illustration exported from Figma can easily be 50-200KB of SVG markup. Inlined in HTML, it blocks the HTML parser until it is processed, cannot be cached independently, and balloons every page response. Extracting it to an external file allows browser caching and deferred loading. For icon systems, SVG sprites or component libraries avoid duplicating path data across every page.
Quick Reference
- Only inline SVG when you need CSS hover/animation on individual pathsāstatic SVGs belong in
<img>tags - Keep inline SVGs under 1KB (ideally under 500 bytes) after SVGO optimisation
- Reused icons should be SVG sprites or framework componentsānot copied inline multiple times
- Run all SVGs through SVGO before inlining to strip editor artefacts
Check
Scan HTML files and React/Vue components for inline <svg> elements. For each inline SVG: 1) Measure its character countāflag any over 1KB (approximately 1000 characters). 2) Check if it is reused in multiple places (should be a component or sprite). 3) Check if SVGO has been run (look for redundant attributes, inline styles that could be CSS classes, or editor comments). 4) Check if the SVG needs to be inline for CSS styling/animation, or if <img src="file.svg"> would suffice. Report each large inline SVG with its size and location.
Fix
For each problematic inline SVG: 1) Large, non-interactive SVG (e.g., illustration): extract to .svg file and reference with <img src="illustration.svg" alt="...">. 2) Reused icon: create an SVG sprite or React component. 3) SVG needing CSS interactivity (hover, animation): keep inline but run through SVGO firstāremove editor artefacts, merge paths, remove redundant attributes. 4) For React projects, use SVGR to import SVGs as componentsāthey tree-shake unused SVGs. 5) Show before/after size comparison.
Explain
Explain the trade-offs of inline SVG. Inline SVG allows CSS styling (fill, stroke) and JavaScript animation on individual paths, which external SVG files or <img> elements cannot support. However, large inline SVGs bloat the HTML, delay HTML parser completion, cannot be cached separately from the page, and duplicate markup when used in multiple places. The guidance is: use inline SVG only when you need CSS/JS interactivity; use <img src="file.svg"> or CSS background for static SVGs; use SVG sprites or React components for reused icons.
Code Review
Review image assets, markup, and delivery configuration related to Manage inline SVG size and complexity. Flag exact files or components where format choice, sizing, or loading behavior violates the rule, and describe how to confirm the fix in DevTools.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/images/svg-inline
FAQ
When is it fine to keep an SVG inline?
The skill says inline SVG is useful when you need CSS hover or animation on individual parts. Static graphics usually belong in image tags.
What size counts as too big?
The skill suggests keeping inline SVGs under about 1KB after optimization, and ideally under 500 bytes.
Does this skill delete the graphics?
No. It suggests moving them to external files or sprites, rather than removing them.
Details
Original description by the author
Use when reviewing image assets, markup, and CDN or build transforms related to Manage inline SVG size and complexity. Check encoded size, rendered size, loading strategy, and above-the-fold impact together.
Popularity
- GitHub stars
- 75k
- Ranking position
- #3042
- License
- MIT
- Updated
- 10/31/2026
Comments
- ā¦
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
angular-developer
280kHelps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
frontend-a11y
280kHelps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
frontend-patterns
280kHas your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.