+ concatenates; quote state follows either-quoted.
Binary - is legacy — prefer #{}.
Non-strings OK (except number/color on the left).
Interpolation is clearer for most string building.
One line: concatenate with +, or prefer #{$value} when clarity matters more.
Practice
Compile Notes
Practical checklist:
checklist.txt
1. Use + for simple concatenation
2. Remember either-quoted => quoted result
3. Avoid binary -; use #{$a}-#{$b}
4. Keep numbers/colors off the left of +
5. Prefer interpolation for readable string building
Frequently Asked Questions
Operators that build strings at compile time. The main one is + for concatenation. There is also a legacy binary - that joins values with a hyphen, plus historical unary / and -.
If either value is a quoted string, the result is quoted; otherwise it is unquoted. Example: "Helvetica" + " Neue" is quoted; sans- + serif is unquoted.
Generally no. Official docs call binary - a legacy operator and recommend interpolation instead, such as #{$a}-#{$b}.
Yes, with most CSS-writable values. Numbers and colors cannot be the left-hand value because they have (or used to have) their own operators. Example: "Elapsed time: " + 10s works.
For historical reasons, / value returns an unquoted string starting with /, and - value returns an unquoted string starting with -. Example: / 15px → /15px, - moz → -moz.
Often yes. Official docs say it is often cleaner and clearer to use interpolation (#{$value}) to create strings rather than relying on these operators.