Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stopped inlining st* classes? #1589

Closed
waltercruz opened this issue Sep 24, 2021 · 5 comments · Fixed by #1800
Closed

Stopped inlining st* classes? #1589

waltercruz opened this issue Sep 24, 2021 · 5 comments · Fixed by #1800
Labels

Comments

@waltercruz
Copy link

waltercruz commented Sep 24, 2021

Describe the bug
SVGO is not inlining st[1-9] classes

To Reproduce
Steps to reproduce the behavior:

  1. get this file: https://gist.githubusercontent.com/waltercruz/7bdf372457effd3f304b391b54b3c813/raw/b6460d64874f59b05eb2e5261aeb370a2ab1aec8/instagram.svg
  2. compress it with svgo

Expected behavior
st1, st2 and st3 classes should be inlined

Desktop (please complete the following information):

  • SVGO 2.7.0
  • NodeJs 16.10
  • Mac OS Catalina
@waltercruz waltercruz added the bug label Sep 24, 2021
@waltercruz
Copy link
Author

oops, my mistake. Closing!

@TrySound
Copy link
Member

what was it?

@waltercruz
Copy link
Author

in the <style> there was 4 classes - st0, st1, st2 and st3. This svg uses only st0 - and it was correctly inlined. In previous versions, the unused classes were deleted, but now the unused classes are kept. It's a different behaviour, but it's not breaking anything!

@TrySound
Copy link
Member

Actually minifyStyles should remove unused classes. Will take a look later.

@TrySound TrySound reopened this Sep 24, 2021
@mahnunchik
Copy link

Hi, I've faced with the same issue with different svg image: https://gist.githubusercontent.com/mahnunchik/23066a318de2956df3c769c87e4e6cbd/raw/e0f246d0e26ce770f3c3adca748a5a454907f8bb/crypto-com-coin-cro-logo.svg

<style>
    .st1{fill:url(#SVGID_00000016760000628848746960000000291323288447655331_)}
</style>

st1 class not used and not removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants