Add CSS variable example without Tailwind

This commit is contained in:
Oliver Davies 2025-08-06 15:23:18 +01:00
parent 88dbfbd825
commit 640262f87f

32
css/css-variables.html Normal file
View file

@ -0,0 +1,32 @@
<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>