Skip to content

Commit

Permalink
Merge pull request #1708 from Swissbite/master
Browse files Browse the repository at this point in the history
Updated Readme for full examples
  • Loading branch information
lukeapage committed Dec 8, 2013
2 parents 49a0e81 + d5105e3 commit f37047d
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ a:hover {
Mixins enable you to apply the styles of one selector inside another selector like this:

```less
// Variables
@link-color: #428bca;

// Any "regular" class...
.link {
color: @link-color;
Expand Down Expand Up @@ -144,6 +147,13 @@ Mixins can also accept parameters:
used like this:

```less
// Variables
@link-color: #428bca;
@link-color-hover: darken(@link-color, 10%);

//Transiation mixin would be anywhere here


a {
font-weight: bold;
color: @link-color;
Expand Down Expand Up @@ -176,6 +186,9 @@ a:hover {
The `extend` feature can be thought of as the _inverse_ of mixins. It accomplishes the goal of "borrowing styles", but rather than copying all the rules of _Selector A_ over to _Selector B_, `extend` copies the name of the _inheriting selector_ (_Selector B_) over to the _extending selector_ (_Selector A_). So continuing with the example used for [mixins](#mixins) above, extend works like this:

```less
// Variables
@link-color: #428bca;

.link {
color: @link-color;
}
Expand All @@ -195,6 +208,10 @@ renders to:
.link, a {
color: #428bca;
}

a {
font-weight: bold;
}
```

## Usage
Expand Down Expand Up @@ -332,4 +349,4 @@ Licensed under the [Apache License](LICENSE).
[so]: http://stackoverflow.com/questions/tagged/twitter-bootstrap+less "StackOverflow.com"
[issues]: https://github.com/less/less.js/issues "GitHub Issues for Less.js"
[wiki]: https://github.com/less/less.js/wiki "The official wiki for Less.js"
[download]: https://github.com/less/less.js/zipball/master "Download Less.js"
[download]: https://github.com/less/less.js/zipball/master "Download Less.js"

0 comments on commit f37047d

Please sign in to comment.