Skip to content

Instantly share code, notes, and snippets.

@blessdyb
Created February 20, 2014 05:42
Show Gist options
  • Save blessdyb/9107656 to your computer and use it in GitHub Desktop.
Save blessdyb/9107656 to your computer and use it in GitHub Desktop.
CSS Mixin in LESS
.opacity (@opacity) {
@opacityPercentage: @opacity * 100;
opacity: @opacity;
-ms-filter: ~"progid:DXImageTransform.Microsoft.Alpha(opacity=(@{opacityPercentage}))";
filter: ~"alpha(opacity = (@{opacityPercentage}))";
}
.border-radius(@radius) {
border-radius: @radius;
-moz-border-radius: @radius;
-webkit-border-radius: @radius;
}
.placeholder(@color) {
::-webkit-input-placeholder { /* WebKit browsers */
color: @color;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: @color;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: @color;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
color: @color;
}
}
.nowrap {
white-space: nowrap;
}
.longname() {
.nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.inline-block {
display: -moz-inline-stack;
display: inline-block;
zoom: 1;
*display: inline;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment