What happens when you combine the fact that part after the :
for CSS Custom Properties doesn’t need to be valid CSS with window.getComputedStyle()
? You get a way of passing data – including Arrays, Objects, and even JSON – from CSS to JavaScript.
Psst… Hey kid…
Did you know you can pass data from your CSS to your JS with CSS variables… including JSON data?https://t.co/7sbVo72vgU
— Shaw (@shshaw) March 27, 2020
Leave a comment