Skip to main content
CSS-Tricks
  • Articles
  • Alamanac
  • Guides
  • Videos
  • Books
  • Newsletter
Search

Articles Tagged
svg icons

27 Articles
{
,

}
Direct link to the article Change Color of SVG on Hover
SVG svg filters svg icons

Change Color of SVG on Hover

There are a lot of different ways to use SVG. Depending on which way, the tactic for recoloring that SVG in different states or conditions — :hover, :active, :focus, class name change, etc. — is different. …

Avatar of Chris Coyier
Chris Coyier on May 13, 2019
Direct link to the article Inline SVG… Cached
cache service workers svg icons

Inline SVG… Cached

I wrote that using inline <svg icons make for the best icon system. I still think that’s true. It’s the easiest possible way to drop an icon onto a page. No network request, perfectly styleable.

But inlining code has …

Avatar of Chris Coyier
Chris Coyier on Apr 12, 2019 (Updated on Oct 28, 2020)
Direct link to the article Making SVG icon libraries for React apps
react SVG svg icons

Making SVG icon libraries for React apps

Nicolas Gallagher:

At Twitter I used the approach described here to publish the company’s SVG icon library in several different formats: optimized SVGs, plain JavaScript modules, React DOM components, and React Native components.

There is no One True Way©…

Avatar of Chris Coyier
Chris Coyier on Dec 14, 2018
Direct link to the article Accessible SVG Icons With Inline Sprites
icon system icons SVG svg icons

Accessible SVG Icons With Inline Sprites

This is a great look at accessible SVG markup patterns by Marco Hengstenberg. Here’s the ideal example:

<button type="button">
  Menu
  <svg class="svg-icon"
     role="img"
     height="10"
     width="10"
     viewBox="0 0 10 10"
     aria-hidden="true"
     focusable="false">
     <path d="m1 7h8v2h-8zm0-3h8v2h-8zm0-3h8v2h-8z"></path>
    </svg>
</button>
…
Avatar of Chris Coyier
Chris Coyier on Dec 7, 2018
Direct link to the article Solved with CSS! Colorizing SVG Backgrounds
filter svg filters svg icons

Solved with CSS! Colorizing SVG Backgrounds

This post is the first in a series about the power of CSS.

Article Series:

  1. Colorizing SVG Backgrounds (this post)
  2. Dropdown Menus
  3. Logical Styling Based On the Number of Given Elements

CSS is getting increasingly powerful, and with features like …

Avatar of Una Kravets
Una Kravets on Mar 30, 2018 (Updated on Apr 15, 2020)
Direct link to the article Discover The Fatwigoo
SVG svg icons

Discover The Fatwigoo

When you use a bit of inline <svg> and you don’t set height and width, but you do set a viewBox, that’s a fitwigoo. I love the name.

The problem with fatwigoo’s is that the <svg> will …

Avatar of Chris Coyier
Chris Coyier on Nov 12, 2017
Direct link to the article If You’re Inlining SVG Icons, How Do You Deal With Unique Titles and IDs?
SVG svg icons

If You’re Inlining SVG Icons, How Do You Deal With Unique Titles and IDs?

Just inlining SVG seems to be the easiest and most flexible icon system. But that chunk of <svg></svg> might have a <title></title>, and you might be appying IDs to both of those elements for various reasons.…

Avatar of Chris Coyier
Chris Coyier on Jul 7, 2017
Direct link to the article Papercons
react sketch SVG svg icons

Papercons

Bobby Grace, on the Dropbox Paper team:

On the engineering side, we use inline SVGs. These have many advantages. One advantage is that SVG is a well-structured format that we can manipulate with code. Paper is also using React and

…
Avatar of Chris Coyier
Chris Coyier on Apr 11, 2017
Direct link to the article Preparing and Exporting SVG Icons in Sketch
sketch svg icons

Preparing and Exporting SVG Icons in Sketch

There is an interesting gotcha about the fill-rule attribute of SVG, detailed here by Anthony Collurafici.

Fill-Rule is an SVG property that basically defines how to determine what shapes are filled or subtracted from the shape. The default SVG value

…
Avatar of Chris Coyier
Chris Coyier on Feb 11, 2017
Direct link to the article The Road to SVG and Custom Elements in Clarity Icons
SVG svg icons

The Road to SVG and Custom Elements in Clarity Icons

Another day, another design system deciding an SVG icon system is the way to go.

Everybody has their own set of considerations when making a choice like this. Scott Mathis documents the major considerations for Clarity: Opting-out, sizing, multi-colors, interactivity, …

Avatar of Chris Coyier
Chris Coyier on Jan 10, 2017
Direct link to the article Etsy’s Evolving Icon System
icons SVG svg icons

Etsy’s Evolving Icon System

Etsy moves away from an icon font in production to using SVG. It’s going to be an inline <svg> system, but abstracted as a <etsy-icon> custom element for ease of use.

Two cents:

  • I could see the need for that
…
Avatar of Chris Coyier
Chris Coyier on Jan 9, 2017
  • Newer
  • 1
  • 2
  • 3
  • Older

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

DigitalOcean
  • About DO
  • Cloudways hosting
  • Legal stuff
  • Get free credit!
CSS-Tricks
  • Write for us!
  • Advertise with us
  • Contact us
Social
  • RSS Feeds
  • CodePen
  • Mastodon
  • X
Back to Top