In our projects, we often encounter repetitive values such as width, color, font, etc. These values can lead to redundancy in our work and make it ...
For further actions, you may consider blocking this person and/or reporting abuse
CSS Variables are definitely one of my favorite new(ish) features in CSS. I don’t even want think back to when they weren’t a thing! 😂
a helpful tip for your future posts, when creating a code block with 3x ticks, if you follow the opening ticks with language you’re using you will get automatic code highlighting
so if you do this…
(without the spaces)
it will turn this…
into this…
keep up the good work! 😀
Oh Wow
Thank you so much for this @wraith
I was looking for a way to do that.
Thanks for reading.
I thought declaring variables in css was only possible through preprocessors such as scss, not knowing this.Great addition to my knowledge. THANKS!
I'm glad you learned something new.
Thanks for reading @mini2809
Well done.
Thank You @karenpayneoregon
What's the purpose of using const changeButton = document.getElementById('button') if the handleClick function is triggered directly from the HTML?
Oh, thanks for your observation. I intended to show the two ways of triggering onclick, but I mistakenly skipped it in the article.
This would definitely help in my smaller projects
Thanks for reading @sandeepkumarkuanar
Does it mean we don't need to use sass for variables in css?
CSS allows you to declare and use variables now.
However, if you have other project requirement that demands using Sass, you can then use Sass, but you don' t need to use sass for variables in CSS.
Thank you for reading @c9hp
Thank you for posting this.
I'm glad you like it @best_happy_0140a4eb45bede