Cerdic/CSSTidy

Corrupting rgb() color definition

Closed this issue · 1 comments

When using " compress colors" option it does not recognize rgb() notation properly.

considering example :

white10 { color: rgba(255, 255, 255, 10%); }
white20 { color: rgb(255 255 255 / 20%);   }
white30 { color: rgb(255, 255, 255, 30%);  }

Output :

Optimised color: Changed "rgb(255 255 255 / 20%)" to "red"
Optimised color: Changed "rgb(255,255,255,30%)" to "#fff"

white10{color:rgba(255,255,255,10%)}
white20{color:red}
white30{color:#fff}

Should be:

white10{color:#ffffff1a}
white20{color:#fff3}
white30{color:#ffffff4d}
Cerdic commented

Expression like rgb(255 255 255 / 20%); are now not corrupted anymore (but also not compressed, that is for a later wider CSS4 support phase)