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

Comments in rule sets for variable definitions #34

Closed
carlcs opened this issue Jul 28, 2014 · 5 comments
Closed

Comments in rule sets for variable definitions #34

carlcs opened this issue Jul 28, 2014 · 5 comments

Comments

@carlcs
Copy link

carlcs commented Jul 28, 2014

All :root {} rule sets with variable definitions are generally removed from the output. But not so if they contain comments. Aiming for a clean CSS file, I'd like to have an option to have these sets (and the comments) removed, too.

:root {
  /* Font stacks */
  --font-family-sans: "Proxima Nova", sans-serif;
  --font-family-serif: serif;
  --font-family-mono: monospace;

  /* More font variables */
  --font-var: normal;
}
:root {
  --var: normal;
}
:root {
  /* Font stacks */

  /* More font variables */
}
@carlcs
Copy link
Author

carlcs commented Jul 28, 2014

Posted this as segmentio/myth#99 yesterday, but this probably belongs here.

@necolas
Copy link
Contributor

necolas commented Jul 28, 2014

Pretty much any half-decent minfier will strip those rules out.

@carlcs
Copy link
Author

carlcs commented Jul 29, 2014

Sure, but I actually don't want to minify/compress the file. I was hoping that if rework-vars removes empty rule sets without comments, it could also remove empty rule sets with comments. Not that big of a problem though, @necolas.

@carlcs carlcs closed this as completed Jul 29, 2014
@necolas
Copy link
Contributor

necolas commented Jul 29, 2014

That behaviour is the result of reworkcss/css. I think it kind of makes sense not to strip rules with comments in them, because you might want to do something with those comments in a css preprocessor.

@carlcs
Copy link
Author

carlcs commented Jul 29, 2014

Unlikely but yeah, who knows! :) I'd say that these comments almost ever belong to the anyhow stripped out variable definitions.

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