<h1>Basic CSS variable example</h1>
:root {
  --main-bg-color: #000080;
  --main-text-color: #fff;
}

body {
  background-color: var(--main-bg-color);
  color: var(--main-text-color);
  text-align: center;
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.