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

Remove impossible selectors #443

Closed
clarfonthey opened this issue Feb 15, 2018 · 3 comments
Closed

Remove impossible selectors #443

clarfonthey opened this issue Feb 15, 2018 · 3 comments

Comments

@clarfonthey
Copy link

clarfonthey commented Feb 15, 2018

I use partial selectors in SASS which sometimes produces impossible selectors if you're not careful. These selectors are valid syntax but can never match an element, so, can safely be removed.

A few examples I thought of:

  • tag:not(tag)
  • :matches(h1):matches(h2)
  • html html (assuming well-formed HTML)
  • p div (again, assuming well-formed HTML)
  • ...
@chrisdothtml
Copy link

Do you really have enough impossible selectors in your codebase to notice a bundle size benefit from removing them?

@clarfonthey
Copy link
Author

@chrisdothtml yes. :not especially, as I use %partial:not(%other) in a few places. Sure, there are ways of getting around this and I have also suggested removing these during compilation in sass, but I think that having the option of removing these in minification tools is also a good idea, even if not enabled by default.

@andyjansson
Copy link
Contributor

Closing this due to being an issue which is likely difficult to implement and which provides very little value.

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