csscomb / csscomb.js

CSS coding style formatter
http://csscomb.com/
MIT License
3.28k stars 460 forks source link

Wrong indent #638

Open npoliquin opened 3 years ago

npoliquin commented 3 years ago

I made this test and I don't know why scss comb break my scss file like that. Any ideas?

OS: Windows

Consider the following SCSS:

Before:

.class {
    background: red;
    position: absolute;
    margin: 0;
    font: {
        size: 10px;
        weight: 500
    }
    padding: 0;
}

Expected behavior:

.class {
    position: absolute;

    padding: 0;
    margin: 0;

    font: {
            size: 10px;
        weight: 500
    }

    background: red;
}

After CSSComb:

.class {position: absolute; margin: 0;      padding: 0; font: {     size: 10px;     weight: 500 };background: red;  }

Config:

{
    "exclude": [
        ".git/**",
        "node_modules/**",
        "bower_components/**"
    ],
    "space-after-selector-delimiter": "\n",
    "space-after-colon": " ",
    "space-before-opening-brace": 1,
    "strip-spaces": true,
    "block-indent": 4,
    "unitless-zero": true,
    "sort-order": [....],
    "verbose": true,
}
npoliquin commented 3 years ago

Another issue:

Before:

.container_sliding_search {
            display: none;

            position: absolute;
            top: 85px;
            z-index: 999;

            padding: 20px 15px;

            background-color: #fff;
            box-shadow: 1px 1px 18px rgba(0, 0, 0, 0.42);

            min-height: inherit;
            width: 100%;

            @include ipad-and-below {
                top: 0px;
            }
}

After:

        .container_sliding_search {
position: absolute;

top: 85px;

z-index: 999;

padding: 20px 15px;

width: 100%;

min-height: inherit;

box-shadow: 1px 1px 18px rgba(0, 0, 0, 0.42);

            display: none;

background-color: #fff;

@include ipad-and-below {
                top: 0;
            }
marcdion commented 1 year ago

@npoliquin :mad_triggered: