Prevent breaking maps with list-like CSS values #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
A JSON value for a
font-family
value can contain commas that currently, when output in Sass, break the map, e.g.:…outputs…
Proposed solution
This proposed change wraps list-like strings in parentheses so that the contents don't break the map:
And Sass will convert the list to a normal CSS-valid list without parentheses when used, like so:
…becomes…
Note
A value like
rgb(255,255,255)
contains commas, so technically this fix would also wrap any CSS function with multiple arguments in parentheses, but Sass is forgiving enough that this will output safely.