Property declarations style matching elements—same idea as CSS. Sass adds SassScript values, nested property names, interpolated names, and special rules for CSS custom properties.
Any SassScript value.
width: $size; and border-radius: $size * 0.5; are evaluated before CSS is emitted.
One line: declarations are CSS properties with Sass superpowers—expressions, nested names, and careful custom-property injection.
Practice
Compile Notes
Practical checklist:
checklist.txt
1. Use variables / math in declaration values
2. Nest shared prefixes (font-, margin-, transition-)
3. Interpolate dynamic property names with #{}
4. Pass null to omit optional declarations
5. For --custom properties, inject Sass only via #{}
Frequently Asked Questions
Like CSS, they set how matching elements look (color, width, and so on). Sass lets the value be any SassScript expression, and adds nesting, interpolation, and smarter custom-property parsing.
Write a shared prefix once, then nest the rest. transition: { property: font-size; } becomes transition-property: font-size. You can also set a shorthand and nest longhands under it.
Yes. Interpolate with #{ } in the property name, for example -#{$prefix}-#{$property}: $value; or even #{$property}: $value;
If the value is null or an empty unquoted string, Sass does not emit that declaration.
Values are passed through almost as raw CSS. SassScript is not evaluated unless you use interpolation. So --x: $primary; keeps the text $primary; use --x: #{$primary}; to inject the variable.
Interpolation strips quotes from strings. Use meta.inspect($value) inside #{ } so quoted strings stay quoted in the CSS custom property.