Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistence of "newline_between_rules" with @import or @media #769

Closed
ErickPetru opened this issue Sep 1, 2015 · 2 comments
Closed

Inconsistence of "newline_between_rules" with @import or @media #769

ErickPetru opened this issue Sep 1, 2015 · 2 comments
Milestone

Comments

@ErickPetru
Copy link

It seems that "newline_between_rules": true isn't working in the same way all the time, when there are imports or some nesting happens. Here's the original file:

@import url('https://fonts.googleapis.com/css?family=Roboto');
*, *:before, *:after { box-sizing: border-box; }
body { font: 400 1rem/1.4 'Roboto', Sans-serif; margin: 0; }
@media (min-width: 960px) {
    .cards { font-size: 0; }
    .cards .card { display: inline-block; font-size: 1rem; width: 50%; }
}

Here's the current result:

@import url('https://fonts.googleapis.com/css?family=Roboto');
*,
*:before,
*:after {
    box-sizing: border-box;
}

body {
    font: 400 1rem/1.4 'Roboto', Sans-serif;
    margin: 0;
}

@media (min-width: 960px) {
    .cards {
        font-size: 0;
    }
    .cards .card {
        display: inline-block;
        font-size: 1rem;
        width: 50%;
    }
}

And here's the desired result, keeping consistence of newlines on all cases:

@import url('https://fonts.googleapis.com/css?family=Roboto');

*,
*:before,
*:after {
    box-sizing: border-box;
}

body {
    font: 400 1rem/1.4 'Roboto', Sans-serif;
    margin: 0;
}

@media (min-width: 960px) {
    .cards {
        font-size: 0;
    }

    .cards .card {
        display: inline-block;
        font-size: 1rem;
        width: 50%;
    }
}

Am I missing something in my configuration or is it impossible?

@ghost
Copy link

ghost commented Jun 9, 2016

I have the same problem using js-beautify 1.6.3

@MacKLess MacKLess added this to the 1.8.0 milestone Aug 22, 2018
@MacKLess
Copy link
Collaborator

This appears to have been resolved with tests filed in v1.8.0-rc12. @ErickPetru and @centigrade-thomas-becker please feel free to double check at http://jsbeautifier.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants