I want to define global variables in one css file and use the variables in other css files.
Is this 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" />