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

Articles Tagged
SVG

206 Articles
{
,

}
Direct link to the article 6 Common SVG Fails (and How to Fix Them)
SVG

6 Common SVG Fails (and How to Fix Them)

Someone recently asked me how I approach debugging inline SVGs. Because it is part of the DOM, we can inspect any inline SVG in any browser DevTools. And because of that, we have the ability to scope things out and …

Avatar of Mariana Beldi
Mariana Beldi on Jan 17, 2023
Direct link to the article How I Made an Icon System Out of CSS Custom Properties
custom properties Sass SVG svg icons

How I Made an Icon System Out of CSS Custom Properties

SVG is the best format for icons on a website, there is no doubt about that. It allows you to have sharp icons no matter the screen pixel density, you can change the styles of the SVG on hover …

Avatar of Louis Hoebregts
Louis Hoebregts on Sep 22, 2022 (Updated on Sep 28, 2022)
Direct link to the article How stroke-dasharray Patterns Work
patterns stroke-dasharray SVG

How stroke-dasharray Patterns Work

Say you have a line in SVG:

<svg<line x1="0" y1="30" x2="500" y2="30" stroke-color="#f8a100" /</svg

You can use the stroke-dasharray property in CSS to make dashes:

line {
  stroke-dasharray: 5;
}

That 5 value is a relative unit based …

Avatar of Geoff Graham
Geoff Graham on Jul 15, 2022
Direct link to the article Mastering SVG’s stroke-miterlimit Attribute
figma illustrator stroke-linejoin stroke-miterlimit SVG

Mastering SVG’s stroke-miterlimit Attribute

So, SVG has this stroke-miterlimit presentation attribute. You’ve probably seen it when exporting an SVG from a graphic editor program, or perhaps you find out you could remove it without noticing any change to the visual appearance.

After a good …

Avatar of Mariana Beldi
Mariana Beldi on May 24, 2022
Direct link to the article Optimizing SVG Patterns to Their Smallest Size
SVG svg pattern SVG use

Optimizing SVG Patterns to Their Smallest Size

I recently created a brick wall pattern as part of my #PetitePatterns series, a challenge where I create organic-looking patterns or textures in SVG within 560 bytes (or approximately the size of two tweets). To fit this constraint, I have …

Avatar of Bence Szabó
Bence Szabó on Mar 18, 2022
Direct link to the article SVGcode for “Live Tracing” Raster Images
generator illustrator SVG

SVGcode for “Live Tracing” Raster Images

Say you have a bitmap graphic — like a JPG, PNG, or GIF — and you wish it was vector, like SVG. What do you do? You could trace it yourself in some kind of design software. Or tools within …

Avatar of Chris Coyier
Chris Coyier on Feb 9, 2022
Direct link to the article Using SVG in WordPress (2 Helpful Plugin Recommendations)
security SVG WordPress

Using SVG in WordPress (2 Helpful Plugin Recommendations)

SVG is a great image format, so it's nice to able to use it in WordPress. If you're looking to be using SVG in WordPress. , we've got you covered here with all the best options.
Avatar of Chris Coyier
Chris Coyier on Jan 21, 2022
Direct link to the article Flip, Invert, and Reverse
border-image SVG

Flip, Invert, and Reverse

The SVG <path> syntax is a beast. There are all sorts of commands that make up a mini-language all of its own — so powerful that it’s capable of drawing anything. Don’t be too scared of it, though, because some …

Avatar of Chris Coyier
Chris Coyier on Dec 8, 2021
Direct link to the article Fractional SVG stars with CSS
mix-blend-mode SVG

Fractional SVG stars with CSS

Some ⭐️⭐️⭐️⭐️⭐️ star rating systems aren’t always exactly even stars. Say you want to support rating something 2.25 stars. To do that you could “fill” the shape of the stars partially. I like this idea by Samuel Kraft. The tricky …

Avatar of Chris Coyier
Chris Coyier on Dec 2, 2021
Direct link to the article Which SVG technique performs best for way too many icons?
SVG svg icons

Which SVG technique performs best for way too many icons?

Tyler Sticka digs in here in the best possible way: by making a test page and literally measuring performance. Maybe 1,000 icons is a little bit of an edge case, but hey, 250 rows of data with four icons in …

Avatar of Chris Coyier
Chris Coyier on Nov 23, 2021
Direct link to the article Favicons: How to Make Sure Browsers Only Download the SVG Version
favicon SVG

Favicons: How to Make Sure Browsers Only Download the SVG Version

Šime Vidas DM’d me the other day about this thread from subzey on Twitter. My HTML for favicons was like this:

<!-- Warning! Typo! --<link rel="icon" href="/favicon.ico" size="any"<link rel="icon" href="/favicon.svg" type="image/svg+xml"

The attribute size is a typo there, …

Avatar of Chris Coyier
Chris Coyier on Nov 5, 2021
  • 1
  • 2
  • 3
  • ...
  • 19
  • 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