Choose glass blur or clay shadows for a CSS card
Admin ·
Choose glass when some of the backdrop should remain visible through a card. Choose clay when the card should read as a raised surface with rounded edges. Comparing both against the same background separates the blur from the shadow effect.
CSS Glassmorphism & Claymorphism Generator
Compare glass blur against the same fine lines
Select Glass and use the Fine lines preview backdrop. Keep width 320 px, height 190 px and surface opacity 34%. Set Backdrop blur to 0 px. You should be able to distinguish the lines behind the card through its tinted surface.
Increase blur to 18 px. The lines soften behind the card while the lines outside remain sharp. Switch to Flat color to see why a plain background makes blur harder to judge.
Switch to clay and compare the edge depth
Return to Fine lines and choose Clay. Raise Surface opacity to 88% and increase Shadow depth from 0% to 70%. Look for brighter upper and left inside edges and darker opposing edges, with an outer shadow below.
The clay rule uses one outer shadow and two inset shadows. Use a real foreground and your intended background when checking contrast for text.
W3C CSS Backgrounds and Borders, inset and outer shadowsW3C WCAG 2.2, Contrast (Minimum)
Verify the standalone glass rule and fallback
Reset defaults, set Backdrop blur to 18 px and download style-surface.css. Add style-surface to a card with a patterned or photographic background behind it. The base rule keeps a solid tint, and the @supports block applies the translucent gradient and 18 px blur when supported.
Narrow the available container to less than 320 px to check max-width: 100%. If the glass effect vanishes on your actual page, first check whether anything textured is visible behind it and whether you have overridden the exported background.
W3C CSS Conditional Rules, @supportsW3C Filter Effects Level 2 draft, backdrop-filter
Common questions
What does Surface opacity change?
It changes the tint. The card uses alpha on its background colors, so the setting does not fade the text or other content inside.
Can I keep both presets in my project?
Yes. Export each as CSS, give their style-surface selectors distinct names, and apply the appropriate class to each card.