Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

custom properties css

// get variable from inline style
element.style.getPropertyValue("--my-var");

// get variable from wherever
getComputedStyle(element).getPropertyValue("--my-var");

// set variable on inline style
element.style.setProperty("--my-var", jsVar + 4);
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #custom #properties #css
ADD COMMENT
Topic
Name
8+9 =