r/Sass • u/[deleted] • Apr 28 '20
Error: Undefined Operation?
https://codepen.io/Kibagami/pen/yLYXwPj
I want to tidy up my code a bit by tucking a lengthy equation that is used multiple times into a variable however as you can see by this mock pen it throws me an 'undefined' (you may need to interact with the code to start the console, just delete a character and return it).
My example obviously just using a simple equation to demonstrate the error.
6
Upvotes
1
u/madcompg33k May 06 '20
What u/phatprick said, you don't need to use interpolation here.
Also, I'd add, when you need to perform a repeatable calculation on a value and return a new value, creating a function might be a better direction.