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

Option to remove unused at rules #862

Closed
clarfonthey opened this issue Jan 18, 2017 · 6 comments
Closed

Option to remove unused at rules #862

clarfonthey opened this issue Jan 18, 2017 · 6 comments
Milestone

Comments

@clarfonthey
Copy link

clarfonthey commented Jan 18, 2017

While this shouldn't be on by default, it'd be nice to add an option to remove @ font-face directives from the CSS if none of the fonts in them are referenced.

@jakubpawlowicz
Copy link
Collaborator

Cool idea, thanks @clarcharr!

@jakubpawlowicz jakubpawlowicz modified the milestone: ~future~ Jan 19, 2017
@clarfonthey
Copy link
Author

See also: https://www.npmjs.com/package/postcss-discard-unused

@jakubpawlowicz jakubpawlowicz modified the milestones: 4.1, ~future~ Feb 10, 2017
@jakubpawlowicz jakubpawlowicz changed the title Option to remove unused @font-face Option to remove unused at rules Mar 24, 2017
@jakubpawlowicz
Copy link
Collaborator

jakubpawlowicz commented Mar 24, 2017

So let's have it implemented for all at rules.

  • @counter-style
  • @font-face
  • @keyframes
  • @namespace

jakubpawlowicz added a commit that referenced this issue Apr 20, 2017
Why:

* `@counter-style` can define a non-standard values which should be
  treated as first class citizens.
jakubpawlowicz added a commit that referenced this issue Apr 20, 2017
Why:

* When an at-rule, i.e. `@counter-style`, `@font-face`, `@keyframes`, or
  `@namespace`, is not referenced anywhere in a stylsheet it can be
  safely removed;
* inspired by https://www.npmjs.com/package/postcss-discard-unused
@jakubpawlowicz
Copy link
Collaborator

Scheduled for 4.1 release.

@clarfonthey
Copy link
Author

Awesome! Thank you!

@jakubpawlowicz
Copy link
Collaborator

It's been released in 4.1.

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

2 participants