L
L
lavezzi12016-04-08 20:29:05
css
lavezzi1, 2016-04-08 20:29:05

A large number of sizes of svg icons, what to do?

There are 30 icons of the same size. But different places of use need different sizes. How to be? You need to prepare icons for small/medium/large sizes and pack all sizes in a sprite, right? Or is it possible to resize somehow?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Velichko, 2016-04-17
@lavezzi1

Use svg symbol or defs, use css to set sizes and fill, etc.
codepen.io/Zoxon/pen/PNeJOx?editors=1100
Or use a sprite, where icon sizes can be set using background-size, but the fill cannot be controlled
Icon fonts I do not recommend using

D
DSoly, 2016-04-09
@DSoly

IMHO the most practical way to use svg icons is with icon fonts. For example, on icomoon.io, we create an icon font and connect it to the site.
Further, to insert an icon in the right place of the html page, it is enough to write ("icon-*" - the class of the desired icon from the font). And with the help of regular CSS (font-size, color, etc.) we set the size, color ... both individually and in groups, this is already as your heart desires.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question