This rule reports margin, padding, or gap written as an arbitrary value, such as
p-[13px]. The CSS works, but the value is not on your spacing scale. No preset
enables this rule.
Reported
style("p-[13px]");no-arbitrary-spacing: arbitrary spacing `13px` is forbidden for `padding`; use the spacing scale or a custom propertyFixed
@theme {
--spacing-panel: 13px;
}style("p-panel");How to fix
- Give the value a theme name for its role, as in the example. This keeps the same 13px padding while making it available to other components.
- Use an existing spacing value if the design allows a different size.
Options
properties lists more CSS properties to check, in addition to margin, padding,
and gap.
Rule settings
| Preset | Severity |
|---|---|
recommended | off |
strict | off |
stylistic | off |
| Option | Default |
|---|---|
properties | [] |
Configure lint to change the severity or options.