Skip to content

Instantly share code, notes, and snippets.

@andyfowler
Created November 16, 2010 17:50
Show Gist options
  • Save andyfowler/702156 to your computer and use it in GitHub Desktop.
Save andyfowler/702156 to your computer and use it in GitHub Desktop.
Used in less.js
/* ===================================== */
/* = Some less.js mixins from Nutshell = */
/* ===================================== */
.rounded-corners (@radius: 5px) {
border-radius: @radius;
-moz-border-radius: @radius;
-webkit-border-radius: @radius;
}
.drop-shadow (@x:0, @y:1px, @feather:1px, @color:#fff) {
box-shadow: @x @y @feather @color;
-moz-box-shadow: @x @y @feather @color;
-webkit-box-shadow: @x @y @feather @color;
}
.inner-shadow (@x:0, @y:1px, @feather:1px, @color:#fff) {
box-shadow: inset @x @y @feather @color;
-moz-box-shadow: inset @x @y @feather @color;
-webkit-box-shadow: inset @x @y @feather @color;
}
.gradient(@from: #ffffff, @to: #000000) {
background: ((@from + @to) / 2);
background-image: -webkit-gradient(linear, left top, left bottom, from(@from), to(@to));
background-image: -moz-linear-gradient(@from, @to);
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr=%d, endColorstr=%d)", @from, @to));
-ms-filter: %("progid:DXImageTransform.Microsoft.gradient(startColorstr=%d, endColorstr=%d)", @from, @to);
zoom: 1;
}
.non-ie-gradient(@from: #ffffff, @to: #000000) {
background: ((@from + @to) / 2);
background-image: -webkit-gradient(linear, left top, left bottom, from(@from), to(@to));
background-image: -moz-linear-gradient(@from, @to);
}
.inline-block {
display: inline-block;
zoom: 1;
*display: inline;
}
// prevent mobile browsers to prevent scaling the element's text up
.no-text-resize{
-webkit-text-size-adjust:none;
-ms-text-size-adjust:none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment