Skip to content

Instantly share code, notes, and snippets.

@mariselli
Last active April 22, 2016 08:43
Show Gist options
  • Save mariselli/f4661b9c10ca950190b8e379599aad3d to your computer and use it in GitHub Desktop.
Save mariselli/f4661b9c10ca950190b8e379599aad3d to your computer and use it in GitHub Desktop.
/*
RESPONSIVE MIXINS based on bootstrap breakponts
*/
@mixin mobile() {
@media (max-width: $screen-xs-max) {
@content;
}
}
@mixin notMobile() {
@media (min-width: $screen-sm-min ){
@content;
}
}
@mixin tablet($how:'only') {
@if $how == 'only' {
@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) {
@content;
}
}
@if $how == 'up' {
@media (min-width: $screen-sm-min) {
@content;
}
}
@if $how == 'down' {
@media (max-width: $screen-sm-max) {
@content;
}
}
@if $how != 'only' and $how != 'up' and $how != 'down' {
//@error "mixin tablet support: only, up, down";
}
}
@mixin desktop($how) {
@if $how == 'only' {
@media (min-width: $screen-md-min) and (max-width: $screen-md-max) {
@content;
}
}
@if $how == 'up' {
@media (min-width: $screen-md-min) {
@content;
}
}
@if $how == 'down' {
@media (max-width: $screen-md-max) {
@content;
}
}
@if $how != 'only' and $how != 'up' and $how != 'down' {
//@error "mixin desktop support: only, up, down";
}
}
@mixin desktopLarge() {
@media (min-width: $screen-lg-min) {
@content;
}
}
@mixin notDesktopLarge() {
@media (max-width: $screen-md-max) {
@content;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment