stylelint-value-shorthand

A stylelint custom rule to enforce use of shorthand values

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
stylelint-value-shorthand
131.0.18 years ago8 years agoMinified + gzip package size for stylelint-value-shorthand in KB

Readme

stylelint-value-shorthand
Build Status
A stylelint custom rule to enforce use of shorthand values.
This rule will cause stylelint to warn you whenever an the preferred convention is not used.

Installation

npm install stylelint-value-shorthand

This plugin is compatible with v5.0.1+.

Details

a { /* OK */
  margin: 0
}

a { /* Not OK */
  margin: 0 0 0 0
}
a { /* OK */
  border-color: $gray $blue $black
}

a { /* Not OK */
  border-color: $gray $blue $black $blue
}

This rule applies to properties which are able to be written in shorthand.

border-color
border-radius
border-style
border-width
margin
padding

Usage

Add "stylelint-value-shorthand" to your stylelint config plugins array, then add value-shorthand to your rules, set to true.
As follows:
{
  "plugins": [
    "stylelint-value-shorthand"
  ],
  "rules": {
    "value-shorthand": true
  }
};