<h1><b>color-mix()</b> is <u>awesome.</u></h1>
:root {
/* change me! */
--brand: #0af;
/* very dark brand blue */
--text1: color-mix(var(--brand) 25%, black);
--text2: color-mix(var(--brand) 40%, black);
/* very bright brand white */
--surface1: color-mix(var(--brand) 5%, white);
/* https://web.dev/prefers-color-scheme/ */
color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
:root {
--text1: color-mix(var(--brand) 15%, white);
--text2: color-mix(var(--brand) 40%, white);
--surface1: color-mix(var(--brand) 5%, black);
}
}
h1 {
font-size: 10vmin;
font-weight: 300;
}
b {
color: var(--text2);
font-family: ui-monospace, monospace;
}
u {
text-decoration-color: var(--brand);
text-underline-offset: .25ex;
}
html {
block-size: 100%;
inline-size: 100%;
}
body {
color: var(--text1);
background: var(--surface1);
min-block-size: 100%;
min-inline-size: 100%;
margin: 0;
box-sizing: border-box;
display: grid;
place-content: center;
font-family: system-ui, sans-serif;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.