list.separator($list) returns the name of the separator used by $list as an unquoted string: space, comma, or slash. Load it with @use "sass:list" on Dart Sass 1.23+.
Official docs: if $list has no separator, the result is space (singles and empty lists). Legacy global name: list-separator() — not bare separator().
Returns space, comma, or slash as an unquoted name.
No separator defaults to space (singles / empty lists).
Force shapes with join $separator or list.slash.
Prefer list.separator after @use "sass:list".
One line: when you need to know how a list is separated, call list.separator($list).
Practice
Compile Notes
Practical checklist:
checklist.txt
1. @use "sass:list"
2. Compare with == space / == comma / == slash
3. Remember singles/empty default to space
4. Use list.slash() when you need a slash list
5. Check is-bracketed separately from separator
Frequently Asked Questions
list.separator($list) returns the separator name used by $list: space, comma, or slash. Example: list.separator(1px 2px 3px) is space; list.separator((1px, 2px, 3px)) is comma.
Official docs: if $list doesn’t have a separator, the function returns space. That covers single values and empty lists.
Build a slash-separated list with list.slash(...), then list.separator will report slash. Example: list.separator(list.slash(1px, 50px, 100px)) is slash.
The modern module API is list.separator(). The legacy global function is list-separator($list)—not separator() alone.
No. Brackets and separators are independent. list.is-bracketed checks […]; list.separator checks space/comma/slash.
Built-in modules with @use need Dart Sass 1.23+. LibSass and Ruby Sass do not load sass:list the same way—use list-separator() there if you must.