Skip to content

CSS: avatar

.instui-avatar — A user avatar showing initials or an image, circular by default.

By default the palette colour tints the initials on a transparent surface; -has-inverse-color fills the surface with the colour and puts the initials on-colour. The -color-ai variant always fills with the violet→sea gradient.

Source: avatar.css

Usage

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

Examples

html
<span class="instui-avatar instui-me-sm">DW</span>
<span class="instui-avatar -color-ai">AI</span>
DWAI

Modifiers

ModifierDescription
.-color-accent1Deprecated — use .-color-blue.
.-color-accent2Deprecated — use .-color-green.
.-color-accent3Deprecated — use .-color-red.
.-color-accent4Deprecated — use .-color-orange.
.-color-accent5Deprecated — use .-color-ash.
.-color-accent6Deprecated — use .-color-grey.
.-color-aiAI-accent palette colour.
.-color-ashAsh palette colour.
.-color-blueBlue palette colour.
.-color-greenGreen palette colour.
.-color-greyGrey palette colour.
.-color-orangeOrange palette colour.
.-color-redRed palette colour.
.-has-inverse-colorUse the inverse (on-dark) text colour.
.-shape-rectangleSquare (rectangular) shape instead of a circle.
.-show-borderAdd a border ring.
.-size-2xlTwo sizes larger.
.-size-2xsTwo sizes smaller.
.-size-largeLarge. Long-form alias of -size-lg.
.-size-lgLarge.
.-size-smSmall.
.-size-smallSmall. Long-form alias of -size-sm.
.-size-x-largeExtra large. Long-form alias of -size-xl.
.-size-x-smallExtra small. Long-form alias of -size-xs.
.-size-xlExtra large.
.-size-xsExtra small.

Tokens consumed

TokenTypeValue
--instui-component-avatar-ai-bottom-gradient-color<color>#00828E
--instui-component-avatar-ai-top-gradient-color<color>#9E58BD
--instui-component-avatar-ash-background-color<color>light-dark(#273540, #1C222B)LightDark
--instui-component-avatar-ash-text-color<color>light-dark(#273540, #C7CACD)LightDark
--instui-component-avatar-background-color<color>light-dark(#ffffff, #10141A)LightDark
--instui-component-avatar-blue-background-color<color>#2B7ABC
--instui-component-avatar-blue-text-color<color>light-dark(#2871AF, #7FB4F1)LightDark
--instui-component-avatar-border-color<color>light-dark(#8D959F, #6A7883)LightDark
--instui-component-avatar-border-width-md<length>0.125rem
--instui-component-avatar-border-width-sm<length>0.0625rem
--instui-component-avatar-font-family[ <font-family-name> | <generic-font-family> ]#Atkinson Hyperlegible Next, "Helvetica Neue", Helvetica, Arial, sans-serif
--instui-component-avatar-font-size-lg<length>1.25rem
--instui-component-avatar-font-size-md<length>1rem
--instui-component-avatar-font-size-sm<length>0.875rem
--instui-component-avatar-font-size-xl<length>1.75rem
--instui-component-avatar-font-size-xs<length>0.75rem
--instui-component-avatar-font-size2xl<length>2.5rem
--instui-component-avatar-font-size2xs<length>0.75rem
--instui-component-avatar-font-weight<integer>600
--instui-component-avatar-green-background-color<color>#03893D
--instui-component-avatar-green-text-color<color>light-dark(#037D37, #61C378)LightDark
--instui-component-avatar-grey-background-color<color>light-dark(#4A5B68, #576773)LightDark
--instui-component-avatar-grey-text-color<color>light-dark(#4A5B68, #F2F4F5)LightDark
--instui-component-avatar-orange-background-color<color>#CF4A00
--instui-component-avatar-orange-text-color<color>light-dark(#BB4200, #FF905A)LightDark
--instui-component-avatar-rectangle-radius<length>0.25rem
--instui-component-avatar-red-background-color<color>#E62429
--instui-component-avatar-red-text-color<color>light-dark(#CF1F24, #FA917F)LightDark
--instui-component-avatar-size-lg<length>3.5rem
--instui-component-avatar-size-md<length>3rem
--instui-component-avatar-size-sm<length>2.5rem
--instui-component-avatar-size-xl<length>4rem
--instui-component-avatar-size-xs<length>2rem
--instui-component-avatar-size2xl<length>5rem
--instui-component-avatar-size2xs<length>1.5rem
--instui-component-avatar-text-on-color<color>#ffffff
  • byline — Can host an avatar as its leading hero figure.