CSS Utilities Frame

Frame

A frame is a box that keeps a fixed shape no matter how big or small it gets. Wrap an image, video, map, or placeholder in wa-frame and it stays a square by default, or a landscape, portrait, or any custom aspect ratio you specify, even as the surrounding layout resizes. That means no more letterboxing, no more collapsed boxes waiting on a slow image to load, and no more cards that end up different heights.

Pair wa-frame with one of the wa-border-radius-* classes to round the corners without cropping the content inside.

Examples

Link to This Section

Frames are well-suited for images and image placeholders.

Aspect Ratio

Link to This Section

Frames have a square aspect ratio by default. You can append :square (1 / 1), :landscape (16 / 9), or :portrait (9 / 16) to the wa-frame class in your markup to specify an aspect ratio for the frame. Alternatively, you can define the aspect-ratio property to set a custom proportion.

Border Radius

Link to This Section

Frames have a square border radius by default. You can add any of the following wa-border-radius-* classes to an element with wa-frame to specify the border radius:

Alternatively, you can define the border-radius property to set custom rounding.

    No results