Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

radii function

The corner radii of an element in px as CSS draws them: top left, top right, bottom right, bottom left.

View as Markdown
import { radii } from '@dioramajs/diorama/kit'

. A % counts against the shorter side of the width × height box, and no corner takes more than half of that side, so 999px draws a pill.

function radii(
  element: Element,
  width: number,
  height: number,
): [number, number, number, number]

Parameters

NameTypeDescription
elementElement
widthnumber
heightnumber

Also exported from @dioramajs/effects/kit.

Defined in packages/effects/src/kit.ts.