styled-jsx-plugin-sass
styled-jsx-plugin-sass copied to clipboard
[Bug] Variables in calc() cannot be compiled
Steps To Reproduce
- Use a variable inside a calc() function
The current behavior
A compile error Error: Expected "(" or ".".
is thrown:
The expected behavior
No compile error.
I have created a minimal test repository with two calc cases:
git clone [email protected]:uncaught/styled-jsx-sass-var-in-calc-issue.git
cd styled-jsx-sass-var-in-calc-issue/
npm install
npm start
These usages of variables in calc() work with node-sass
and styled-jsx-plugin-sass
.
Did you find any solution/workaround for this?
No, unfortunately not. I had to downgrade back to node-sass and styled-jsx-plugin-sass.
You can create a constant like this const styles = calc( 100vh - ${variable1} - ${variable2})
, in order to workaround this issue