<div class="swatch constant"></div>
<div class="swatch mix"></div>
@layer demo {
.constant {
background: rgb(255 0 0 / 25%);
}
.mix {
background: color-mix(in oklab, red, transparent 75%);
}
}
@layer demo.support {
.swatch {
inline-size: 25vmin;
aspect-ratio: 1;
border-radius: 50%;
}
* {
box-sizing: border-box;
margin: 0;
}
html {
block-size: 100%;
color-scheme: dark light;
}
body {
min-block-size: 100%;
font-family: system-ui, sans-serif;
display: grid;
place-content: center;
gap: 5vmin;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.