Sha256: 282726093523fb49259bdf1dedc6008bcb67868b2c4c806d973889f06a01cf8b

Contents?: true

Size: 1.35 KB

Versions: 24

Compression:

Stored size: 1.35 KB

Contents

# declaration-block-no-shorthand-property-overrides

Disallow shorthand properties that override related longhand properties.

<!-- prettier-ignore -->
```css
a { background-repeat: repeat; background: green; }
/**                            ↑
 * This overrides the longhand property before it */
```

In almost every case, this is just an authorial oversight. For more about this behavior, see [MDN's documentation of shorthand properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties).

## Options

### `true`

The following patterns are considered violations:

<!-- prettier-ignore -->
```css
a {
  padding-left: 10px;
  padding: 20px;
}
```

<!-- prettier-ignore -->
```css
a {
  transition-property: opacity;
  transition: opacity 1s linear;
}
```

<!-- prettier-ignore -->
```css
a {
  -webkit-transition-property: opacity;
  -webkit-transition: opacity 1s linear;
}
```

<!-- prettier-ignore -->
```css
a {
  border-top-width: 1px;
  top: 0;
  bottom: 3px;
  border: 2px solid blue;
}
```

The following patterns are _not_ considered violations:

<!-- prettier-ignore -->
```css
a { padding: 10px; padding-left: 20px; }
```

<!-- prettier-ignore -->
```css
a { transition-property: opacity; } a { transition: opacity 1s linear; }
```

<!-- prettier-ignore -->
```css
a { transition-property: opacity; -webkit-transition: opacity 1s linear; }
```

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
trusty-cms-6.3.1 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-5.0.7 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-5.0.6 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-5.0.5 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-5.0.4 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-5.0.3 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-5.0.2 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-5.0.1 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-4.3.5 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-5.0.0 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-4.3.4 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-4.3.3 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-4.3.2 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-4.3.1 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-4.3 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-4.2.3 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-4.2.2 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-4.2.1 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-4.2 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md
trusty-cms-4.1.9 node_modules/stylelint/lib/rules/declaration-block-no-shorthand-property-overrides/README.md