Add CSS variable example without Tailwind
This commit is contained in:
parent
88dbfbd825
commit
640262f87f
1 changed files with 32 additions and 0 deletions
32
css/css-variables.html
Normal file
32
css/css-variables.html
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue