Skip to content

Commit

Permalink
[Sass] Update the docs for @warn and related functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseppstein committed Apr 11, 2010
1 parent c3c7b8c commit c42d9d9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
10 changes: 10 additions & 0 deletions doc-src/SASS_CHANGELOG.md
Expand Up @@ -5,6 +5,16 @@

## 3.0.0.beta.2 (Unreleased)

### `@warn`

A new directive `@warn` has been added that allows sass libraries to emit warnings. This can be used to issue deprecation warnings, discourage sloppy coding, etc.
`@warn` takes a single argument that is a SassScript expression that will be
displayed on the console along with a stylesheet trace.

Warnings may be silenced with the new `--quiet` command line option,
or the corresponding `:quiet` Sass option. Warnings are off by default
in Rails and Merb production environments.

### `sass-convert`

#### `--recursive`
Expand Down
20 changes: 18 additions & 2 deletions doc-src/SASS_REFERENCE.md
Expand Up @@ -287,6 +287,9 @@ Available options are:
Currently, this just means that strings in mixin arguments
are treated as though they were in [an `=` context](#sass-script-strings).

{#quiet-option} `:quiet`
: When set to true, causes warnings to be disabled.

## CSS Extensions

### Nested Rules
Expand Down Expand Up @@ -898,8 +901,7 @@ and `_colors.scss` would be imported.
The `@debug` directive prints the value of a SassScript expression
to the standard error output stream.
It's useful for debugging Sass files
that have complicated SassScript going on,
or for printing warnings in libraries.
that have complicated SassScript going on.
For example:

@debug 10em + 12em;
Expand All @@ -908,6 +910,20 @@ outputs:

Line 1 DEBUG: 22em

### `@warn`

The `@warn` directive prints the value of a SassScript expression
to the standard error output stream.
It's useful for libraries that need to warn users of deprecations
or recovering from minor coding mistakes. There are two major distinctions
between `@warn` and `@debug`:

1. You can turn warnings off with the `--quiet` command-line option
or the `:quiet` Sass option.
2. A stylesheet trace will be printed out along with the message
so that the user being warned can see where they are calling from
their code.

## Control Directives

SassScript supports basic control directives
Expand Down

0 comments on commit c42d9d9

Please sign in to comment.