Skip to content

CSS: popover

.instui-popover — Ένα ανυψωμένο περίβλημα για ένα εγγενές [popover], τοποθετημένο με CSS anchor positioning.

Το anchor positioning είναι αποκλειστικό σε Chromium· το guard @supports σημαίνει ότι το -placement-* παραμένει σιωπηλά αδρανές αλλού και ο UA κεντράρει το αναδυόμενο παράθυρο στο ανώτατο επίπεδο αντί να αποτύχει.

Source: popover.css

Χρήση

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

Παραδείγματα

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>

Δομή

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;

Τροποποιητές

ΤροποποιητήςΠεριγραφή
.-placement-bottomΤοποθετείται κάτω από το anchor.
.-placement-endΤοποθετείται στο άκρο (inline-end) του anchor.
.-placement-startΤοποθετείται στην αρχή (inline-start) του anchor.
.-placement-topΤοποθετείται πάνω από το anchor.

Συνθήκες

ΤύποςΕρώτημαΠεριγραφή
supports(position-area: block-end)
supports(transition-behavior: allow-discrete)

Καταναλωμένα tokens

TokenΤύποςΤιμή
--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

Υποστήριξη προγράμματος περιήγησης

  • Χρησιμοποιεί CSS anchor positioning (position-anchor/position-area) και την εγγενή [popover] API, και τα δύο αποκλειστικά σε Chromium σήμερα· ένα guard @supports κρατά την τοποθέτηση αδρανή αλλού, όπου ο UA κεντράρει το αναδυόμενο παράθυρο στο ανώτατο επίπεδο.

Υποσυστατικά

Σχετιζόμενα

  • tooltip — Ένα tooltip είναι μια μικρότερη, με ενεργοποίηση από hover ή focus, αγκυρωμένη επιφάνεια.
  • context-view — Το context view είναι μια σχετική αγκυρωμένη επιφάνεια με δείκτη.