Skip to content

CSS: popover

.instui-popover — Hækkaður flötur fyrir innfædda [popover], staðsettur með CSS festustaðsetningu.

Festustaðsetning er eingöngu í Chromium; @supports varnir tryggja að -placement-* sé þögulega óvirkt annars staðar og UA miðstillir popover-ið í efsta lagið í stað þess að mistakast.

Source: popover.css

Notkun

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

Dæmi

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>

Uppbygging

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;

Breytingar

BreytiLýsing
.-placement-bottomSætið undir festingunni.
.-placement-endSætið í enda (inline-end) festingarinnar.
.-placement-startSætið í byrjun (inline-start) festingarinnar.
.-placement-topSætið fyrir ofan festinguna.

Skilyrði

TegundFyrirspurnLýsing
supports(position-area: block-end)
supports(transition-behavior: allow-discrete)

Notuð tákn

TokenTegundGildi
--instui-border-width-sm<length>0.0625rem
--instui-color-background-elevated-surface-base<color>LightDarklight-dark(#ffffff, #171B21)
--instui-color-text-base<color>LightDarklight-dark(#273540, #F2F4F5)
--instui-component-popover-border-color<color>LightDarklight-dark(#8D959F, #6A7883)
--instui-component-popover-border-radius<length>0.75rem
--instui-elevation-abovenone | <shadow>#
--instui-spacing-space-sm<length>0.5rem

Vafrastuðningur

  • Notar CSS festustaðsetningu (position-anchor/position-area) og innfædda [popover] API-ið, hvoru tveggja aðeins í Chromium í dag; @supports varnir halda staðsetningunni óvirkri annars staðar, þar sem UA miðstillir popover-ið í efsta lagið.

Undirhlutir

Tengdar

  • tooltip — Lítil hjálparvísbending sem birtist við sveima (hover) eða fókus, festaður flötur.
  • context-view — Samhengisskoðun er skyld festa flötur með bendipunkti.