sparkbox / splinter

🐭 Parse and split SCSS files based on functions and mixins.
2 stars 0 forks source link

feat: Handle nested Sass variables #27

Closed zastrow closed 4 years ago

zastrow commented 4 years ago

One issue (#26) that has been around for a while, but hasn't really caused an issue until recently attempting to retroactively add Splinter to a project. When a Sass variable is nested within a selector block, it is retained in the selector it is created, however the scoping is lost to the former children of the nesting and causes Sass errors of undefined variables.

This PR adds in postcss-nested-vars which handles this very situation by applying and rendering those uses of the variable before passing it along to the subsequent parsers.