Quantcast
Channel: svg icons – CSS-Tricks
Browsing all 25 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

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...

View Article



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....

View Article

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> might have a <title>, and you might be appying IDs to both of those elements for various...

View Article

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 size...

View Article

Solved with CSS! Colorizing SVG Backgrounds

This post is the first in a series about the power of CSS. Article Series: Colorizing SVG Backgrounds (this post) Dropdown Menus Logical Styling Based On the Number of Given Elements CSS is getting...

View Article


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"...

View Article

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,...

View Article

Image may be NSFW.
Clik here to view.

Inline SVG… Cached

I wrote that using inline <svg> icons makes 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...

View Article


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...

View Article


Creating a Maintainable Icon System with Sass

One of my favorite ways of adding icons to a site is by including them as data URL background images to pseudo-elements (e.g. ::after) in my CSS. This technique offers several advantages: They don't...

View Article

Add Background Colors to SVGs Using the “rect” Element

The advantages of using SVGs in web development are well known. SVGs are small in size, can be made quite accessible, are scalable while maintaining their quality, and can be animated. Still, there is...

View Article

Image may be NSFW.
Clik here to view.

SVG, Favicons, and All the Fun Things We Can Do With Them

Favicons are the little icons you see in your browser tab. They help you understand which site is which when you’re scanning through your browser’s bookmarks and open tabs. They’re a neat part of...

View Article

Image may be NSFW.
Clik here to view.

A Font-Like SVG Icon System for Vue

Managing a custom collection of icons in a Vue app can be challenging at times. An icon font is easy to use, but for customization, you have to rely on third-party font generators, and merge conflicts...

View Article


Image may be NSFW.
Clik here to view.

Some New Icon Sets

I’ve bookmarked some icon sets lately, partly because I can never find a nice set when I need to. I figured I’d even go the extra mile here and blog them so I can definitely find them later. Aside...

View Article

SVGBOX

I’ve been saying for years that a pretty good icon system is just dropping in icons with inline <svg> where you need them. This is simple to do, offers full design control, has (generally) good...

View Article


Super Tiny Icons

A bunch of SVG icons (of popular things) all under 1KB. SVG is awesome for golfing. I was going to add a CodePen logo but there is already one in there at 375 Bytes. I’ve got one at 208 Bytes, based on...

View Article

Image may be NSFW.
Clik here to view.

Accessible SVG Icons

The answer to “What is the most accessible HTML for an SVG icon?” isn’t one-size-fits all, because what an icon needs to do on a website varies. I’m partial to Heather Migliorisi’s research on all...

View Article


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> might have a <title>, and you might be appying IDs to both of those elements for various...

View Article

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 size...

View Article

Solved with CSS! Colorizing SVG Backgrounds

This post is the first in a series about the power of CSS. Article Series: Colorizing SVG Backgrounds (this post)Dropdown MenusLogical Styling Based On the Number of Given Elements CSS is getting...

View Article
Browsing all 25 articles
Browse latest View live


Latest Images