Convert css variables into sass
Hi,
I'm learning sass and I was wondering how can I write this code in sass?
--item-color
is what gives me most trouble to write in sass.
Taken from Kevin gh (https://github.com/kevin-powell/results-summary-component-main)
6 Replies
Well, if you don't mind me asking, any reason you would want to? I love SCSS and use it all the time, but CSS variables are native and work well
Something like this?
Like croganm said, I'd keep them as custom props, though you could have them as sass variables if you really wanted to
That's a good middle ground and how SASS should be used. That way you can use the functionality of SASS but keep the CSS Variables
Just finished this project from frontend mentor, then watched video from Kevin. Just wondered how I could do it in sass. Another lesson learned that I could mix both.
Btw really nice vid @kevinpowell so much to learn from this project made by you. Please don't stop doing this series 😉
@croganm I'm learning and trying different approaches to css, sass etc.
I made sth like this:
but does not work 😦
How can I make it work having my colors in separate
_colors.scss
file, not in :root
?Think I get it slowly:
Bit overhelming atm 🙂