list.append($list, $val, $separator: auto) returns a copy of $list with $val added at the end. Load it with @use "sass:list" on Dart Sass 1.23+. Global alias: append().
Official note: unlike list.join(), if $val is itself a list it is nested inside the result rather than flattened.
Single values count as one-item lists, and maps count as lists of key/value pairs — so append works on those shapes too.
Syntax
Syntax
SCSS
@use "sass:list";
list.append(10px 20px, 30px); // 10px 20px 30px
list.append((blue, red), green); // blue, red, green
list.append(10px 20px, 30px 40px); // 10px 20px (30px 40px)
list.append(10px, 20px, $separator: comma); // 10px, 20px
list.append((blue, red), green, $separator: space); // blue red green
// Global alias still works
append(10px 20px, 30px);
Pattern: grow spacing / color tokens with append → use join only when you want to flatten two lists together.
Reference
Separator & Nest vs Join
How the arguments behave:
Argument / idea
Meaning
$separator: auto
Keep $list’s separator (or space if it has none)
comma / space / slash
Force that separator on the returned list
Nesting
If $val is a list, it becomes one nested item
vs list.join
join flattens two lists; prefer append for one value
Do not use join to “append” one value.
Official docs: if that value is a list, join concatenates it. Use list.append() when you mean “add one item.”
Nests list values — use join only when you want to flatten.
$separator can force comma, space, or slash.
Reassign when growing a variable over multiple steps.
One line: when you need one more item on a list, call list.append($list, $val).
Practice
Compile Notes
Practical checklist:
checklist.txt
1. @use "sass:list"
2. Prefer list.append for a single new item
3. Use list.join only to flatten two lists
4. Pass $separator when you need comma / space / slash
5. Reassign: $list: list.append($list, $val)
Frequently Asked Questions
list.append($list, $val, $separator: auto) returns a copy of $list with $val added at the end. Example: list.append(10px 20px, 30px) is 10px 20px 30px.
append adds one value (and nests it if that value is a list). join concatenates two lists element-by-element. Official docs recommend append when adding a single value.
It sets the returned list’s separator: comma, space, or slash. The default auto keeps $list’s separator (or space if $list has none).
No. Sass lists are immutable for these helpers—you get a new list. Reassign if you want to keep growing a variable: $sizes: list.append($sizes, 30px);
Yes. Global append($list, $val) still works. New projects should prefer list.append() after @use "sass:list".
Built-in modules with @use need Dart Sass 1.23+. LibSass and Ruby Sass do not load sass:list the same way—use the global append() name there if you must.