Skip to content

CSS: img

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

Effects compose through the shared --pantoken-img-filter custom property, so -with-grayscale and -with-blur can apply together; the -constrain-* crop modifiers require the consumer to size the box explicitly.

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">

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-filternone | <filter-value-list> | <-ms-filter-function-list>none