CSS Box Shadows, Gradients and Glass Effects: A Short Guide
Three effects that make a plain page look polished, and how to build them without trial and error.
Good design is often subtle. A soft shadow, a smooth gradient, a rounded corner. They are easy to overdo and tedious to tweak by hand, which is where a live preview helps.
Shadows that look real
Real shadows are soft and slightly offset. Use a low opacity, such as 10 to 20 percent, and a generous blur. Layer two shadows for depth: a tight one and a wide one. The box shadow generator lets you move the sliders until it feels right and copies the CSS.
Gradients without the garish look
Pick two colours that are close on the colour wheel and use a gentle angle, like 135 degrees. Harsh contrast between the ends looks dated. Build and copy one with the CSS gradient generator.
Rounded corners
A radius of 8 to 16 pixels feels modern for cards and buttons. Use the same value across a site for consistency. The border radius generator also makes blobs and pills.
Glassmorphism
The frosted-glass look needs a colourful or image background, a translucent white fill, a blur and a thin light border. On a plain white page it just looks grey. The glassmorphism generator shows it over a gradient so you can judge it. Remember that backdrop-filter needs a fallback for older browsers.
Check your text contrast on top of any effect. Pretty and unreadable is still unreadable.