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앵커의 끝(인라인-끝)에 배치됩니다.
.-placement-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 — 컨텍스트 뷰는 포인터가 있는 관련 앵커형 표면입니다.