Diagnostics
LUM3019: Unit separated from a $ reference
A unit is written after a numeric $ reference with whitespace in between, so it does not attach to the number.
Severity: warning · Category: styles (3xxx)
Reported by: the CSS compiler (lumiose_css), in @lumiose/vite, lumiose check and the language server. A warning; the CSS is emitted unchanged.
#What it means
A $ reference ends at the end of its name, so the unit must be separated from it: with
const gap = 8, margin: $gap px becomes margin: 8 px, a number followed by the keyword px.
CSS units must follow their number without whitespace, so browsers ignore the declaration.
($gappx would read a constant named gappx.)
#Example
const gap = 8;
<style>
.card {
margin: $gap px;
padding: calc($gap px + 1px);
}
</style>