html - How to define global variables in css -
i want define global variables in 1 css file , use variables in other css files.
is possible?
global.css:
:root {     --main-color: #192100;     --main-background: #89b66b; }  html, body {     min-height: 100%;     width: 100%;     font-family: arial;     color: var(--main-color); } somefile.css:
.some-rule {     display: table;     border-radius: 12px;     border: 4px solid var(--main-color);     padding-left: 10px;     padding-right: 10px;     color: var(--main-color); } html: (global.css if referenced before somefile.css)
<link href="global.css" rel="stylesheet" type="text/css" /> <link href="somefile.css" rel="stylesheet" type="text/css" /> 
css doesn't use variables. however, can use language sass or less
Comments
Post a Comment