Skip to content

Instantly share code, notes, and snippets.

@fliptopbox
Last active August 29, 2015 14:22
Show Gist options
  • Save fliptopbox/7d4750160754d206d145 to your computer and use it in GitHub Desktop.
Save fliptopbox/7d4750160754d206d145 to your computer and use it in GitHub Desktop.
LESS frequently used functions and mixins
// colours
@paleblue: #a0d3f1;
@half: 47%;
// Functions
.fontmuseo (@size: 14px, @color: #FFFFFF, @weight: 500, @style: normal) {
font-family: 'MuseoSans', Arial, sanserif;
font-size: @size;
color: @color;
font-weight: @weight;
font-style: @style;
}
.fontfamily(@px: 18px, @color: red, @weight: normal, @style: normal) {
font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
font-weight: @weight;
font-style: @style;
font-size: @px;
color: @color;
}
.userSelect () {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none; // Unsupported
user-select: none; // Unsupported
}
// Mixin eg. @media @desktop { .... }
@highdensity: ~"only screen and (-webkit-min-device-pixel-ratio: 1.5)",
~"only screen and (min--moz-device-pixel-ratio: 1.5)",
~"only screen and (-o-min-device-pixel-ratio: 3/2)",
~"only screen and (min-device-pixel-ratio: 1.5)";
@mobile: ~"only screen and (max-width: 529px)";
@tablet: ~"only screen and (min-width: 530px) and (max-width: 949px)";
@desktop: ~"only screen and (min-width: 950px) and (max-width: 1128px)";
@desktop-xl: ~"only screen and (min-width: 1129px)";
// Global tag overrides
a {
text-decoration: none;
color: inherit;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment