/* From Josh Comeau's Next-level frosted glass with backdrop-filter blog:
* https://www.joshwcomeau.com/css/backdrop-filter/
--transparent-background: color-mix(
z-index: calc(var(--layer-important) - 1);
padding-block: var(--size-3);
background: var(--transparent-background);
backdrop-filter: blur(var(--size-3));
mask-image: linear-gradient(to bottom, black 0, black 50%, transparent 50%);
/* Set this to whatever you want for the edge thickness: */
--thickness: var(--size-1);
Only a few pixels will be visible, but we’ll
set the height by 100% to include nearby elements.
Shift down by 100% of its own height, so that the
edge stacks underneath the main <header>:
transform: translateY(100%);
background: var(--transparent-background);
backdrop-filter: blur(var(--size-2)) brightness(120%);
We mask out everything aside from the first few
pixels, specified by the --thickness variable:
mask-image: linear-gradient(
transparent var(--thickness)