Skip to content

CSS: drawer-layout.tray ​

.tray — แผงด้านข้างที่อยู่ข้างเนื้อหาหลัก พร้อมตัวปรับแต่งเป็นแบบ overlay และพื้นผิวคล้ายถาดเป็นทางเลือก

การจัดตำแหน่งใช้ inset-inline-start/inset-inline (ไม่ใช้ left/right) ดังนั้น -placement-end จะยึดติดกับขอบท้ายที่แท้จริงทั้งใน LTR และ RTL

การเข้าถึง ​

หากใช้เป็นการนำทาง ให้ห่อลิงก์ไว้ใน <nav> เชิงความหมาย และระบุชื่อที่เข้าถึงได้

การใช้งาน ​

css
@import "@pantoken/components/components.css";
@import "@pantoken/components/drawer-layout.tray.css";

ตัวอย่าง ​

html
<div class="instui-drawer-layout" open>
  <aside class="tray" aria-label="Course navigation">
    <a class="instui-link" href="#">โมดูล</a>
  </aside>
  <main class="content" role="region">เนื้อหาหลัก</main>
</div>

โครงสร้าง ​

text
@scope (@component drawer-layout)
  .tray
    ‹content›
flowchart TD subgraph sg0 ["@scope (@component drawer-layout)"] n1(".tray"):::cssdoc-part n2[/"‹content›"/]:::cssdoc-slot end n1 --> n2 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-endยึดถาดนี้ที่ inline-end เมื่อโหมด overlay ทำงานอยู่
.-without-borderเอาเส้นขอบของแผงออก
.-without-shadowเอาความยกระดับออกเมื่อโหมด overlay ทำงาน

เงื่อนไข ​

ชนิดการค้นหาคำอธิบาย
containerpantoken-drawer-layout (max-width: 64em)—

โทเค็นที่ใช้ ​

Tokenชนิดค่า
--drawer-layout-tray-width——
--instui-border-width-sm<length>0.0625rem
--instui-color-background-elevated-surface-base<color>LightDarklight-dark(#ffffff, #171B21)
--instui-color-stroke-base<color>LightDarklight-dark(#8D959F, #6A7883)
--instui-component-tray-width-xs<length>16em
--instui-component-tray-z-index<integer>9999
--instui-elevation-topmostnone | <shadow>#—

ที่เกี่ยวข้อง ​

  • drawer-layout.content — แผงหลักที่ยืดตามไปพร้อมกับสมาชิกนี้