Skip to content

Instantly share code, notes, and snippets.

@hileon
Forked from chrisgaunt/mixins.less
Created March 27, 2012 04:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hileon/2212449 to your computer and use it in GitHub Desktop.
Save hileon/2212449 to your computer and use it in GitHub Desktop.
LESS CSS Mixins
.box-shadow(@x: 0, @y: 1px, @blur: 1px, @color: #000) {
box-shadow: @x @y @blur @color;
-moz-box-shadow: @x @y @blur @color;
-webkit-box-shadow: @x @y @blur @color;
}
.inset-box-shadow(@x: 0, @y: 1px, @blur: 1px, @color: #000) {
box-shadow: inset @x @y @blur @color;
-moz-box-shadow: inset @x @y @blur @color;
-webkit-box-shadow: inset @x @y @blur @color;
}
.text-shadow(@x: 1px, @y: 1px, @blur: 1px, @color: #fff, @opacity: 70) {
text-shadow: @x @y @blur-radius @color;
filter: ~"glow(color=@color,strength=@blur), alpha(opacity=@opacity)"; // IE
}
.border-radius(@radius:6px) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
.border-radius-top-right(@radius: 6px) {
-webkit-border-top-right-radius: @radius;
-moz-border-radius-topright: @radius;
border-top-right-radius: @radius;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
.border-radius-top-left(@radius: 6px) {
-webkit-border-top-left-radius: @radius;
-moz-border-radius-topleft: @radius;
border-top-left-radius: @radius;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
.border-radius-bottom-right(@radius: 6px) {
-webkit-border-bottom-right-radius: @radius;
-moz-border-radius-bottomright: @radius;
border-bottom-right-radius: @radius;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
.border-radius-bottom-left(@radius: 6px) {
-webkit-border-bottom-left-radius: @radius;
-moz-border-radius-bottomleft: @radius;
border-bottom-left-radius: @radius;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment