Skip to content

CSS: img

.instui-img — A styled <img> with display, crop, and effect modifiers that stack.

Source: img.css

Accessibility

Provide meaningful alt text that describes the image, and use an empty alt="" for purely decorative images so assistive tech skips them.

Usage

css
@import "@pantoken/components/components.css";
@import "@pantoken/components/img.css";

Examples

html
<img class="instui-img" alt="Gradient">
Gradient

Modifiers

ModifierDescription
.-constrain-containScale to fit within the box (contain).
.-constrain-coverScale to fill the box (cover).
.-display-blockDisplay as a block element.
.-with-blurApply a blur effect.
.-with-grayscaleApply a grayscale effect.

Custom properties

PropertyTypeDefaultDescription
--pantoken-imgfilter <filter-value-list> | none — The composed CSS filter on the image; the effect modifiers set it, and you can override it for a custom filter.

Tokens consumed

TokenTypeValue
--instui-component-img-effect-transition-duration<time>1s
--instui-component-img-image-blur-amount<length>0.25em
--pantoken-img-filter<filter-value-list> | nonenone