Skip to content

Files

Latest commit

 

History

History
52 lines (35 loc) · 984 Bytes

declaration-property-max-values.md

File metadata and controls

52 lines (35 loc) · 984 Bytes

Pattern: Too many property values in declaration

Issue: -

Description

Limit the number of values for a list of properties within declarations.

Examples

If a property name is surrounded with "/" (e.g. "/^margin/"), it is interpreted as a regular expression. This allows, for example, easy targeting of shorthands: /^margin/ will match margin, margin-top, margin-inline, etc.

Given:

{
  "border": 2,
  "/^margin/": 1,
},

The following patterns are considered violations:

a { border: 1px solid blue; }
a { margin: 1px 2px; }
a { margin-inline: 1px 2px; }

The following patterns are not considered violations:

a { border: 1px solid; }
a { margin: 1px; }
a { margin-inline: 1px; }

Further Reading