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

Multiple included placeholders will create new selector #1811

Closed
FranDias opened this issue Aug 25, 2015 · 2 comments
Closed

Multiple included placeholders will create new selector #1811

FranDias opened this issue Aug 25, 2015 · 2 comments

Comments

@FranDias
Copy link

Similar/same place holders will not combine in the compiled output:

%m-all-0
  margin: 0

%m-all-0
  margin: 0

.m-all-0
  @extend %m-all-0

Compiles to (two of the same selectors/rule sets)

.m-all-0 {
  margin: 0;
}

.m-all-0 {
  margin: 0;
}

https://sassmeister.com/gist/94e6780aaeab0a4e2fcd

I'd expect SASS to realize that those selectors are the same and reduce compiled output.

In this simplified example the obvious answer is to just to fix the selectors but in larger projects this can become a pain. Mainly if there are mixins or placeholders which are being included into other files.

@chriseppstein
Copy link

I'd expect SASS to realize that those selectors are the same and reduce compiled output.

We don't do this with classes or any other selector. Placeholder selectors are the same as those.

@FranDias
Copy link
Author

@chriseppstein Thanks for your time and consideration of this issue, makes sense to be consistent.

For anyone else wondering this behavior is also consistent with media queries.
https://sassmeister.com/gist/09545a51a563e77a1a35

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