Permalink
Browse files

Doc updates relating to the variable scoping of style blocks.

  • Loading branch information...
1 parent 25bc305 commit 3c8a7ebe8d17f996f10b968ebe93a62a09addfd4 @chriseppstein chriseppstein committed Sep 13, 2011
Showing with 15 additions and 3 deletions.
  1. +3 −3 doc-src/SASS_CHANGELOG.md
  2. +12 −0 doc-src/SASS_REFERENCE.md
@@ -5,8 +5,8 @@
## 3.2.0 (Unreleased)
-* A mixin include can now accept a block of styles that will be passed to the mixin
- and can be placed at the point @children is used. E.g.:
+* A mixin include can now accept a block of styles ({file:SASS_REFERENCE.md#mixin-children Reference Documentation}).
+ The style block will be passed to the mixin and can be placed at the point @children is used. E.g.:
@mixin iphone {
@media only screen and (max-width: 480px) {
@@ -35,7 +35,7 @@
}
Note that the contents passed to the mixin are evaluated in the scope they are used,
- not the scope of the mixin.
+ not the scope of the mixin. {file:SASS_REFERENCE.md#variable_scope_and_style_blocks More on variable scoping.}
### Backwards Incompatibilities -- Must Read!
View
@@ -1873,6 +1873,18 @@ Compiles to:
border-color: blue;
}
+Additionally, this makes it clear that the variables and mixins that are used within the
+passed block are related to the other styles around where the block is defined. For example:
+
+ #sidebar {
+ $sidebar-width: 300px;
+ width: $sidebar-width;
+ @include iphone {
+ width: $sidebar-width / 3;
+ }
+ }
+
+
## Function Directives {#functions}
It is possible to define your own functions in sass and use them in any

0 comments on commit 3c8a7eb

Please sign in to comment.