Equilateral triangular images with soft rounded corners achieved through CSS masking and trigonometric math, overlapping on a vibrant background.

Rounded Triangle CSS Image Mask

demo & code

This Rounded Triangle CSS Image Mask offers a mathematically perfect way to shape visuals into equilateral triangles with soft, professional edges. It is an ideal choice for high-end portfolio galleries, creative team sections, or landing pages where standard rectangular or circular crops feel too conventional. By leveraging modern CSS math, the shape remains perfectly symmetrical regardless of the image dimensions.

Level: Intermediate
Browser Support: Chrome 105+, Edge 105+, Firefox 121+, Safari 15.4+
Dark UI cards with angled bottom corners and a passing light beam effect on the border, demonstrating CSS corner-shape.

Beveled Corner Glow Cards

demo & code

This Beveled Corner Glow Card component demonstrates the bleeding edge of CSS UI styling. It primarily utilizes the new corner-shape property to create chamfered (angled) edges without complex clip-paths, while implementing a sophisticated CSS Mask fallback for older engines. The interaction features a “scanning” light beam effect on the border, powered by CSS Houdini for buttery smooth interpolation.

Level: Advanced
Browser Support: Chrome 120+, Edge 120+, Firefox 120+, Safari 17+
Fancy Corner Decoration for Images

Fancy Corner Decoration for Images

A border effect for an <img> tag - the size of the decorative edge, created with repeating-conic-gradient and -webkit-mask, is dynamically calculated via a complex calc() function controlled by CSS variables.

Smooth Corners with CSS

Smooth Corners with CSS

A progressive technique for creating complex UI shapes using the CSS Houdini Paint API - a squircle is generated by the smooth-corners worklet, surpassing the capabilities of border-radius. The shape’s curvature is dynamically controlled via the --smooth-corners CSS Custom Property, while the effect itself is built with a combination of pseudo-elements, mask, and clip-path.

See the Pen Smooth Corners with CSS.

Inverted Border Boxes

Inverted Border Boxes

A demonstration of a non-trivial technique for creating inverted rounded corners using ::before pseudo-elements and box-shadow. This trick allows you to “carve out” complex shapes from parent blocks, bypassing the limitations of standard border-radius.

See the Pen Inverted Border Boxes.