Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react get css root variables

:root{
    --light-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
 // react 
const cssVar = getComputedStyle(document.documentElement)
			   .getPropertyValue('--light-shadow');
console.log(cssVar)
Source by www.section.io #
 
PREVIOUS NEXT
Tagged: #react #css #root #variables
ADD COMMENT
Topic
Name
3+5 =