Skip to content

CSS: popover

.instui-popover — CSSアンカーポジショニングで配置されるネイティブな [popover] のための上位表示サーフェス。

アンカーポジショニングはChromium専用です;@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アンカーの下に配置されます。
.-placement-endアンカーの末尾(inline-end)に配置されます。
.-placement-startアンカーの先頭(inline-start)に配置されます。
.-placement-topアンカーの上に配置されます。

条件

クエリ説明
supports(position-area: block-end)
supports(transition-behavior: allow-discrete)

使用トークン

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アンカーポジショニング(position-anchor/position-area)とネイティブの [popover] API を使用しており、どちらも現時点ではChromium専用です;@supports ガードは他の環境で配置を無効に保ち、その場合UAはポップオーバーを最上位レイヤーの中央に置きます。

サブコンポーネント

関連項目

  • tooltip — ツールチップは小さめで、ホバーまたはフォーカスで発動するアンカー付きのサーフェスです。
  • context-view — コンテキストビューはポインタを持つ関連するアンカー付きサーフェスです。