<button>
    button
</button>
<div>
<button>
  button #2
</button>
</div>
:root {
  --main-color: red;
}

div {
    --main-color: blue;
}

button {
  background-color: var(--main-color);
  color: white;
  border-radius: 10px;
  padding: 10px;
  display: block;
  margin-bottom: 10px;  
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.