<div class="container" style="--theme: normal">
<div class="box">
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Ea, aspernatur, maiores inventore ab at consequatur ut hic dignissimos numquam consequuntur placeat expedita! Tempora animi recusandae molestias dolorem suscipit. Veritatis, id!</p>
</div>
</div>
<div class="container" style="--theme: colorful">
<div class="box">
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Ea, aspernatur, maiores inventore ab at consequatur ut hic dignissimos numquam consequuntur placeat expedita! Tempora animi recusandae molestias dolorem suscipit. Veritatis, id!</p>
</div>
</div>
xxxxxxxxxx
@container style(--theme: colorful) {
.box {
background: #f2f0ec;
border: 1px solid red;
}
}
/* ETC (Formatting only): */
body {
margin: 1.5em;
font-size: 100%;
font-family: sans-serif;
background: #e5e3de;
color: #2e2c08;
}
.box {
padding: 2rem;
max-width: 30rem;
margin-bottom: 2rem;
}
.box {
background: #fff;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.