Skip to content

Commit

Permalink
Updated Readme for full examples
Browse files Browse the repository at this point in the history
Most users and testers would just copy paste the examples. So I added the variables to the small examples itself that it would be testable for anyone.
  • Loading branch information
David Daester committed Dec 3, 2013
1 parent a2081fb commit d5105e3
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 d5105e3

Please sign in to comment.