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

Drop custom "wider-than" mixin for Neat's "media" mixin. #121

Closed
gregrickaby opened this issue Nov 23, 2015 · 5 comments
Closed

Drop custom "wider-than" mixin for Neat's "media" mixin. #121

gregrickaby opened this issue Nov 23, 2015 · 5 comments

Comments

@gregrickaby
Copy link
Contributor

Neat's media mixin supports: variables, min-width, max-width, etc... basically any media query can be passed through.

By default, @include media() uses min-width so:

This would be the normal WDS workflow

Sass

.foo {
    @include media($tablet-landscape) {
         color: $color-black;
    }
}

CSS

@media screen and (min-width: 64rem) {
    .foo {
       color: #000;
    }
}

Plain 'ol pixels

Sass

.foo {
    @include media(768px) {
         color: $color-black;
    }
}

CSS

@media screen and (min-width: 768px) {
    .foo {
       color: #000;
    }
}

Use max-width

Sass

.foo {
    @include media(max-width 768px) {
       color: $color-black;
    }
}

CSS

@media screen and (max-width: 768px) {
    .foo {
       color: #000;
    }
}

Combine both min and max widths using variables

Sass

.foo {
    @include media(min-width $phone-portrait max-width $phone-landscape) {
       color: $color-black;
    }
}

CSS

@media screen and (min-width: 22.5rem) and (max-width: 40rem) {
    .foo {
       color: #000;
    }
}

See it in action here: http://neat.bourbon.io/examples/

@aubreypwd
Copy link
Contributor

+1 Also would fix #117 as the sizes would be a variable.

@colorful-tones
Copy link
Contributor

+1

@efuller
Copy link
Contributor

efuller commented Nov 23, 2015

+1 on this!

@coreymcollins
Copy link
Contributor

FO. SHO. Let's do iiiiitttt

@bezierer
Copy link
Contributor

+1 here!

This was referenced Nov 25, 2015
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

6 participants