Skip to content

Instantly share code, notes, and snippets.

@mreq
Created April 14, 2014 15:51
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 mreq/10660206 to your computer and use it in GitHub Desktop.
Save mreq/10660206 to your computer and use it in GitHub Desktop.
mreq less mixins
@bf: @font-size-base;
@bl: @line-height-computed;
@br: @border-radius-base;
.wh(@width, @height) {
width: @width;
height: @height;
}
.sq(@s) {
.square(@s);
}
.rounded(@radius: @br) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
-ms-border-radius: @radius;
border-radius: @radius;
}
.topleft(@top: 0, @left: 0) {
position: absolute;
top: @top;
left: @left;
right: auto;
bottom: auto;
}
.topright(@top: 0, @right: 0) {
position: absolute;
top: @top;
left: auto;
right: @right;
bottom: auto;
}
.bottomleft(@bottom: 0, @left: 0) {
position: absolute;
top: auto;
left: @left;
right: auto;
bottom: @bottom;
}
.bottomright(@bottom: 0, @right: 0) {
position: absolute;
top: auto;
left: auto;
right: @right;
bottom: @bottom;
}
.ic(@icoHeight: 16px) {
position: absolute;
top: 50%;
margin-top: -0.5 * @icoHeight;
}
.il(@icoWidth: 16px) {
position: absolute;
left: 50%;
margin-left: -0.5 * @icoWidth;
}
.icl(@icoWidth: 16px, @icoHeight: @icoWidth) {
.ic(@icoHeight);
left: 50%;
margin-left: -0.5 * @icoWidth;
}
.icr(@icoWidth: 16px, @icoHeight: 16px) {
.ic(@icoHeight);
right: 50%;
margin-right: -0.5 * @icoWidth;
}
.fsize(@fontSize: @bf, @lineHeight: round(@fontSize*@bl/@bf)) {
font-size: @fontSize;
line-height: @lineHeight;
}
.no-transition() {
.transition(none 0s);
}
.ib() {
display: inline-block;
.ie7-inline-block;
}
.ul() {
margin: 0;
padding-left: 0;
> li {
padding-left: 0;
list-style: none;
display: block;
}
}
.placeholder-color(@color) {
&::-webkit-input-placeholder { color: @color; }
&:-moz-placeholder { color: @color; }
&::-moz-placeholder { color: @color; }
&:-ms-input-placeholder { color: @color; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment