Skip to content

CSS: context-view

.instui-context-view — An elevated callout with a caret, positionable on any side; works as a native [popover].

Source: context-view.css

Usage

css
@import "@pantoken/components/components.css";
@import "@pantoken/components/context-view.css";

Examples

html
<div class="instui-context-view -placement-bottom" id="cv-popover">A context view frames a callout with a caret. As a popover it rides the top layer and closes when you click away or press Esc.</div>

Modifiers

ModifierDescription
.-color-inverseDark (inverse) colour scheme.
.-placement-bottomSit below the anchor.
.-placement-endSit at the end (inline-end) of the anchor.
.-placement-startSit at the start (inline-start) of the anchor.
.-placement-topSit above the anchor.

Pseudo-elements

Pseudo-elementDescription
::afterRenders the caret's inner fill triangle.
::beforeRenders the caret's outer border triangle.

States

StateDescription
:state(open)

Conditions

TypeQueryDescription
supports(position-area: block-end)

Tokens consumed

TokenTypeValue
--instui-color-background-elevated-surface-base<color>light-dark(#ffffff, #171B21)LightDark
--instui-color-background-inverse<color>light-dark(#334450, #F2F4F5)LightDark
--instui-color-text-base<color>light-dark(#273540, #F2F4F5)LightDark
--instui-color-text-inverse<color>light-dark(#ffffff, #1C222B)LightDark
--instui-component-context-view-arrow-background-color<color>light-dark(#ffffff, #171B21)LightDark
--instui-component-context-view-arrow-background-color-inverse<color>light-dark(#334450, #F2F4F5)LightDark
--instui-component-context-view-arrow-border-color<color>light-dark(#E8EAEC, #2D3D49)LightDark
--instui-component-context-view-arrow-border-color-inverse<color>#00000000
--instui-component-context-view-arrow-border-width<length>0.0625rem
--instui-component-context-view-arrow-size<length>0.5rem
--instui-component-context-view-border-radius<length>0.75rem
--instui-elevation-above[ inset? && <length>{2,4} && <color>? ]# | none
--instui-spacing-space-lg<length>1rem
--instui-spacing-space-md<length>0.75rem

Browser support

  • Uses CSS anchor positioning (position-anchor, position-area, position-try-fallbacks) and the native [popover] API behind an @supports guard; needs a recent Chromium or Safari, and falls back to a UA-centred popover elsewhere.
  • popover — The generic top-layer popover.
  • tooltip — A smaller hover or focus callout.