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.

Color zero units

See original GitHub issue

Good day! I’m using clean-css with gulp. My versions are: npm list clean-css: └─┬ gulp-clean-css@3.0.4 └── clean-css@4.0.10

The issue is with colors zero units. Example: In: color: hsl(0,0%,100%); Out: color: hsl(0,0,100%); hsl(0,0,100%); is wrong and browsers ignore such colors.

I solve it only if deny removing units 0 value with option “zeroUnits”. In code a bug-factor is

return value
    .replace(unitsRegexp, '$1' + '0' + '$2')
    .replace(unitsRegexp, '$1' + '0' + '$2');

If i’m wrong and it’s not a bug sorry.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
mirisuzannecommented, Jul 29, 2019

@jakubpawlowicz - I’m hitting it too. This seems like a regression, and the issue should be re-opened.

1reaction
johnnyoshikacommented, Mar 5, 2019

I had to disable zeroUnits to get around this problem:

cleanCSS({
      compatibility: {
        properties: {
          zeroUnits: false
        }
      }
    })
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change color of the units? :: Zero-K General Discussions
Can't find option to change ugly green color, to different. I have searched everywhere, is there any option to do this?
Read more >
Color charge - Wikipedia
Color charge is a property of quarks and gluons that is related to the particles' strong interactions in the theory of quantum chromodynamics...
Read more >
CSS Color units - Free tutorial to learn HTML and CSS
Because computers start counting at 0 (zero), the maximum value is 255. Considering a color is the result of a combination of Red,...
Read more >
4. Values and Units - CSS: The Definitive Guide, 3rd ... - O'Reilly
Values and Units In this chapter, we'll tackle the elements that are the basis for almost everything you can do with CSS: the...
Read more >
Unit Color Compendium | A Database for BattleTech Unit ...
A Database for BattleTech Unit Color Palettes and Paint Schemes.
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