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

@extend cannot be used from within @media #3

Closed
blainehansen opened this issue Mar 29, 2017 · 2 comments
Closed

@extend cannot be used from within @media #3

blainehansen opened this issue Mar 29, 2017 · 2 comments
Assignees

Comments

@blainehansen
Copy link
Contributor

Since almost the entire library uses @extend from within mixins, the mixins fail when called from within media directives.

I'd like to suggest a reversal of the current strategy, where the mixins call @extend. Instead, the @extends should call the mixins.

So from this:

%display-flex {
    display: -webkit-box;
    display: -moz-box;
    display: -webkit-flexbox;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
}
@mixin display-flex() {
    @extend %display-flex;
}

to this:

@mixin display-flex() {
    display: -webkit-box;
    display: -moz-box;
    display: -webkit-flexbox;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
}
%display-flex {
    @include display-flex();
}
@blainehansen blainehansen changed the title @extend cannot be used from within @media @extend cannot be used from within @media Mar 29, 2017
@zessx
Copy link
Owner

zessx commented Mar 30, 2017

Althought I would recommand to use Autoprefixer instead of Sass-flexbox, I think this is a really good idea, as it does not even change users' habits.
I'll take a little time to think about eventual regressions.

@zessx zessx self-assigned this Mar 30, 2017
blainehansen added a commit to blainehansen/sass-flexbox that referenced this issue Aug 8, 2017
…y around; sass is used instead of scss; space-evenly was added to justify-content and align-content; general refactoring and cleaning for DRY code; bumped to 2.0.0 (since there are major api changes), and added blaine hansen to contributors list; changed readme to reflect
zessx added a commit that referenced this issue Aug 16, 2017
#3: Proposal to make compatible with sass `@media`. Other refactors and improvements.
@zessx
Copy link
Owner

zessx commented Aug 16, 2017

Fixed with 7aa9e06

@zessx zessx closed this as completed Aug 16, 2017
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