lab/css/css-variables.html

33 lines
455 B
HTML
Raw Permalink Normal View History

<style>
:root {
--color-primary: blue;
--roundedness: 0;
}
[data-theme="test"] {
--color-primary: red;
--roundedness: 100%;
}
.shape {
background-color: var(--color-primary);
border-radius: var(--roundedness);
height: 7.5rem;
width: 7.5rem;
}
.wrapper {
display: flex;
gap: 1rem;
padding: 2rem;
}
</style>
<div class="wrapper">
<div class="shape"></div>
<div data-theme="test">
<div class="shape"></div>
</div>
</div>