$screen-xs: 480px; $screen-sm: 768px; $screen-md: 992px; $screen-lg: 1200px; $screen-xs-max: ($screen-sm - 1); $screen-sm-max: ($screen-md - 1); $screen-md-max: ($screen-lg - 1); @mixin xs-only { @media (max-width: $screen-sm - 1) { @content; } } @mixin xs-only-land { @media (max-width: $screen-sm - 1) and (orientation: landscape) { @content; } } @mixin xs-only-port { @media (max-width: $screen-sm - 1) and (orientation: portrait) { @content; } } @mixin sm-only { @media (min-width: $screen-sm) and (max-width: $screen-sm-max) { @content; } } @mixin md-only { @media (min-width: $screen-md) and (max-width: $screen-md-max) { @content; } } @mixin lg-only { @media (min-width: $screen-lg) and (max-width: $screen-lg-max) { @content; } } @mixin sm-plus { @media (min-width: $screen-sm) { @content; } } @mixin md-plus { @media (min-width: $screen-md) { @content; } } @mixin lg-plus { @media (min-width: $screen-lg) { @content; } } @mixin sm-minus { @media (max-width: $screen-sm - 1) { @content; } } @mixin md-minus { @media (max-width: $screen-md - 1) { @content; } } @mixin lg-minus { @media (max-width: $screen-lg - 1) { @content; } } .text-center-xs { @include xs-only { text-align: center; } } .img-responsive-sm { @include sm-plus { display: block; height: auto; max-width: 100%; } } .no-mg-t-xs { @include xs-only { margin-top: 0 !important; } } .no-mg-t { margin-top: 0 !important; } .no-mg-b { margin-bottom: 0 !important; } @mixin size($width, $height) { width: $width; height: $height; } @mixin square($size) { width: $size; height: $size; } @mixin vertical-align { display: table-cell; vertical-align: middle; } @mixin center-block { margin-left: auto; margin-right: auto; } @mixin font($size, $line: $size * 1.25) { font-size: floor($size); line-height: floor($line); } @mixin rpadding($padding, $multiplier: 1) { padding: (floor(nth($padding, 1) * $multiplier)) (floor(nth($padding, 2) * $multiplier)) (floor(nth($padding, 3) * $multiplier)) (floor(nth($padding, 4) * $multiplier)); } @mixin image-2x($image, $width, $height) { @media (min--moz-device-pixel-ratio: 1.3), (-o-min-device-pixel-ratio: 2.6/2), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx) { background-image: image_url($image); background-size: $width $height; } } @mixin placeholder($color: $placeholderText) { &:-moz-placeholder { color: $color; } &:-ms-input-placeholder { color: $color; } &::-webkit-input-placeholder { color: $color; } } @mixin rgba-fallback($color, $type, $fallback-bg: false) { @if $fallback-bg != false { #{$type}: rgba(mix(rgba($color, 1), $fallback-bg, opacity($color)*100), 1); } @else { #{$type}: rgba($color, 1); } #{$type}: $color; } @mixin placeholder($color: $placeholderText) { &:-moz-placeholder { color: $color; } &:-ms-input-placeholder { color: $color; } &::-webkit-input-placeholder { color: $color; } } .center-block { @include center-block; }