Coder Social home page Coder Social logo

css-compressor's Introduction

CSS Compressor

Clean and [Compact | Minify] your CSS files .

Actually you also can Beautify your css file with option{format: 'beautify'}

Thanks

This extension completely depend on clean-css and the author is jakubpawlowicz , thanks nice man!

Screenshot tools snipaste

icon icons8

Usage

Press shortcuts shift+alt+f to format CSS file (make sure current file you edit type is css)

Options

reference for here

  • default option

    {
      format: 'keep-breaks',
      compatibility: 'ie8'
    }
    

    (oh , ie8 I know !)

    result

  • beautify output

    {
      format: 'beautify'
    }
    

    result

    yes , you can disabled break between two selectors see options

  • with empty option will output minify css file

    { }
    

css-compressor's People

Contributors

bestvow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

zheung

css-compressor's Issues

@import rule removed after formatting

Input code css
https://i.imgur.com/ZaiBvoh.png

@import url(https://fonts.googleapis.com/css2?family=Roboto:wght@300;500;700&display=swap);
@import url("reset.css");
@import url("common.css");
@import "buttons.css";
@import "modals.css";
/* some comment */
@media screen and (min-width:px){
    .somerule{font-size: 11px;}
}

After formatting with any preset i got all @import, but not with fonts and @media, removed...
https://i.imgur.com/al6DgQX.png

@import url(https://fonts.googleapis.com/css2?family=Roboto:wght@300;500;700&display=swap);
/* some comment */@media screen and (min-width:px){.somerule{font-size:11px}}:root{--width:calc(216px * 4);--height:calc(279px * 4)}

There is no recommendation how to resolve that through settings, but only with CLI:
--inline [rules] Enables inlining for listed sources (defaults to local)
https://github.com/clean-css/clean-css-cli?tab=readme-ov-file#cli-options

QUESTION:
So how can i include this to my settings.json?

怎么设置才能不清除注释?

原始代码:
/* row */
.row {
width: 100%;
height: 100%;
}

/* col-1 */
.col-1 {
width: 95px;
height: 100%;
float: left;
}

/* col-2 */
.col-2 {
margin: 40px 55px 40px 30px;
float: right;
}

想要的样子为:

/* row /
.row { width: 100%; height: 100%; }
/
col-1 /
.col-1 { width: 95px; height: 100%; float: left; }
/
col-2 */
.col-2 { margin: 40px 55px 40px 30px; float: right; }

怎么设置才能得到想要的结果,谢谢!

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.