CSS Filters, Backdrop & Glassmorphism
Turn your CSS into Adobe Photoshop. Understand the critical architectural distinction between filter (which affects the element itself) and backdrop-filter (which blurs the universe behind it).
1. Mental Model: Camera Lens Filter vs. Frosted Glass Pane
The Camera Lens (filter)
When you put a sepia or polarized lens directly in front of your camera, the photo itself is altered. Applying filter: blur(8px) blurs the element, its text, and all its children.
The Frosted Window (backdrop-filter)
Imagine looking through a frosted glass window in a shower. The text written on the glass surface is crystal clear; only the room behind the window appears blurred!
2. The 4-Ingredient Glassmorphism Recipe
Frosted glass interfaces look sleek on modern web apps (like macOS and iOS). To achieve this, you need four coordinated properties:
3. Interactive Studio: Live Filter & Glassmorphism Sandbox
Filtered Subject Graphic
Real-time GPU Filter Shader Pipeline
Notice how text remains ultra-sharp while background spheres dissolve into a buttery frosted haze!
First-Year Student Traps: Filters
- 1.The Opaque Background Trap: If your card has
background: #ffffff, addingbackdrop-filter: blur(12px)will do nothing! You cannot see through opaque paint. Always usergba(255, 255, 255, 0.2). - 2.The Fixed Position Stacking Trap: Applying any
filterortransformto a container creates a new containing block. Any child withposition: fixedwill now be trapped inside this container instead of anchoring to the browser viewport!
Clip-path, Geometric Shapes & CSS Masking
Cut elements like cookie dough with circle, polygon, and SVG paths, and master alpha masking.