diff --git a/doc-src/SASS_CHANGELOG.md b/doc-src/SASS_CHANGELOG.md index 3469c952e2..f48e0688cf 100644 --- a/doc-src/SASS_CHANGELOG.md +++ b/doc-src/SASS_CHANGELOG.md @@ -20,6 +20,12 @@ it's possible that some properties will break. If this happens, please report it to [the Sass mailing list](http://groups.google.com/group/haml). +* In addition, setting the default value of variables + with `||=` is now deprecated + and will be removed in Sass 3.2. + Instead, add `!default` to the end of the value. + See also [this changelog entry](#3-0-0-default-flag) + * The `!` prefix for variables is deprecated, and will be removed in Sass 3.2. Use `$` as a prefix instead. @@ -130,6 +136,17 @@ is compiled to: height: 250px; margin-left: 9px; } +##### Variable Defaults + +Since `=` is no longer used for variable assignment, +assigning defaults to variables with `||=` no longer makes sense. +Instead, the `!default` flag +should be added to the end of the variable value. +This syntax is meant to be similar to CSS's `!important` flag. +For example: + + $var: 12px !default + #### Variable Prefix Character {#3-0-0-dollar-prefix} diff --git a/doc-src/SASS_REFERENCE.md b/doc-src/SASS_REFERENCE.md index c0cf0522c6..b88f09cdff 100644 --- a/doc-src/SASS_REFERENCE.md +++ b/doc-src/SASS_REFERENCE.md @@ -957,19 +957,20 @@ is compiled to: p.foo { border-color: blue; } -### Optional Assignment: `||:` +### Variable Defaults: `!default` You can assign to variables if they aren't already assigned -using the `||:` assignment operator. This means that if the -variable has already been assigned to, it won't be re-assigned, +by adding the `!default` flag to the end of the value. +This means that if the variable has already been assigned to, +it won't be re-assigned, but if it doesn't have a value yet, it will be given one. For example: {.sass-ex} $content: "First content" - $content ||: "Second content?" - $new_content ||: "First time reference" + $content: "Second content?" !default + $new_content: "First time reference" !default #main content: $content @@ -977,8 +978,8 @@ For example: {.scss-ex} $content: "First content"; - $content ||: "Second content?"; - $new_content ||: "First time reference"; + $content: "Second content?" !default; + $new_content: "First time reference" !default; #main { content: $content;