Skip to content

CSS: context-view

.instui-context-view — Yon apèl elve ak yon caret, pozisyone sou nenpòt bò; fonksyone kòm yon [popover] natif natal.

Caret la se de triyang anpile ::before/::after (bor puis ranpli) konsa li parèt kòrèkteman kont yon sifas ki matche; kòm yon [popover] li bezwen menm fil ouvè/popovertarget tankou popover, men kontrèman ak tooltip, li fèmen lè klike deyò oswa peze Escape.

Source: context-view.css

Itilizasyon

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

Egzanp

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>

Modifikatè

ModifikatèDeskripsyon
.-color-inverseSèk koulè fonse (envès).
.-placement-bottomPlase anba ankre a.
.-placement-endPlase nan fen (inline-end) ankre a.
.-placement-startPlase nan kòmansman (inline-start) ankre a.
.-placement-topPlase anlè ankre a.

Pseudo-eleman

Pseudo-elemanDeskripsyon
::afterRann triyang ranpli entèn caret la.
::beforeRann triyang bor ekstèn caret la.

Eta

EtaDeskripsyon
:state(open)

Kondisyon

TipRechèchDeskripsyon
supports(position-area: block-end)

Tokens konsome

TokenTipValè
--instui-color-background-elevated-surface-base<color>LightDarklight-dark(#ffffff, #171B21)
--instui-color-background-inverse<color>LightDarklight-dark(#334450, #F2F4F5)
--instui-color-text-base<color>LightDarklight-dark(#273540, #F2F4F5)
--instui-color-text-inverse<color>LightDarklight-dark(#ffffff, #1C222B)
--instui-component-context-view-arrow-background-color<color>LightDarklight-dark(#ffffff, #171B21)
--instui-component-context-view-arrow-background-color-inverse<color>LightDarklight-dark(#334450, #F2F4F5)
--instui-component-context-view-arrow-border-color<color>LightDarklight-dark(#E8EAEC, #2D3D49)
--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-abovenone | <shadow>#
--instui-spacing-space-lg<length>1rem
--instui-spacing-space-md<length>0.75rem

Sipò navigatè

  • Itilize pozisyonman anchor CSS (position-anchor, position-area, position-try-fallbacks) ak API natif [popover] dèyè yon gad @supports; mande yon Chromium oswa Safari resan, epi li tounen sou yon popover santre sou UA lòt kote.

Ki gen rapò

  • popover — Popover jenerik ki sou kouch siperyè.
  • tooltip — Yon ti apèl ki parèt sou hover oswa fokus.