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.

Optimizing properties of level 2 removes hsla values

See original GitHub issue

For some unknown reason, when using 2 level, color values specified in hsla format are removed.

Environment

  • clean-css version - npm ls clean-css: 5.1.0
  • node.js version - node -v: 12.13.0
  • operating system: Ubuntu 20.04

Configuration options

var CleanCSS = require('clean-css');
new CleanCSS({
  inline: false,
  level: {
    1: {
      all: false,
    },
    2: {
      all: true,
      restructureRules: true,
      removeUnusedAtRules: false,
    },
  },
})

Input CSS

.test {
  border: 1px solid hsla(0, 0%, 65.5%, 0.2);
}

Actual output CSS

.test {
  border: 1px solid;
}

Expected output CSS

.test {
  border: 1px solid hsla(0, 0%, 65.5%, 0.2);
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
lex111commented, Mar 3, 2021

@jakubpawlowicz wow how quickly, many thanks!

2reactions
jakubpawlowiczcommented, Mar 3, 2021

And btw sorry for this causing you trouble!

Read more comments on GitHub >

github_iconTop Results From Across the Web

node_modules/clean-css · Week2 · ehnoh2 / cs242-sp19 ...
Level 2 optimizations operate at rules or multiple properties level, e.g. can remove duplicate rules, remove properties redefined further down a stylesheet, or ......
Read more >
The Optimization of Process Parameters and Microstructural ...
This paper presents the process parameters' optimization procedure of fiber laser welded dissimilar high strength low alloy (HSLA) and martensitic steel (MART) ...
Read more >
clean-css-cli - NPM Package Overview - Socket.dev
Level 2 optimizations operate at rules or multiple properties level, e.g. can remove duplicate rules, remove properties redefined further ...
Read more >
Genetic algorithm based optimization for multi-physical ...
Genetic algorithm based optimization for multi-physical properties of HSLA steel through hybridization of neural network and desirability ...
Read more >
Planning for property optimization - Pega
Property Optimization tool. In development systems where you have only a few Single Value , top-level properties to expose, use the Property ......
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