Check out example codes for "css variables". It will help you in understanding the concepts better.

Code Example 1

/* Answer to: "css variables" */

:root {
  --main-bg-color: coral;
  --secondary-bg-color: gold;
}

#div1 {
  background-color: var(--main-bg-color);
}

#div2 {
  background-color: var(--main-secondary-color);
}

Code Example 2

:root {
  --main-bg-color: coral;
}

#div1 {
  background-color: var(--main-bg-color);
}

#div2 {
  background-color: var(--main-bg-color);
}

Code Example 3

/* "css variables" */
/* not for ie but good for Edge and other browser :D */

/*
 By declaring a custom property on the :root pseudo-class
 and using it where needed throughout the document
*/
:root {
  --primary-bg: #8a2be2;
  --btn-font-size: 18px;
  --btn-padding: 10px 15px;
}

.btn-primary {
  background-color: var(--primary);
  font-size: var(--btn-font-size);
  padding: var(--btn-padding);
  color: #E2E2E2;
}

Learn ReactJs, React Native from akashmittal.com