CSS
Keep Text Readable on a Glassmorphism Panel
Use blur for the material, a dark fill for the type, and a fallback when backdrop-filter is missing.
- CSS
- Accessibility
- UI
- Glass
On this page
Glassmorphism fails in the place people actually look: the words. A translucent white card over a bright orb turns body text into a tint. The fix is to decide what is glass and what is ink. The panel blurs. The text sits on a darker, more opaque shape inside it. The login demo does this on the inputs. The labels stay on the glass only because they are white and large.
Split material and ink
backdrop-filter: blur() samples whatever is behind the element. That sample changes as orbs move, as the page scrolls, and as a photo loads. You cannot promise a contrast ratio against a moving sample. You can promise it against a fill you control. Use the blur at 10 to 20 percent white for the sheet. Use a separate background behind the glyphs.
.sheet {
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.3);
backdrop-filter: blur(24px);
}
.field {
background: rgba(0, 0, 0, 0.35);
color: #ffffff;
border: 1px solid rgba(255, 255, 255, 0.2);
}
.label {
color: #ffffff;
font-weight: 560;
}
Put the action on a solid button
The primary button should not be glass. A solid light button with dark text stays readable on every orb color and looks like the thing to press. A ghost button can sit beside it for the secondary action. If both actions are glass, the visitor has to guess.
Paint a solid sheet when blur is unavailable
Some browsers and some power-saving modes skip backdrop-filter. Without a fallback the panel becomes a thin white wash and the page behind shows through the letters. Use @supports to keep the translucent look where blur works, and a nearly solid background where it does not.
.sheet {
background: rgba(12, 14, 22, 0.92);
}
@supports (backdrop-filter: blur(12px)) {
.sheet {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(24px);
}
}
- Check the card over the brightest orb and over the darkest corner. Both have to hold the label.
- Keep body copy off the glass. A sentence or two is the limit. Long text belongs on a solid surface.
- Give inputs a 2px focus ring in a light cyan or white. A border-only focus disappears on the highlight.
- Do not encode state by color alone. The error text can be amber and it still needs a full sentence.
Use a glance, then a tool
Step back from the monitor until the letters are small. If you cannot tell the title from the hint, the type is too close in size or color. Then zoom the page to 200 percent. The card should grow, wrap, and keep the button on screen. A glass effect that only works at one width is a poster, not a form. The contrast note is the piece to reread when you reuse this shell for signup.
