CSS filters apply visual processing effects like blur, contrast, grayscale, and drop-shadow.
Practical uses
- Subtle hover emphasis.
- Thumbnail de-emphasis before interaction.
- Backdrop mood effects when performance allows.
Pitfall
Heavy blur/filter chains can be expensive, especially on large images or animations.
Important interview questions and answers
- Q: When avoid filters?
A: Large scrolling galleries on low-end devices or critical readability contexts. - Q: Filter vs editing source image?
A: Runtime filters are flexible but can cost more than preprocessed assets. - Q: How to profile filter cost?
A: Use browser performance tools and test real devices.
Practice: Change one property in the playground and observe cascade + layout in DevTools.