formatBorderStylesVar

Commons
stable

Build an array of CSS border shorthand declarations (border-width, border-color, or border-style) from a 1-, 2-, or 4-value shorthand array, using logical block/inline properties.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

values
requis
Array<string>
Shorthand values. 1 value → all sides, 2 values → block + inline, 4 values → start/end per axis.
type
requis
string
The border sub-property to target: 'width', 'color', or 'style'.

API

Valeur de retour

La valeur retournée par cet util.

Array of CSS declaration strings ready to be injected as inline style entries.

Usage

Exemples

Extraits de code prêts à coller.

Generate border-width declarations

typescript