Comments (12)
So would it work if this:
.SB-messages .SB-message a {
color: rgb(185, 99, 117);
border-bottom: 1px dotted rgb(185, 99, 117;
text-shadow: 0 1px 0 hsla(0, 0%, 0%, 1);
}
.SB-messages .SB-message p {
color: rgb(185, 99, 117);
border-bottom: 1px dotted rgb(185, 99, 117;
text-shadow: 0 1px 0 hsl(0, 0%, 0%);
}
were minified to this?
.SB-messages .SB-message a{color:#b96375;border-bottom:1px dotted rgb(185,99,117;text-shadow:0 1px 0 hsla(0,0%,0%,1}.SB-messages .SB-message p{color:#b96375;border-bottom:1px dotted rgb(185,99,117;text-shadow:0 1px 0 hsl(0,0%,0%}
from yuicompressor.
The % look correct now, but you lost a couple of parens, the correct should be something like:
.SB-messages .SB-message a{color:#b96375;border-bottom:1px dotted rgb(185,99,117);text-shadow:0 1px 0 hsla(0,0%,0%,1}.SB-messages .SB-message p{color:#b96375;border-bottom:1px dotted rgb(185,99,117);text-shadow:0 1px 0 hsl(0,0%,0%)}
Oh, actually I lost the parens in the original it looks like.
from yuicompressor.
Now you're missing parens in the result, as well. Could you take the time to write a pre and post minified test case?
from yuicompressor.
Let me remove the extraneous elements:
.color_chip {
color: hsla(27, 100%, 50%, 1);
background: rgba(195, 198, 214, 0.85);
}
Would optimally compress to:
.color_chip{color:hsl(27,100%,50%);background:rgba(195,198,214,.85)}
The following elements are involved:
- HSL requires percentages on saturation and lightness (the second and third elements)
- HSLA was minimized to HSL as the opacity was 1
- RGBA has an alpha, so it was kept, but the leading 0 was removed as it is non-necessary
- The trailing semicolon was also removed (I believe this is already done)
from yuicompressor.
This is a great test with lots of moving parts, but doesn't it fail to test the primary issue raised here - that being the % being dropped in HSL(A?) functional notation? And if so, would fixing this be as simple as change the second value in hsla() to a 0%?
from yuicompressor.
Not sure what you mean, sorry. The idea I was going under was just what a valid input is and the corresponding valid output should be in a successful case.
To step back to the original issue, it is actually as simple as:
Valid input is provided:
.style {
color: hsla(0, 0%, 20%, 0.75);
}
The current compressor is removing the "%" symbols from the HSL(A) values, corrupting them, producing:
.style{color:hsla(0,0,20,.75)}
The correct minified form (both the saturation and lightness, 2nd and 3rd components, are percentages) should be:
.style{color:hsla(0,0%,20%,.75)}
Sorry if I confused with my previous text case.
from yuicompressor.
Please see ae7ca5d48 - if you feel this doesn't adequately test what you were looking for, a PR is welcome!
from yuicompressor.
I'd just like to add this is an issue for RGB values as well.
.style {
color: rgb(0%, 50%, 50%);
}
compresses to
.style{color:rgb(0,50%,50%)}
which is not a valid colour value apparently. Instead the 0% needs to remain as such, i.e:
.style{color:rgb(0%,50%,50%)}
Hope that helps.
from yuicompressor.
tests for rgb added; thanks, @elstob
from yuicompressor.
is there any workaround for this issue? It's destroying my CSS and I don't know how to solve it
from yuicompressor.
How anyone could use this compressor for "advanced" styles is beyond me. It breaks css.
On top of that I do not see any way to configure it with options to turn off Zero Values
from yuicompressor.
I'd like to point out that the target output in ae7ca5d is the optimal one (hsl(27,0%,50%);
). However, it seems like non-broken output should be higher priority, meaning hsla(27,0%,50%,1);
would be sufficient.
from yuicompressor.
Related Issues (20)
- CSS units being stripped from variables HOT 3
- java.lang.StringIndexOutOfBoundsException: String index out of range
- This project has been abandoned with huge bugs, move to uglifycss
- build error HOT 2
- identifier is a reserved word
- compress css like left:calc(50% - (100px / 2)) has a bug HOT 5
- 不再支持目标选项 1.5。请使用 1.6 或更高版本
- Dead project? HOT 1
- caches.delete() not working HOT 1
- Space before : are removed inside media query HOT 2
- Failed to compress valid JS (axios library)
- 压缩HTML时 页内JS不支持 ES6 语法吗 ?[ERROR] HtmlCompressor: "syntax error" at line [42:37] during JavaScript compression: window.document.onclick = (e) => {
- CSS Compressing don't working HOT 1
- CSS: Invalid whitespace removal / @supports () "or" () HOT 1
- Hacking HOT 1
- Invalid CSS compression for transition-delay HOT 1
- background-image: url(svg) is not compress correctly
- New JAR file. HOT 3
- A potential XXE vulnerability found in rhino HOT 2
- 编译报错了
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yuicompressor.