Skip to content

CSS: popover

.instui-popover — Egy emelt felület egy natív [popover] számára, CSS horgony pozicionálásával pozicionálva.

Forrás: popover.css

Használat

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

Példák

html
<div class="instui-popover -placement-bottom" id="pop-1">
  <div class="instui-heading -level-h4">Share this page</div>
  <p class="instui-text -size-sm">A popover is a lightweight surface anchored to a trigger. This one uses the native <code>popover</code> attribute.</p>
</div>

Felépítés

text
.instui-popover
  heading (component)
  text (component)
    code
flowchart TD n0[".instui-popover"]:::cssdoc-root n1(["heading"]):::cssdoc-component n2(["text"]):::cssdoc-component n3("code"):::cssdoc-part n0 --> n1 n2 --> n3 n0 --> n2 click n1 "/api/css/heading.md" click n2 "/api/css/text.md" classDef cssdoc-root stroke-width:1px; classDef cssdoc-part stroke-width:1px; classDef cssdoc-slot stroke-width:1px; classDef cssdoc-component stroke-width:1px;

Módosítók

MódosítóLeírás
.-placement-bottomÜlj az horgony alatt.
.-placement-endÜlj a horgony végén (inline-end).
.-placement-startÜlj a horgony kezdetén (inline-start).
.-placement-topÜlj a horgony felett.

Feltételek

TípusLekérdezésLeírás
supports(position-area: block-end)
supports(transition-behavior: allow-discrete)

Felhasznált tokenek

TokenTípusÉrték
--instui-border-width-sm<length>0.0625rem
--instui-color-background-elevated-surface-base<color>light-dark(#ffffff, #171B21)LightDark
--instui-color-text-base<color>light-dark(#273540, #F2F4F5)LightDark
--instui-component-popover-border-color<color>light-dark(#8D959F, #6A7883)LightDark
--instui-component-popover-border-radius<length>0.75rem
--instui-elevation-above[ inset? && <length>{2,4} && <color>? ]# | none
--instui-spacing-space-sm<length>0.5rem

Böngészőtámogatás

  • CSS horgony-pozicionálást (position-anchor/position-area) és a natív [popover] API-t használ, mindkettő jelenleg csak Chromium; egy @supports őr az elhelyezést inert tartja máshol, ahol az UA középre helyezi a popover-t a felső rétegben.

Alkomponensek

Kapcsolódó

  • tooltip — A tooltip egy kisebb, hover- vagy focus-aktivált horgonyzott felület.
  • context-view — A nézet egy kapcsolódó horgonyzott felület egy mutatóval.