Comments (7)
No, it cannot be minified like this because 'not set' does not necessarily mean '0'.
from csso.
OK, but may give an option to choose this minification metod?
from csso.
What do you mean? not set -> 0 is an invalid assumption, optional or not. Let's say you have two classes: .test { margin: 3px } and .test2 { margin-top: 4px; margin-right: 4px; margin-bottom: 4px }, you apply them both to an element: div class="test test2"
. In this case, test2
overrides all margin properties set in test
, except for margin-left which is 3px. If test2
was minified like you suggested, we'd end up with the wrong value of 0.
All the minification done by CSSO strictly adheres to the CSS specification. Perhaps our docs are misleading when we label basic minifications as 'safe' and the more advanced ones as 'structural' - actually all of them are safe and must stay such. I'll update the docs.
from csso.
I'm agree with Leonya, it is very unsafe to minify margins this way.
In any case the matter of CSS compressing is to compress CSS, not to correct it or to insert some absent values, sorry.
from csso.
Leonya: at your case you're absolutely right and I totally agree with you. But my case is different from the general use. I do not need a safe minification. I know what CSSO will do because I'd allow to do that.
at *nix, you can remove files with force metod "rm -rf", that look like what I want. Advanced users may want too.
I forked the project. I'd add that option for me :) Thanks anyway, CSSO works perfectly.
from csso.
hmert: keep in mind that you will have to fork it once again in september, it is CSSO2 in active development now — completely another codebase.
Please, comment this issue with your option implementation link after you will implement it. We will try to rethink this issue at least. :) Thank you.
from csso.
hmert: well, feel free to implement it in your fork, but I still don't get your reasoning. If you are going to use it for your own HTML/CSS which is "immune" to this problem, then why don't you write the CSS in the shorthand form in the first place?
from csso.
Related Issues (20)
- csso mis-compression of escape sequence in v5.0.0+
- Allow to enforce applying optimisations to custom property values HOT 8
- Merging is broken for :where selectors HOT 6
- escaped dashicon not working HOT 9
- @import statement on the bottom were removed HOT 1
- Wrong css property applied after restructuring
- Contents of the :is and :where pseudo-class functions is not optimized HOT 3
- ccoss
- how disabled colormin?
- csso ignores charset and always produces UTF-8
- Wrong border compressed result when with shorthand-border
- Shorten CSS Variable Names
- [bug] minifies removes @media tags HOT 4
- Update `css-tree` dependency HOT 2
- Minifying 0px within calc statements breaking site.
- Failure to Concatenate/Combine 2 CSS Selectors in Obscure Edge Case
- Duplicate content property removed
- Add support for CSS Nesting
- css
- Silently removes @media blocks containing "and (not ...)" 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 csso.