Skip to content

Instantly share code, notes, and snippets.

@tnajdek
Last active January 1, 2016 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tnajdek/8138642 to your computer and use it in GitHub Desktop.
Save tnajdek/8138642 to your computer and use it in GitHub Desktop.
@minimal: 320px;
@small: 480px;
@medium: 768px;
@large: 1024px;
@hd: 1920px;
@upto-minimal : e(%("screen and (max-width: %d)", @minimal));
@upto-small : e(%("screen and (max-width: %d)", @small));
@upto-medium : e(%("screen and (max-width: %d)", @medium));
@upto-large : e(%("screen and (max-width: %d)", @large));
@upto-hd : e(%("screen and (max-width: %d)", @hd));
@from-minimal : e(%("screen and (min-width: %d)", (@minimal + 1)));
@from-small : e(%("screen and (min-width: %d)", (@small + 1)));
@from-medium : e(%("screen and (min-width: %d)", (@medium + 1)));
@from-large : e(%("screen and (min-width: %d)", (@large + 1)));
@from-hd : e(%("screen and (min-width: %d)", (@hd + 1)));
@only-minimal : e(%("screen and (min-width: %d) and (max-width: %d)", (@minimal + 1), @small));
@only-small : e(%("screen and (min-width: %d) and (max-width: %d)", (@small + 1), @medium));
@only-medium : e(%("screen and (min-width: %d) and (max-width: %d)", (@medium + 1), @large));
@only-large : e(%("screen and (min-width: %d) and (max-width: %d)", (@large + 1), @hd));
@only-hd : e(%("screen and (min-width: %d)", (@hd + 1) ));
@tnajdek
Copy link
Author

tnajdek commented Dec 26, 2013

@media @from-small {
    // your screen-size specific properties go here
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment