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

Duplicated output from @extend when scss partial imported multiple times #1202

Closed
JakeElder opened this issue Apr 4, 2014 · 1 comment
Closed

Comments

@JakeElder
Copy link

Thanks for the great work.

I've taken to writing scss modules that import all their dependencies, in order to make them as portable and explicit as possible. EG

_type.scss

%type-0 { color: red; }

_carousel.scss

@import "type";
%carousel { @extend %type-0; }

_accordion.scss

@import "type";
%accordion { @extend %type-0; }

default.scss

@import "carousel";
@import "accordion";
.carousel { @extend %carousel; }
.accordion { @extend %accordion; }

When default.scss is compiled, I would expect

.carousel, .accordion {
  color: red; }

Actual:

.carousel, .accordion {
  color: red; }

.carousel, .accordion {
  color: red; }

gzip will mitigate the cost attached to the increased file size, but I'm wondering if this is intended behaviour?

@nex3
Copy link
Contributor

nex3 commented Apr 4, 2014

The issue is that @import always creates a new copy of the stylesheet you're importing, so there are two copies of the selectors you're @extending. I'm closing this as a duplicate of #156.

@nex3 nex3 closed this as completed Apr 4, 2014
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