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

Chore: Rid CSS output of empty :root blocks and comments #81

Merged
merged 4 commits into from
Aug 11, 2015

Conversation

erikjung
Copy link
Contributor

This addresses #80 by:

  • Adding a new PostCSS plugin that strips comments out of the transpiled CSS
  • Adding a new PostCSS plugin that strips empty :root {} blocks out of the transpiled CSS

This moves block comments out of the :root blocks by using the property names instead of numeric markers to identify annotations.
@tylersticka
Copy link
Member

Boy, I can see now why we usually go with the /* 1 */ format for comments. The key/value list is harder to read (and more repetitive, since you now have to keep the variable name up-to-date in two places).

I would prefer if we used postcss-discard-empty. Paired with the plugin you already added in this PR, it should allow us to continue writing comments in a readable, maintainable way without fear of littering the final stylesheet with empty selectors.

@erikjung
Copy link
Contributor Author

@tylersticka I didn't know about postcss-discard-empty, and this proposed solution sounds better to me as well.

@tylersticka
Copy link
Member

LGTM! 👍

erikjung added a commit that referenced this pull request Aug 11, 2015
Chore: Rid CSS output of empty :root blocks and comments
@erikjung erikjung merged commit 4f00b72 into master Aug 11, 2015
@erikjung erikjung deleted the chore-issue_80-root_blocks branch August 11, 2015 17:07
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

Successfully merging this pull request may close these issues.

None yet

2 participants