lesshat
Version:
The most advanced LESS mixins library
1,667 lines (1,066 loc) • 82.1 kB
Markdown
<!---
If you want to edit README file, please do it in README-template.md.
README.md file is automatically generated.
{{ documentation }} syntax is replaced by all mixins documentation from mixins folder
-->
# lesshat [](https://travis-ci.org/madebysource/lesshat)
 
---
**[Download latest](https://registry.npmjs.org/lesshat/-/lesshat-4.1.0.tgz) |**
**[Get Started](#get-started) |**
**[Introduction](#intro) |**
**[Contribute](#contribute) |**
**[Documentation](#documentation) |**
---
### Current version: v4.1.0 (2016-07-19)
## <a name="get-started"></a> Get started
To use lesshat, you need [node/npm installed](https://nodejs.org/) then run `npm install lesshat --save` to install and save lesshat into your package.json. From here, you just need to reference the `node_modules/lesshat/lesshat.less` file within any of your project less files. You can also use the prefixed version available at `node_module/lesshat/lesshat-prefixed.less` if you're worried about mixin name conflicts with other library.
### Bower
As of version 4, lesshat has removed support for Bower by removing the build folder from the repository. [There are many reasons that Bower is considered inadequate for dependency management](https://medium.com/@nickheiner/why-my-team-uses-npm-instead-of-bower-eecfe1b9afcb) and since people already use npm for dependency management simply to install Bower, another dependency manager, it felt a bit redundant.
Even if Bower isn't supported, it can still be used with the tarball uploaded to npm. You can add the dependency to your bower.json file like this:
```
"dependencies": {
"lesshat": "https://registry.npmjs.org/lesshat/-/lesshat-4.0.1.tgz"
}
```
You can also use the command line to install it by running `bower install lesshat=https://registry.npmjs.org/lesshat/-/lesshat-4.0.1.tgz --save`.
After that, you can reference the less file directly the same way as the npm version with a slight path difference. The only downside is that bower will not update automatically because it doesn't support semantic versioning with files.
*You should really consider using npm instead of bower.*
## <a name="intro"></a> Introduction
Why lesshat? In August 2012, while we were developing and extending [CSS Hat](www.madebysource.com) for LESS we needed universal mixins. Unfortunately, none of available were good enough that would satisfy our needs and that’s why we created new custom ones on our own, which have become the most popular mixin library for the whole LESS CSS.
Meet the best mixins library in the world.
### Features
* **No restrictions** – If it's possible in CSS, it must be possible to be done with a mixin. Unlimited number of anything, shadows, gradients, gradient swatches.
* **Standard naming convention** – In lesshat, mixins have names like all CSS3 properties. No `.rounded` or `.shadow`. It's stupid.
* **Cross-browser** – lesshat takes care of exporting CSS for all available browsers.
* **Bootstrap friendly** – You can now use prefixed lesshat version and gaily work with Bootstrap. Yeah it's that easy.
* **Keyframes** – Although it's tricky as hell, but yeah lesshat has mixin for `.keyframes`
* **Blank state ready** – If you call mixin without any arguments, lesshat does not pollute your CSS with empty properties. Instead lesshat generates nothing.
* **Workflow** – **No more one line editing!** We created developer friendly worklow for editing and creating mixins. You can test mixins with [MOCHA](http://visionmedia.github.io/mocha/), generate new mixin with [GRUNT](http://gruntjs.com/). Find out more about the workflow in **[contribution](#contribution)** section.
### Structure of lesshat mixins
1. **Typical lesshat mixin**:
.supermixin(...) {
@process: ~`(function(){})()`;
-webkit-border-radius: @process;
border-radius: @process;
}
In @process variable is all magic. Please don't edit javascript directly in .less file. Instead use [lesshat-devstack](https://github.com/madebysource/lesshat-devstack).
2. **Use (almost) every property without interpolation!**
Correct mixin calling:
.background-image(linear-gradient(to bottom, #fb83fa 0%,#e93cec 100%))
Incorrect calling:
.background-image(~'linear-gradient(to bottom, #fb83fa 0%,#e93cec 100%)')
Unfortunately, there are exceptions:
.keyframes(~'');
.calc(~'');
.selection(~'');
// in some cases you have to interpolate border-radius or LESS CSS begins to play on calculator
.border-radius(~'20px / 40px');
## <a name="contribute"></a> Contribute:
1. Fork this repo
2. run `npm install`
3. If you create new mixin, please add tests and documentation on how to use it
4. Always test your changes and make sure that the documentation is being added to the README.md by running `grunt`
6. Finally, commit your changes and create a pull request
## <a name="documentation"></a> Documentation:
### List of mixins:
1. **[align-content](#align-content)** `flexbox`
2. **[align-items](#align-items)** `flexbox`
3. **[align-self](#align-self)** `flexbox`
4. **[animation](#animation)**
5. **[animation-delay](#animation-delay)**
6. **[animation-direction](#animation-direction)**
7. **[animation-duration](#animation-duration)**
8. **[animation-fill-mode](#animation-fill-mode)**
9. **[animation-iteration-count](#animation-iteration-count)**
10. **[animation-name](#animation-name)**
11. **[animation-play-state](#animation-play-state)**
12. **[animation-timing-function](#animation-timing-function)**
13. **[appearance](#appearance)**
14. **[backface-visibility](#backface-visibility)**
15. **[background-clip](#background-clip)**
16. **[background-image](#background-image)**
17. **[background-origin](#background-origin)**
18. **[background-size](#background-size)**
19. **[blur](#blur)** `filter`
20. **[border-bottom-left-radius](#border-bottom-left-radius)**
21. **[border-bottom-right-radius](#border-bottom-right-radius)**
22. **[border-image](#border-image)**
23. **[border-radius](#border-radius)**
24. **[border-top-left-radius](#border-top-left-radius)**
25. **[border-top-right-radius](#border-top-right-radius)**
26. **[box-shadow](#box-shadow)**
27. **[box-sizing](#box-sizing)**
28. **[brightness](#brightness)** `filter`
29. **[calc](#calc)**
29. **[column-count](#column-count)**
30. **[column-gap](#column-gap)**
31. **[column-rule](#column-rule)**
32. **[column-width](#column-width)**
33. **[columns](#columns)**
34. **[contrast](#contrast)** `filter`
35. **[display](#display)** `flexbox`
36. **[drop-shadow](#drop-shadow)** `filter`
37. **[filter](#filter)**
38. **[flex](#flex)** `flexbox`
39. **[flex-basis](#flex-basis)** `flexbox`
40. **[flex-direction](#flex-direction)** `flexbox`
41. **[flex-grow](#flex-grow)** `flexbox`
42. **[flex-shrink](#flex-shrink)** `flexbox`
43. **[flex-wrap](#flex-wrap)** `flexbox`
44. **[font-face](#font-face)**
45. **[grayscale](#grayscale)** `filter`
46. **[hue-rotate](#hue-rotate)** `filter`
47. **[hyphens](#hyphens)**
47. **[invert](#invert)** `filter`
48. **[justify-content](#justify-content)** `flexbox`
49. **[keyframes](#keyframes)**
50. **[opacity](#opacity)**
51. **[order](#order)**
52. **[perspective](#perspective)**
53. **[perspective-origin](#perspective-origin)**
54. **[placeholder](#placeholder)**
55. **[rotate](#rotate)** `transform`
56. **[rotate3d](#rotate3d)** `transform`
57. **[rotateX](#rotateX)** `transform`
58. **[rotateY](#rotateY)** `transform`
59. **[rotateZ](#rotateZ)** `transform`
60. **[saturate](#saturate)** `filter`
61. **[scale](#scale)** `transform`
62. **[scale3d](#scale3d)** `transform`
63. **[scaleX](#scaleX)** `transform`
64. **[scaleY](#scaleY)** `transform`
65. **[scaleZ](#scaleZ)** `transform`
66. **[selection](#selection)**
67. **[sepia](#sepia)** `filter`
68. **[size](#size)** `width, height`
69. **[skew](#skew)** `transform`
70. **[skewX](#skewX)** `transform`
71. **[skewY](#skewY)** `transform`
72. **[transform](#transform)**
73. **[transform-origin](#transform-origin)**
74. **[transform-style](#transform-style)**
75. **[transition](#transition)**
76. **[transition-delay](#transition-delay)**
77. **[transition-duration](#transition-duration)**
78. **[transition-property](#transition-property)**
79. **[transition-timing-function](#transition-timing-function)**
80. **[translate](#translate)** `transform`
81. **[translate3d](#translate3d)** `transform`
82. **[translateX](#translateX)** `transform`
83. **[translateY](#translateY)** `transform`
84. **[translateZ](#translateZ)** `transform`
85. **[user-select](#user-select)**
***
### <a name="align-content"></a> • align-content
**Summary:**
The CSS align-content property aligns a flex container's lines within the flex container when there is an extra space on the cross-axis. This property has no effect on the single line flexible boxes.
Resources: **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/align-content)**, **[CSS-Tricks](http://css-tricks.com/almanac/properties/a/align-content/)**
**Syntax:**
Default value: stretch
.align-content(flex-start | flex-end | center | space-between | space-around | stretch)
**Example:**
div {
.align-content(flex-start);
}
// Result
div {
-webkit-align-content: flex-start;
-ms-flex-line-pack: start;
align-content: flex-start;
}
### <a name="align-items"></a> • align-items
**Summary:**
The CSS align-items property aligns flex items of the current flex line the same way as justify-content but in the perpendicular direction.
Resources: **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/align-items)**, **[CSS-Tricks](http://css-tricks.com/almanac/properties/a/align-items/)**
**Syntax:**
Default value: stretch
.align-items(flex-start | flex-end | center | baseline | stretch)
**Example:**
div {
.align-items(flex-start);
}
// Result
div {
-webkit-box-align: flex-start;
-moz-box-align: start;
-webkit-align-items: start;
-ms-flex-align: flex-start;
align-items: flex-start;
}
### <a name="align-self"></a> • align-self
**Summary:**
The align-self CSS property aligns flex items of the current flex line overriding the align-items value. If any of the flex item's cross-axis margin is set to auto, then align-self is ignored.
Resources: **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/align-self)**, **[CSS-Tricks](http://css-tricks.com/almanac/properties/a/align-self/)**
**Syntax:**
Default value: auto
.align-self(auto | flex-start | flex-end | center | baseline | stretch)
**Example:**
div {
.align-self(flex-start);
}
// Result
div {
-webkit-align-self: flex-start;
-ms-flex-item-align: start;
align-self: flex-start;
}
### <a name="animation"></a> • animation
**Summary:**
Shorthand to define a CSS animation, setting all parameters at once.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/animation/animation)**, **[CSS3files](http://www.css3files.com/animation/)**
**Syntax:**
Default value: none
.animation(animation-name | animation-duration | animation-timing-function | animation-delay | animation-iteration-count | animation-direction | animation-fill-mode , […]*)
**Example:**
div {
.animation(nameAnimation 2s linear alternate);
}
// Result
div {
-webkit-animation: nameAnimation 2s linear alternate;
-moz-animation: nameAnimation 2s linear alternate;
-o-animation: nameAnimation 2s linear alternate;
animation: nameAnimation 2s linear alternate;
}
### <a name="animation-delay"></a> • animation-delay
**Summary:**
Defines a length of time to elapse before an animation starts, allowing an animation to begin execution some time after it is applied.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/animation-delay)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-delay)**
**Syntax:**
Default value: 0
.animation-delay(<time>, …)
**Tips and tricks:**
If you omit units after time argument, `animation-delay` is trying to be smart and add properly value.
if (time > 10) {
time += 'ms';
} else {
time += 's';
}
**Example:**
div {
.animation-delay(2, 200);
}
// Result
div {
-webkit-animation-delay: 2s, 200ms;
-moz-animation-delay: 2s, 200ms;
-o-animation-delay: 2s, 200ms;
animation-delay: 2s, 200ms;
}
### <a name="animation-direction"></a> • animation-direction
**Summary:**
The animation-direction CSS property indicates whether the animation should play in reverse on alternate cycles.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/animation-direction)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-direction)**
**Syntax:**
Default value: normal
.animation-direction(<single-animation-direction>, …)
**Example:**
div {
.animation-direction(reverse, alternate);
}
// Result
div {
-webkit-animation-direction: reverse, alternate;
-moz-animation-direction: reverse, alternate;
-o-animation-direction: reverse, alternate;
animation-direction: reverse, alternate;
}
### <a name="animation-duration"></a> • animation-duration
**Summary:**
The animation-duration CSS property specifies the length of time that an animation should take to complete one cycle.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/animation-duration)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-duration)**
**Syntax:**
Default value: 0
.animation-duration(<time>, …)
**Tips and tricks:**
If you omit units after time argument, `animation-duration` is trying to be smart and add proper value.
if (time > 10) {
time += 'ms';
} else {
time += 's';
}
**Example:**
div {
.animation-duration(2000);
}
// Result
div {
-webkit-animation-duration: 2000ms;
-moz-animation-duration: 2000ms;
-o-animation-duration: 2000ms;
animation-duration: 2000ms;
}
### <a name="animation-fill-mode"></a> • animation-fill-mode
**Summary:**
The animation-fill-mode CSS property specifies how a CSS animation should apply styles to its target before and after it is executing.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/animation-fill-mode)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-fill-mode)**
**Syntax:**
Default value: none
.animation-fill-mode(<single-animation-fill-mode>, …)
**Example:**
div {
.animation-fill-mode(forwards);
}
// Result
div {
-webkit-animation-fill-mode: forwards;
-moz-animation-fill-mode: forwards;
-o-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
### <a name="animation-iteration-count"></a> • animation-iteration-count
**Summary:**
The animation-iteration-count CSS property specifies how a CSS animation should apply styles to its target before and after it is executing.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/animation-iteration-count)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-iteration-count)**
**Syntax:**
Default value: 1
.animation-iteration-count(<single-animation-iteration-count>, …)
**Example:**
div {
.animation-iteration-count(3);
}
// Result
div {
-webkit-animation-iteration-count: 3;
-moz-animation-iteration-count: 3;
-o-animation-iteration-count: 3;
animation-iteration-count: 3;
}
### <a name="animation-name"></a> • animation-name
**Summary:**
The animation-name CSS property specifies a list of animations that should be applied to the selected element. Each name indicates a @keyframes at-rule that defines the property values for the animation sequence.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/animation-name)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-name)**
**Syntax:**
Default value: none
.animation-name(<single-animation-name>, …)
**Example:**
div {
.animation-name(animation-1, animation-2);
}
// Result
div {
-webkit-animation-name: animation-1, animation-2;
-moz-animation-name: animation-1, animation-2;
-o-animation-name: animation-1, animation-2;
animation-name: animation-1, animation-2;
}
### <a name="animation-play-state"></a> • animation-play-state
**Summary:**
The animation-play-state CSS property determines whether an animation is running or paused. You can query this property's value to determine whether or not the animation is currently running; in addition, you can set its value to pause and resume playback of an animation.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/animation-play-state)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-play-state)**
**Syntax:**
Default value: running
.animation-play-state(<single-animation-play-state>, …)
**Example:**
div {
.animation-play-state(paused);
}
// Result
div {
-webkit-animation-play-state: paused;
-moz-animation-play-state: paused;
-o-animation-play-state: paused;
animation-play-state: paused;
}
### <a name="animation-timing-function"></a> • animation-timing-function
**Summary:**
The animation-timing-function CSS property determines whether an animation is running or paused. You can query this property's value to determine whether or not the animation is currently running; in addition, you can set its value to pause and resume playback of an animation.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/animation-timing-function)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/animation-timing-function)**
**Syntax:**
Default value: ease
.animation-timing-function(<single-animation-timing-function>, …)
**Example:**
div {
.animation-timing-function(cubic-bezier(0.1, 0.7, 1.0, 0.1));
}
// Result
div {
-webkit-animation-timing-function: cubic-bezier(0.1, 0.7, 1.0, 0.1);
-moz-animation-timing-function: cubic-bezier(0.1, 0.7, 1.0, 0.1);
-o-animation-timing-function: cubic-bezier(0.1, 0.7, 1.0, 0.1);
animation-timing-function: cubic-bezier(0.1, 0.7, 1.0, 0.1);
}
### <a name="appearance"></a> • appearance
**Summary:**
Allows changing the style of any element to platform-based interface elements or vice versa.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/appearance)**, **[CSS-Tricks](http://css-tricks.com/almanac/properties/a/appearance/)**
**Syntax:**
Default value: none
.appearance(<appearance>)
**Example:**
div {
.appearance();
}
// Result
div {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
### <a name="backface-visibility"></a> • backface-visibility
**Summary:**
The CSS backface-visibility property determines whether or not the back face of the element is visible when facing the user. The back face of an element always is a transparent background, letting, when visible, a mirror image of the front face be displayed.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/backface-visibility)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/backface-visibility)**
**Syntax:**
Default value: none
.backface-visibility(visible | hidden )
**Example:**
div {
.backface-visibility(hidden);
}
// Result
div {
-webkit-backface-visibility: none;
-moz-backface-visibility: none;
-ms-backface-visibility: none;
-o-backface-visibility: none;
backface-visibility: none;
}
### <a name="background-clip"></a> • background-clip
**Summary:**
The background-clip CSS property specifies whether an element's background, either the color or image, extends underneath its border.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/background-clip)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip)**
**Syntax:**
Default value: border-box
.background-clip(<box>)
**Example:**
div {
.background-clip(padding-box);
}
// Result
div {
-webkit-background-clip: padding-box;
-moz-background-clip: padding-box;
background-clip: padding-box;
}
### <a name="background-image"></a> • background-image
**Summary:**
With the background-image you can create prefixed linear or radial gradients. The CSS (linear|radial)-gradient() function creates an `<image>` which represents a linear|radial gradient of colors. The result of this function is an object of the CSS `<gradient>` data type. Like any other gradient, a CSS linear gradient is not a CSS `<color>` but an image with no intrinsic dimensions; that is, it has neither natural or preferred size, nor ratio. Its concrete size will match the one of the element it applies to.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/functions/linear-gradient)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient)**
**Syntax:**
Default value: none
.background-image(<gradient>, ...)
**Tips and tricks:**
The `background-image` mixin is the most robust mixin of all.
It generates `SVG` for Internet Explorer 9, old webkit, moz and opera syntax.
Always use W3C syntax for the mixin. It can recalculate angle for older syntax, transform `to top` to `bottom` syntax and it can omit SVG syntax if it's impossible to express SVG e.g. when you call mixin with 55deg.
If you call mixin without arguments, LESS Hat does not generate anything.
Great online gradient [generator](http://www.colorzilla.com/gradient-editor/).
**Example:**
div {
.background-image(linear-gradient(to bottom, #fb83fa 0%,#e93cec 100%));
}
// Result
div {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMSAxIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJub25lIj48bGluZWFyR3JhZGllbnQgaWQ9Imxlc3NoYXQtZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiNmYjgzZmEiIHN0b3Atb3BhY2l0eT0iMSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2U5M2NlYyIgc3RvcC1vcGFjaXR5PSIxIi8+PC9saW5lYXJHcmFkaWVudD48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2xlc3NoYXQtZ2VuZXJhdGVkKSIgLz48L3N2Zz4=);
background-image: -webkit-linear-gradient(top, #fb83fa 0%, #e93cec 100%);
background-image: -moz-linear-gradient(top, #fb83fa 0%, #e93cec 100%);
background-image: -o-linear-gradient(top, #fb83fa 0%, #e93cec 100%);
background-image: linear-gradient(to bottom, #fb83fa 0%, #e93cec 100%);
}
### <a name="background-origin"></a> • background-origin
**Summary:**
The background-origin CSS property determines the background positioning area, that is the position of the origin of an image specified using the background-image CSS property.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/background-origin)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/background-origin)**
**Syntax:**
Default value: padding-box
.background-origin(<box>)
**Example:**
div {
.background-origin(content-box);
}
// Result
div {
-webkit-background-origin: content-box;
-moz-background-origin: content-box;
background-origin: content-box;
}
### <a name="background-size"></a> • background-size
**Summary:**
The background-size CSS property specifies the size of the background images. The size of the image can be fully constrained or only partially in order to preserve its intrinsic ratio.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/background-size)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size)**
**Syntax:**
Default value: auto auto
.background-size(<bg-size>, ...)
**Tips and tricks:**
If you omit units, `background-size` adds `px` automatically.
**Example:**
div {
.background-size(cover, 100%);
}
// Result
div {
-webkit-background-size: cover, 100%;
-moz-background-size: cover, 100%;
background-size: cover, 100%;
}
### <a name="blur"></a> • blur (shorthand for filter property)
**Summary:**
Applies a Gaussian blur to the input image. The value of ‘radius’ defines the value of the standard deviation to the Gaussian function, or how many pixels on the screen blend into each other, so a larger value will create more blur. If no parameter is provided, then a value 0 is used. The parameter is specified as a CSS length, but does not accept percentage values.
Resources: **<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/filter#blur()">MDN</a>**
**Syntax:**
Default value: 0
.blur(length)
**Tips and tricks:**
If you omit units, `blur` adds `px` automatically.
**Example:**
div {
.blur(5px);
}
// Result
div {
-webkit-filter: blur(5px);
-moz-filter: blur(5px);
-ms-filter: blur(5px);
filter: blur(5px);
}
### <a name="border-bottom-left-radius"></a> • border-bottom-left-radius
**Summary:**
The border-bottom-left-radius CSS property sets the rounding of the bottom-left corner of the element. The rounding can be a circle or an ellipse, or if one of the value is 0 no rounding is done and the corner is square.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/border-radius)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-left-radius)**
**Syntax:**
Default value: 0
.border-bottom-left-radius(length | percentage)
**Tips and tricks:**
If you omit units, `border-bottom-left-radius` adds `px` automatically.
If you want to use syntax like `10px \ 5px`, you have to interpolate argument `~''` or LESS CSS divides it (yeah awesome feature!).
Also LESS Hat adds `background-clip: padding-box`, because it fixes problem with older Safari. Here is some [resource](http://tumble.sneak.co.nz/post/928998513/fixing-the-background-bleed).
**Example:**
div {
.border-bottom-left-radius(10px);
}
// Result
div {
-webkit-border-bottom-left-radius: 10px;
-moz-border-radius-bottomleft: 10px;
border-bottom-left-radius: 10px;
}
### <a name="border-bottom-right-radius"></a> • border-bottom-right-radius
**Summary:**
The border-bottom-right-radius CSS property sets the rounding of the bottom-left corner of the element. The rounding can be a circle or an ellipse, or if one of the value is 0 no rounding is done and the corner is square.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/border-radius)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-right-radius)**
**Syntax:**
Default value: 0
.border-bottom-right-radius(length | percentage)
**Tips and tricks:**
If you omit units, `border-bottom-right-radius` adds `px` automatically.
If you want to use syntax like `10px \ 5px`, you have to interpolate argument `~''` or LESS CSS divides it (yeah awesome feature!).
Also LESS Hat adds `background-clip: padding-box`, because it fixes problem with older Safari. Here is some [resource](http://tumble.sneak.co.nz/post/928998513/fixing-the-background-bleed).
**Example:**
div {
.border-bottom-right-radius(10px);
}
// Result
div {
-webkit-border-bottom-right-radius: 10px;
-moz-border-radius-bottomright: 10px;
border-bottom-right-radius: 10px;
}
### <a name="border-image"></a> • border-image
**Summary:**
The border-image CSS property allows drawing an image on the borders of elements. This makes drawing complex looking widgets much simpler than it has been and removes the need for nine boxes in some cases.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/border-radius)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-image)**
**Syntax:**
Default value: based on individual properties
.border-image(border-image-source border-image-slice border-image-width border-image-outset border-image-repeat)
**Tips and tricks:**
If you call mixin without arguments, LESS Hat does not generate anything.
Good border-image online [generator](http://border-image.com/).
**Example:**
div {
.border-image(url(border.png) 61 45 62 54 repeat);
}
// Result
div {
-webkit-border-image: url(border.png) 61 45 62 54 repeat;
-moz-border-image: url(border.png) 61 45 62 54 repeat;
-o-border-image: url(border.png) 61 45 62 54 repeat;
border-image: url(border.png) 61 45 62 54 repeat;
}
### <a name="border-radius"></a> • border-radius
**Summary:**
The border-radius CSS property allows Web authors to define how rounded border corners are. The curve of each corner is defined using one or two radii, defining its shape: circle or ellipse.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/border-radius)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius)**
**Syntax:**
Default value: 0
.border-radius(length | percentage | length / length | percentage / percentage)
**Tips and tricks:**
If you omit units, `border-radius` adds `px` automatically.
If you want to use syntax like `10px \ 5px`, you have to interpolate argument `~''` or LESS CSS divides it (yeah awesome feature!).
Also LESS Hat adds `background-clip: padding-box`, because it fixes problem with older Safari. Here is some [resource](http://tumble.sneak.co.nz/post/928998513/fixing-the-background-bleed).
**Example:**
div {
.border-radius(5px);
}
// Result
div {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
### <a name="border-top-left-radius"></a> • border-top-left-radius
**Summary:**
The border-top-left-radius CSS property sets the rounding of the top-left corner of the element. The rounding can be a circle or an ellipse, or if one of the value is 0 no rounding is done and the corner is square.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/border-top-left-radius)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-left-radius)**
**Syntax:**
Default value: 0
.border-top-left-radius(length | percentage)
**Tips and tricks:**
If you omit units, `border-top-left-radius` adds `px` automatically.
If you want to use syntax like `10px \ 5px`, you have to interpolate argument `~''` or LESS CSS divides it (yeah awesome feature!).
Also LESS Hat adds `background-clip: padding-box`, because it fixes problem with older Safari. Here is some [resource](http://tumble.sneak.co.nz/post/928998513/fixing-the-background-bleed).
**Example:**
div {
.border-top-left-radius(5px);
}
// Result
div {
-webkit-border-top-left-radius: 5px;
-moz-border-top-left-radius: 5px;
border-top-left-radius: 5px;
}
### <a name="border-top-right-radius"></a> • border-top-right-radius
**Summary:**
The border-top-right-radius CSS property sets the rounding of the top-right corner of the element. The rounding can be a circle or an ellipse, or if one of the value is 0 no rounding is done and the corner is square.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/border-top-right-radius)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-right-radius)**
**Syntax:**
Default value: 0
.border-top-right-radius(length | percentage)
**Tips and tricks:**
If you omit units, `border-top-right-radius` adds `px` automatically.
If you want to use syntax like `10px \ 5px`, you have to interpolate argument `~''` or LESS CSS divides it (yeah awesome feature!).
Also LESS Hat adds `background-clip: padding-box`, because it fixes problem with older Safari. Here is some [resource](http://tumble.sneak.co.nz/post/928998513/fixing-the-background-bleed).
**Example:**
div {
.border-top-right-radius(5px);
}
// Result
div {
-webkit-border-top-right-radius: 5px;
-moz-border-top-right-radius: 5px;
border-top-right-radius: 5px;
}
### <a name="box-shadow"></a> • box-shadow
**Summary:**
The box-shadow CSS property describes one or more shadow effects as a comma-separated list. It allows casting a drop shadow from the frame of almost any element. If a border-radius is specified on the element with a box shadow, the box shadow takes on the same rounded corners. The z-ordering of multiple box shadows is the same as multiple text shadows (the first specified shadow is on top).
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/box-shadow)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow)**
**Syntax:**
Default value: none
.box-shadow(<offset-x> <offset-y> spread blur-radius color inset, …)
**Tips and tricks:**
If you omit units, `box-shadow` adds `px` automatically.
**Example:**
div {
.box-shadow(0 1px 10px rgba(20,20,20,0.5));
}
// Result
div {
-webkit-box-shadow: 0 1px 10px rgba(20,20,20,0.5);
-moz-box-shadow: 0 1px 10px rgba(20,20,20,0.5);
box-shadow: 0 1px 10px rgba(20,20,20,0.5);
}
### <a name="box-sizing"></a> • box-sizing
**Summary:**
The box-sizing CSS property is used to alter the default CSS box model used to calculate widths and heights of elements. It is possible to use this property to emulate the behavior of browsers that do not correctly support the CSS box model specification.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/box-sizing)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing)**
**Syntax:**
Default value: content-box
.box-sizing(content-box | padding-box | border-box)
**Example:**
div {
.box-sizing(padding-box);
}
// Result
div {
-webkit-box-sizing: padding-box;
-moz-box-sizing: padding-box;
box-sizing: padding-box;
}
### <a name="brightness"></a> • brightness (shorthand for filter property)
**Summary:**
Applies a linear multiplier to input image, making it appear more or less bright. A value of 0% will create an image that is completely black. A value of 100% leaves the input unchanged. Other values are linear multipliers on the effect. Values of an amount over 100% are allowed, providing brighter results. If the ‘amount’ parameter is missing, a value of 100% is used.
Resources: **<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/filter#brightness()">MDN</a>**
**Syntax:**
Default value: 0
.brightness(amount)
**Example:**
div {
.brightness(0.5);
}
// Result
div {
-webkit-filter: brightness(0.5);
-moz-filter: brightness(0.5);
-ms-filter: brightness(0.5);
filter: brightness(0.5);
}
### <a name="calc"></a> • calc
**Summary:**
The calc() CSS function can be used anywhere a `<length>`, `<frequency>`, `<angle>`, `<time>`, `<number>`, or `<integer>` is required.With calc(), you can perform calculations to determine CSS property values.
**THIS MIXIN MUST BE INTERPOLATED ~''**
The `-lh-property: 0` junk line of code is a neccesary sacrifice due to the hack nature of this set of mixins. (via [less-properties](https://github.com/borodean/less-properties))
Resources: **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/calc)**
**Syntax:**
.calc(<element>, ~'<expression>')
**Example:**
div {
.calc(width, ~'100% - 33px');
}
// Result
div {
-lh-property: 0;
width:-webkit-calc(100% - 33px);
width:-moz-calc(100% - 33px);
width:calc(100% - 33px);
}
### <a name="column-count"></a> • column-count
**Summary:**
The column-count CSS property describes the number of columns of the element.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/column-count)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/column-count)**
**Syntax:**
Default value: auto
.column-count(<number> | auto)
**Example:**
div {
.column-count(3);
}
// Result
div {
-webkit-column-count: 0.5;
-moz-column-count: 0.5;
column-count: 0.5;
}
### <a name="column-gap"></a> • column-gap
**Summary:**
The column-gap CSS property sets the size of the gap between columns for elements which are specified to display as a multi-column element.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/column-gap)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap)**
**Syntax:**
Default value: normal
.column-gap(<length> | normal)
**Tips and tricks:**
If you omit units, `column-gap` adds `px` automatically.
**Example:**
div {
.column-gap(30);
}
// Result
div {
-webkit-column-gap: 30px;
-moz-column-gap: 30px;
column-gap: 30px;
}
### <a name="column-rule"></a> • column-rule
**Summary:**
In multi-column layouts, the column-rule CSS property specifies a straight line, or "rule", to be drawn between each column.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/column-rule)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/column-rule)**
**Syntax:**
Default value: medium none black
.column-rule(<column-rule-width> | <column-rule-style> | <column-rule-color>)
**Tips and tricks:**
If you omit units, `column-rule` adds `px` automatically.
**Example:**
div {
.column-rule(5 outset #ff00ff);
}
// Result
div {
-webkit-column-rule: 5px outset #ff00ff;
-moz-column-rule: 5px outset #ff00ff;
column-rule: 5px outset #ff00ff;
}
### <a name="column-width"></a> • column-width
**Summary:**
The column-width CSS property suggests an optimal column width. This is not a absolute value but a mere hint. Browser will adjust the width of the column around that suggested value, allowing to achieve scalable designs that fit different screen size.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/column-width)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/column-width)**
**Syntax:**
Default value: auto
.column-width(<length> | auto)
**Tips and tricks:**
If you omit units, `column-width` adds `px` automatically.
**Example:**
div {
.column-width(100px);
}
// Result
div {
-webkit-column-width: 100px;
-moz-column-width: 100px;
column-width: 100px;
}
### <a name="columns"></a> • columns
**Summary:**
The columns CSS property is a shorthand property allowing to set both the column-width and the column-count properties at the same time.
Resources: **[WebPlatform](http://docs.webplatform.org/wiki/css/properties/columns)**, **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/columns)**
**Syntax:**
Default value: auto
.columns(<column-width> | <column-count>)
**Tips and tricks:**
If you omit units for column-width argument, `columns` adds `px` to it automatically.
**Example:**
div {
.columns(100 3);
}
// Result
div {
-webkit-columns: 100px 3;
-moz-columns: 100px 3;
columns: 100px 3;
}
### <a name="contrast"></a> • contrast
**Summary:**
Adjusts the contrast of the input. A value of 0% will create an image that is completely black. A value of 100% leaves the input unchanged. Values of amount over 100% are allowed, providing results with less contrast. If the ‘amount’ parameter is missing, a value of 100% is used.
Resources: **<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/filter#contrast()">MDN</a>**
**Syntax:**
Default value: 100%
.contrast(<amount>)
**Tips and tricks:**
If you omit units, `contrast` adds `%` automatically.
**Example:**
div {
.contrast(200);
}
// Result
div {
-webkit-filter: contrast(200%);
-moz-filter: contrast(200%);
-ms-filter: contrast(200%);
filter: contrast(200%);
}
### <a name="display"></a> • display
**Summary:**
The display CSS property specifies the type of rendering box used for an element. This mixin is specifically for flexbox purpose.
Resources: **[CSS-Tricks](http://css-tricks.com/snippets/css/a-guide-to-flexbox/)**
**Syntax:**
.display(<flex> | <inline-flex>)
**Example:**
div {
.display(flex);
}
// Result
div {
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: -moz-box;
}
### <a name="drop-shadow"></a> • drop-shadow
**Summary:**
Applies a drop shadow effect to the input image. A drop shadow is effectively a blurred, offset version of the input image's alpha mask drawn in a particular color, composited below the image.
Resources: **<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/filter#drop-shadow()">MDN</a>**
**Syntax:**
.drop-shadow(<offset-x> <offset-y> [<blur-radius> | <spread-radius> | <color>])
**Tips and tricks:**
If you omit units, `drop-shadow` adds `px` automatically.
**Example:**
div {
.drop-shadow(16 16 10 black);
}
// Result
div {
-webkit-filter: drop-shadow(16px 16px 10px #000000);
-moz-filter: drop-shadow(16px 16px 10px #000000);
-ms-filter: drop-shadow(16px 16px 10px #000000);
filter: drop-shadow(16px 16px 10px #000000);
}
### <a name="filter"></a> • filter
**Summary:**
The CSS filter property provides for effects like blurring or color shifting on an element’s rendering before the element is displayed. Filters are commonly used to adjust the rendering of an image, a background, or a border.
Resources: **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/filter)**
**Syntax:**
Default value: none
.filter(<filter-function>*)
**Example:**
div {
.filter(grayscale(0.5) blur(10px));
}
// Result
div {
-webkit-filter: grayscale(0.5) blur(10px);
-moz-filter: grayscale(0.5) blur(10px);
-ms-filter: grayscale(0.5) blur(10px);
filter: grayscale(0.5) blur(10px);
}
### <a name="flex"></a> • flex
**Summary:**
The flex CSS property specifies ability of a flex item to alter their dimensions to fill the available space. Flex items can be stretched to use available space proportional to their flex grow factor or their flex shrink factor to prevent overflow.
Resources: **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex)**, **[CSS-Tricks](http://css-tricks.com/almanac/properties/f/flex/)**
**Syntax:**
Default value: 0 1 auto
.flex(none | [ <flex-grow> <flex-shrink> | <flex-basis> ])
**Example:**
div {
.flex(1 3 100px);
}
// Result
div {
-webkit-box-flex: 1;
-moz-box-flex: 1;
-webkit-flex: 1 3 100px;
-ms-flex: 1 3 100px;
flex: 1 3 100px;
}
### <a name="flex-basis"></a> • flex-basis
**Summary:**
The CSS flex-basis property specifies the flex basis which is the initial main size of a flex item.
Resources: **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis)**, **[CSS-Tricks](http://css-tricks.com/almanac/properties/f/flex-basis/)**
**Syntax:**
Default value: auto
.flex-basis(<width>)
**Tips and tricks:**
If you omit units, `flex-basis` adds `px` automatically.
**Example:**
div {
.flex-basis(100);
}
// Result
div {
-webkit-flex-basis: 100;
flex-basis: 100px;
}
### <a name="flex-direction"></a> • flex-direction
**Summary:**
The CSS flex-direction property specifies how flex items are placed in the flex container defining the main axis and the direction (normal or reversed).
Resources: **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction)**, **[CSS-Tricks](http://css-tricks.com/almanac/properties/f/flex-direction/)**
**Syntax:**
Default value: row
.flex-direction(row | row-reverse | column | column-reverse)
**Example:**
div {
.flex-direction(row);
}
// Result
div {
-webkit-box-direction: normal;
-moz-box-direction: normal;
-webkit-box-orient: horizontal;
-moz-box-orient: horizontal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
}
### <a name="flex-grow"></a> • flex-grow
**Summary:**
The CSS flex-grow property specifies the flex grow factor of a flex item.
Resources: **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow)**, **[CSS-Tricks](http://css-tricks.com/almanac/properties/f/flex-grow/)**
**Syntax:**
Default value: 0
.flex-grow(<number>)
**Example:**
div {
.flex-grow(2);
}
// Result
div {
-webkit-flex-grow: 2;
flex-grow: 2;
}
### <a name="flex-shrink"></a> • flex-shrink
**Summary:**
The CSS flex-shrink property specifies the flex shrink factor of a flex item.
Resources: **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink)**, **[CSS-Tricks](http://css-tricks.com/almanac/properties/f/flex-shrink/)**
**Syntax:**
Default value: 1
.flex-shrink(<number>)
**Example:**
div {
.flex-shrink(2);
}
// Result
div {
-webkit-flex-shrink: 2;
flex-shrink: 2;
}
### <a name="flex-wrap"></a> • flex-wrap
**Summary:**
The CSS flex-wrap property specifies whether the children are forced into a single line or if the items can be flowed on multiple lines.
Resources: **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap)**, **[CSS-Tricks](http://css-tricks.com/almanac/properties/f/flex-wrap/)**
**Syntax:**
Default value: nowrap
.flex-wrap(nowrap | wrap | wrap-reverse)
**Example:**
div {
.flex-wrap(wrap-reverse);
}
// Result
div {
-webkit-flex-wrap: 2;
-ms-flex-wrap: 2;
flex-wrap: 2;
}
### <a name="font-face"></a> • font-face
**Summary:**
The @font-face CSS at-rule allows authors to specify online fonts to display text on their web pages.
Resources: **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face)**
**Syntax:**
.font-face(@fontname, @fontfile, @fontweight:normal, @fontstyle:normal)
**Example:**
div {
.font-face(Hipster, ~'../fonts/hipster', bold, italic);
}
// Result
div {
font-family: "Hipster";
src: url("../fonts/hipster.eot");
src: url("../fonts/hipster.eot?#iefix") format("embedded-opentype"), url("../fonts/hipster.woff") format("woff"), url("../fonts/hipster.ttf") format("truetype"), url("../fonts/hipster.svg#Hipster") format("svg");
font-weight: bold;
font-style: italic;
}
### <a name="grayscale"></a> • grayscale
**Summary:**
Converts the input image to grayscale. The value of ‘amount’ defines the proportion of the conversion. A value of 100% is completely grayscale. A value of 0% leaves the input unchanged. Values between 0% and 100% are linear multipliers on the effect. If the ‘amount’ parameter is missing, a value of 100% is used.
Resources: **<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/filter#grayscale()">MDN</a>**
**Syntax:**
Default value: 0
.grayscale(<percentage>)
**Tips and tricks:**
If you omit units, `grayscale` adds `%` automatically.
**Example:**
div {
.grayscale(50);
}
// Result
div {
-webkit-filter: grayscale(50%);
-moz-filter: grayscale(50%);
-ms-filter: grayscale(50%);
filter: grayscale(50%);
}
### <a name="hue-rotate"></a> • hue-rotate
**Summary:**
Applies a hue rotation on the input image. The value of ‘angle’ defines the number of degrees around the color circle the input samples will be adjusted. A value of 0deg leaves the input unchanged. If the ‘angle’ parameter is missing, a value of 0deg is used. Maximum value is 360deg.
Resources: **<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/filter#hue-rotate()">MDN</a>**
**Syntax:**
Default value: 0
.hue-rotate(<percentage>)
**Tips and tricks:**
If you omit units, `hue-rotate` adds `deg` automatically.
**Example:**
div {
.hue-rotate(50);
}
// Result
div {
-webkit-filter: hue-rotate(50deg);
-moz-filter: hue-rotate(50deg);
-ms-filter: hue-rotate(50deg);
filter: hue-rotate(50deg);
}
### <a name="hyphens"></a> • hyphens
**Summary:**
The hyphens CSS property tells the browser how to go about splitting words to improve the layout of text when line-wrapping.
Resources: **[MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens)**
**Syntax:**
Default value: manual
.hyphens(none | manual | auto)
**Example:**
div {
.hyphens(none);
}
// Result
div {
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
}
### <a name="inver