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

Allow null or false breakpoints to output styles without media query #165

Open
amiuhle opened this issue Apr 12, 2016 · 0 comments
Open

Comments

@amiuhle
Copy link

amiuhle commented Apr 12, 2016

I write the following simple helper mixin to just output the @content without any media query if it is passed false.

@mixin optional-breakpoint($breakpoint) {
  @if $breakpoint {
    @include breakpoint($breakpoint) {
      @content;
    }
  } @else {
    @content;
  }
}

What I'm doing is loop over a list of attributes, eg $h1: ((false, 20px, 24px, normal), ($tablet, 34px, 40px, -1px), ($desktop, 38px, 45px, -2px)). Using the helper mixin, I can just loop over the list and call the mixin, not caring about whether I actually want a media query or just the styles.

Am I missing something or is this really not possible without the helper mixin at the moment?

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

1 participant