Comments (14)
I think we eventually should have it. Thanks for suggesting.
from clean-css.
It should also support translation from rgb()
/hsl()
to hex.
Also shorten #FFFFFF
to #FFF
for example.
hex.replace(/#([\da-fA-F])\1{5}/, '#$1$1$1');
from clean-css.
@MayhemYDG - we already do rgb -> hex and color shortening (see specs)! A (lengthy) list of all optimizations is coming soon - see #35.
from clean-css.
Oh all right then. Still missing hsl translation.
from clean-css.
We do hsl too - need that optimizations wiki page urgently :-)
from clean-css.
Uh? I use clean-css via grunt-contrib-cssmin and it's not translating hsl to hex.
from clean-css.
@MayhemYDG please check if you use grunt-contrib-cssmin 0.4.1+ as they only recently bumped clean-css dependency to 0.10.x (we added hsl support in 0.8.3).
from clean-css.
% npm install clean-css
% cat main.css | ../../../node_modules/clean-css/bin/cleancss -o test.css
Usage: cleancss [options] <source-file>
...
This doesn't even seem to work?
../../../node_modules/clean-css/bin/cleancss main.css -o test.css
It doesn't translate hsl to hex, looks like the issue does come from clean-css.
I'm on the latest node, grunt and grunt-contrib-cssmin.
from clean-css.
@MayhemYDG - I was mistaken by another part of our code which handles HSL/HSLA cleanup. There's a ticket for HSL conversions now: #83.
from clean-css.
Great!
from clean-css.
@MayhemYDG - HSL conversions ready in 8cf8283.
from clean-css.
Good job.
from clean-css.
Thanks! This was a much awaited feature. :)
from clean-css.
👍
from clean-css.
Related Issues (20)
- Percentage symbol addition to custom props values in hsl() parameters HOT 3
- Block comment can result in incorrect minification HOT 2
- import statement gets broken HOT 1
- Support @layer keyword HOT 1
- "mergeNonAdjacentRules" not works in some cases
- Using `revert` in a shorthand property is converted into undesirable value
- Spaces removed from :is statement HOT 1
- Rogue `%` symbol added to value
- clean css cli do not round font-size(px) line-height
- clean-css doesn't separate all spaces in the selector, instead it combines them all. HOT 2
- "px" is removed from style attribute in template literal strings (lit-html) HOT 4
- removeUnusedAtRules exception
- Parsing error on `content: "\<";` in CSS
- CSS Nesting Support HOT 5
- Border optimization with clean css removes color when using !important
- Issue with WordPress header comment section for the main stylesheet
- In translate(), zeros in calc() functions are having units removed
- "scrollbar-color" and "text-decoration-color" properties' values are not being processed
- v5.3.2, still stripping away @container queries
- @container rule output none HOT 3
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 clean-css.