This rule reports a class field in style(). A class field adds classes that
another stylesheet defines, so Stillwind does not check them. Enable this rule
when every style in the project must come from utilities. No preset enables it.
Reported
.card {
border-radius: 8px;
padding: 16px;
}style({ class: "card" });no-class-property: `class` contributions are forbidden in style objects; use utilities, custom properties, or CSS variantsFixed
@utility card {
border-radius: 8px;
padding: 16px;
}style("card");How to fix
- Move the class’s declarations into a utility, as in the example. Keep the same declarations so the component’s appearance does not change.
- If a third-party library needs its own class, keep the
classfield and add a suppression comment with the reason.
Rule settings
| Preset | Severity |
|---|---|
recommended | off |
strict | off |
stylistic | off |
Configure lint to change the severity or options.