Skip to content

Comment on Icono – Pure CSS icons with only one element

Comments

That's really smart - However, it seems impossible to use multiple sizes in a single document, which make it impractical over other alternatives such as Ionicons, Icomoon or FontAwesome.

Still a nice showcase, congrats!

it seems impossible to use multiple sizes in a single document

How so? It's possible in most cases to stick an extra class on the icon, say `.2x` and add a rule to your css such as —

    [class*="2x"] {
       transform: scale(2)
    }

Perfectly viable technique, though if they are written in SASS/LESS/whatever, the author could refactor the icons to mixins with a parameter that sets the scale, so the values themselves are "true".

The author could refactor them to use ems or percents instead of pixels, that way they would automatically change size depending on their parent.

Downside of using this is transform still leaves the box size that's in the flow of the document the same size. Problematic if you have the icons inline, or in elements like buttons.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.