Skip to content

Instantly share code, notes, and snippets.

@xar
Created April 3, 2015 22:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xar/8a3b0f67d17424f05ecc to your computer and use it in GitHub Desktop.
Save xar/8a3b0f67d17424f05ecc to your computer and use it in GitHub Desktop.
less responsive mixin
/* Responsive hack - Bootstrap */
@screen-xs: 300px;
@screen-xs-min: @screen-xs;
@screen-phone: @screen-xs-min;
// Small screen / tablet
// Note: Deprecated @screen-sm and @screen-tablet as of v3.0.1
@screen-sm: 620px;
@screen-sm-min: @screen-sm;
@screen-tablet: @screen-sm-min;
// Medium screen / desktop
// Note: Deprecated @screen-md and @screen-desktop as of v3.0.1
@screen-md: 992px;
@screen-md-min: @screen-md;
@screen-desktop: @screen-md-min;
// Large screen / wide desktop
// Note: Deprecated @screen-lg and @screen-lg-desktop as of v3.0.1
@screen-lg: 1500px;
@screen-lg-min: @screen-lg;
@screen-lg-desktop: @screen-lg-min;
// So media queries don't overlap when required, provide a maximum
@screen-xs-max: (@screen-sm-min - 1);
@screen-sm-max: (@screen-md-min - 1);
@screen-md-max: (@screen-lg-min - 1);
@xs: ~'(min-width: @{screen-xs-min}) and (max-width: @{screen-xs-max})';
@sm: ~'(min-width: @{screen-xs-min}) and (max-width: @{screen-sm-max})';
//@md: ~'(min-width: @{screen-md-min}) and (max-width: @{screen-md-max})';
@lg: ~'(min-width: @{screen-md-min})';
img.responsive{
@media @sm{
max-width:100%;height:auto;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment