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.
What:
Allow random object interpolations.
Why:
Using polished, etc...
How:
Change the way random interpolations work. Random interpolations have a key like this
`$${indexOfInterpolation}`
and the value is whatever was interpolated.
I changed
replacePlaceholdersWithExpressions
so things where the whole thing is a single interpolation the value is replaced with the expression so that objects aren't cast to strings.Checklist:
This also changes from
postcss-safe-parser/lib/safe-parser
topostcss/lib/parser
. This basically means semicolons are required and errors with code frames are thrown if they're not there. (The code frames look pretty weird since there is one from postcss and another from babel)We could support interpolating regular classes anywhere but IMO regular classes should be interpolated in composes because otherwise specificity won't make sense. e.g. the color of this class with be green.
I added back the error for composes on nested selectors since we can't do anything if a regular class is interpolated on a nested selector and people can use random interpolations where they would want composes on a nested selector.