gulp-svg-symbols icon indicating copy to clipboard operation
gulp-svg-symbols copied to clipboard

How can i change css file to scss?

Open seriiserii825 opened this issue 5 years ago • 1 comments

Hi. Thanks for plugin. He works good, but i find some bugs. The first bug is the class .st0, which is not tied to the svg class `.barber { width: 22.1px; height: 21.2px; } .st0{fill:#010101;}

.user-login { width: 16px; height: 16px; } .st0{fill:#FFFFFF;}

`

The second bug is the bad formatting for svg file. <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="22.1" height="38" viewBox="0 0 22.1 38"><svg id="barber" viewBox="0 0 22.1 21.2" width="22.1" height="21.2" y="0"><style>.st0{fill:#010101}</style><path class="st0" d="M21.8 0h-.1c-1 3.3-1.3 7.3-4 8.8-.5-1.4-1.8-2.1-3.2-2.7-.9-.4-1.9-1.1-2.8-1.1-.2 0-.4 0-.6.1-.3-.1-.5-.1-.7-.1-.9 0-1.9.7-2.8 1.1-1.5.7-2.7 1.3-3.2 2.7-2.8-1.5-3-5.6-4-8.8H.3C.1.3.1.7 0 1c0 .8.2 9.2.8 12.2.5 2.7 2.6 4.6 4.6 5.9 1.4.9 3.6 2.1 5.6 2.1 1.9 0 4.2-1.2 5.6-2.1 2-1.3 4.1-3.2 4.6-5.9.6-3 .8-11.4.8-12.2 0-.3-.1-.7-.2-1zm-6 12c-.1.7-.7 1.5-1.4 1.5-1.3.1-1.9-1.9-3.4-1.9-1.4 0-2.1 1.9-3.4 1.9-.7 0-1.3-.8-1.4-1.5-.1-.8.3-2 .7-2.4.5-.5 1.2-.4 2-.5.9-.1 1.7-.4 2.1-.8.5.5 1.2.7 2.1.8.8.1 1.5.1 2 .5.5.5.9 1.6.7 2.4z"></path></svg><svg id="user-login" viewBox="0 0 16 16" width="16" height="16" y="22"><style>.st0{fill:#fff}</style><path class="st0" d="M0 7h7V4.1L11 8l-4 3.9V9.1L0 9z"></path><path class="st0" d="M7 0v2h7v12H7v2h9V0z"></path></svg></svg

There is not indentantion. May be i will find another plugin for formating svg, but what should i do with css? Thanks.

seriiserii825 avatar Feb 27 '19 06:02 seriiserii825

Hi @seriiserii825

Sorry for the late answer.

For the classes, the plugin just gather everything it founds on the files. If you need a kind of “scoped” classes you should consider using gulp-svgmin before bundling the icons

For the SVG & CSS formatting, you can use something like gulp-beautify coupled with gulp-if

Is this answering your questions?

Hiswe avatar Mar 16 '19 16:03 Hiswe