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

SVG styles are being ignored #1021

Closed
adityatj opened this issue Apr 5, 2018 · 5 comments
Closed

SVG styles are being ignored #1021

adityatj opened this issue Apr 5, 2018 · 5 comments

Comments

@adityatj
Copy link

adityatj commented Apr 5, 2018

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;
}
@Pedro-vk
Copy link

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.

Pedro-vk added a commit to Pedro-vk/EthKudos that referenced this issue Apr 12, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
css-clean bug: clean-css/clean-css#1021
@Dari4sho
Copy link

Dari4sho commented Jul 16, 2018

I'm encountering this as well. I've got this definition

@keyframes pulse-me{
  0%{
    r: 4.1;
    opacity: 0;
  }
  50%{
    opacity: 0.3;
  }
  70%{
    opacity: 0.1;
  }
  100%{
    r: 16;
    opacity: 0;
  }
}

and it converts to

@keyframes pulse-me{0%{opacity:0}50%{opacity:.3}70%{opacity:.1}100%{opacity:0}}

I tried a couple of options but I couldn't find the reason.

@prabhjyotsingh
Copy link

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.

@hasmanyguitars
Copy link

I'm seeing a similar issue with cy/cx properties.

cythrawll pushed a commit to yavin-dev/framework that referenced this issue Feb 21, 2019
new version of clean-css fails on single character property names,
even though they are valid

clean-css/clean-css#1021
cythrawll added a commit to yavin-dev/framework that referenced this issue Feb 21, 2019
new version of clean-css fails on single character property names,
even though they are valid

clean-css/clean-css#1021
przyb added a commit to owlsdepartment/clean-css that referenced this issue Oct 22, 2019
emccorson added a commit to OnsenUI/OnsenUI that referenced this issue Aug 17, 2020
@jakubpawlowicz
Copy link
Collaborator

Fixed on main branch, will be released in clean-css 5.0 soon.

nsbarsukov added a commit to taiga-family/taiga-ui that referenced this issue Sep 24, 2021
nsbarsukov added a commit to taiga-family/taiga-ui that referenced this issue Sep 27, 2021
ChaosEngine added a commit to ChaosEngine/InkBall that referenced this issue Jul 17, 2022
ChaosEngine added a commit to ChaosEngine/InkBall that referenced this issue Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants