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

Incorrect @import output when there is an empty selector group and --skip-advanced #258

Closed
exogen opened this issue Mar 10, 2014 · 3 comments

Comments

@exogen
Copy link

exogen commented Mar 10, 2014

Given this simple CSS:

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

body {
  color: #000;
}

body h1 {
  font-family: 'Domine';
}

cleancss --skip-import --skip-advanced will give the expected output:

@import url(//fonts.googleapis.com/css?family=Domine:700);body{color:#000}body h1{font-family:Domine}

However, if the @import is followed by an empty selector group (including when the group has only a comment):

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

body {
  /* comment */
}

body h1 {
  font-family: 'Domine';
}

cleancss --skip-import --skip-advanced will omit the @import altogether:

body h1{font-family:Domine}

Without --skip-advanced, the output is as expected – the @import remains, but the body group is omitted. I would expect the same output with --skip-advanced.

@GoalSmashers
Copy link
Contributor

Fixed in 1b59c1e - 2.1.6 is out with the fix too.

Thanks for raising it!

@exogen
Copy link
Author

exogen commented Mar 10, 2014

Awesome! Thanks for investigating so quickly.

@GoalSmashers
Copy link
Contributor

👍 your detailed report helped a lot!

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

No branches or pull requests

2 participants