Sha256: 7f01f3c5738220cfd3d5008d1224c7229b290bc480aba14d36f15e5e42255b0b

Contents?: true

Size: 1.04 KB

Versions: 24

Compression:

Stored size: 1.04 KB

Contents

# dollar-variable-colon-space-before

Require a single space or disallow whitespace before the colon in `$`-variable declarations.

```scss
$variable: 10px;
/**      ↑
 * The space before this colon */
```

The `--fix` option on the [command line](https://github.com/stylelint/stylelint/blob/master/docs/user-guide/cli.md#autofixing-errors) can automatically fix all of the problems reported by this rule.

## Options

`string`: `"always"|"never"

### `"always"`

There *must always* be a single space before the colon.

The following patterns are considered warnings:

```scss
a { $var: 10px }
```

```scss
$var:10px;
```

```scss
$var  :10px;
```

```scss
$var
:10px;
```

The following patterns are *not* considered warnings:

```scss
a { $var : 10px }
```

```scss
$var :10px;
```

### `"never"`

There *must never* be whitespace before the colon.

The following patterns are considered warnings:

```scss
$var :10px;
```

```scss
a { $var
:10px }
```

The following patterns are *not* considered warnings:

```scss
$var:10px;
```

```scss
a { $var: 10px }
```

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
trusty-cms-6.3.1 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-5.0.7 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-5.0.6 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-5.0.5 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-5.0.4 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-5.0.3 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-5.0.2 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-5.0.1 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-4.3.5 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-5.0.0 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-4.3.4 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-4.3.3 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-4.3.2 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-4.3.1 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-4.3 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-4.2.3 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-4.2.2 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-4.2.1 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-4.2 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md
trusty-cms-4.1.9 node_modules/stylelint-scss/src/rules/dollar-variable-colon-space-before/README.md