The fill attribute accepts hex colors, gradient functions, and token references. Alpha is encoded as the last byte of an 8-digit hex: #1C1C1ECC.

Fill Values

propertyfill attribute formats

The fill attribute accepts hex colors, gradient functions, and token references. Alpha is encoded as the last byte of an 8-digit hex: #1C1C1ECC.

Gradient syntax mirrors CSS — linear-gradient(), radial-gradient(), conic-gradient(). Token references use $name syntax.

AttrTypeDescription
Hex opaqueformat#1C1C1E.
Hex + alphaformat#1C1C1ECC (last byte = alpha).
Linear gradientformatlinear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%).
Radial gradientformatradial-gradient(circle at 50% 30%, #FFF 0%, #000 100%).
Angular gradientformatconic-gradient(from 0deg at 50% 50%, #F00 0deg, #00F 360deg).
Tokenformat$primary.

Fill values in use

<rect fill="#1C1C1ECC" w="100" h="100" />
<rect fill="linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%)" w="fill" h="160" />
<rect fill="$primary" w="fill" h="52" radius="12" />