Giter Club home page Giter Club logo

Comments (7)

Leonya avatar Leonya commented on May 23, 2024

No, it cannot be minified like this because 'not set' does not necessarily mean '0'.

from csso.

hmert avatar hmert commented on May 23, 2024

OK, but may give an option to choose this minification metod?

from csso.

Leonya avatar Leonya commented on May 23, 2024

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.

afelix avatar afelix commented on May 23, 2024

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.

hmert avatar hmert commented on May 23, 2024

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.

afelix avatar afelix commented on May 23, 2024

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.

Leonya avatar Leonya commented on May 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.