question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SVG styles are being ignored

See original GitHub issue

Hello,

Firstly thank you for the awesome library.

My issue is with the svg styles being skipped/not appearing in the final output CSS.

I use a grunt plugin grunt-contrib-cssmin

Environment

  • grunt-contrib-cssmin version - 2.2.1
  • clean-css version - 4.1.11
  • node.js version - 6.11.3
  • operating system: Windows 8

Input CSS

.node:hover circle {
    r: 18;
    stroke: orange;
}

Actual output CSS

.node:hover circle {
    stroke: orange;
}

Expected output CSS

.node:hover circle {
    r: 18;
    stroke: orange;
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:5

github_iconTop GitHub Comments

2reactions
prabhjyotsinghcommented, Sep 10, 2018

Is there any chance of this being fixed? What it looks like is this regex (https://github.com/jakubpawlowicz/clean-css/blob/master/lib/optimizer/level-1/optimize.js#L35) is look for >= 3 char in the property name.

1reaction
Pedro-vkcommented, Apr 12, 2018

I’ve found this error in an Angular project. AngularCLI implements clean-css on production builds. I’ve tested with units (like r: 20px) but it doesn’t work fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SVG styles are being ignored · Issue #1021 · clean-css/clean-css ...
My issue is with the svg styles being skipped/not appearing in the final output CSS. I use a grunt plugin grunt-contrib-cssmin Environment ...
Read more >
"Background" style property ignored for <svg> elements inside ...
The issue is that, when an <svg> is embedded in HTML, it kind of does double-duty as both an SVG element and an...
Read more >
T68672 SVG style element ignored if no type attribute is ...
The <style> element is ignored if you omit the default value type="text/css". This bug seems new as upstream on ...
Read more >
SVG styles being ignored - The Mail Archive
Hi all, I have a document which imports an SVG as a full page graphic. It used to display fine, but recently I...
Read more >
Styles in SVG seem to be ignored when converting SVG to PDF
I'm using spire.pdf 5.1.0 library. I'm trying to add SVG to a PDF as a new layer. First, I'm converting SVG to PDF....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found