Configure which units are allowed for property values.
By default a value may have any kind of unit. You can adjust which units are
allowed globally by setting the global option. Alternately, you can specify a
list of units for a single property by adding it to the properties option,
e.g.
PropertyUnits:
global: ['em', 'rem', '%'] # Allow relative units globally
properties:
border: ['px'] # Only pixels
line-height: [] # No units allowed
margin: ['em', 'rem']With the above configuration, the following issues would be reported:
p {
border: 1rem solid blue; // rem not in `border` list
line-height: 55px; // px not in `line-height` list
padding: 10px; // px not in `global` list
margin: 10%; // % not in `margin` list
}| Configuration Option | Description |
|---|---|
global |
List of allowed units (by default any unit is allowed) |
properties |
Hash of property names and their list of allowed units. (empty by default) |