Skip to content

CSS: metric

.instui-metric — สถิติที่มีป้ายกำกับ — ค่าขนาดใหญ่เหนือคำบรรยาย.

กำหนด gap ของตัวเองระหว่างค่าและป้ายกำกับ และ padding แนวนอนของตัวเอง; การเชนตัวแก้ไขยูทิลิตี้ช่องว่าง -gap-*/-p-*/-padding-* จะเขียนทับค่าที่ฝังมาเหล่านั้น.

Source: metric.css

การใช้งาน

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

ตัวอย่าง

html
<div class="instui-metric">
  <span class="value">1,284</span>
  <span class="label">Active users</span>
</div>

โครงสร้าง

text
.instui-metric
  .value
  .label
flowchart TD n0[".instui-metric"]:::cssdoc-root n1(".value"):::cssdoc-part n2(".label"):::cssdoc-part n0 --> n1 n0 --> 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;

ตัวปรับแต่ง

ตัวปรับแต่งคำอธิบาย
.-text-align-centerจัดกึ่งกลางค่าและป้ายกำกับ.
.-text-align-endจัดชิดขอบท้ายของค่าและป้ายกำกับ.
.-text-align-startจัดชิดขอบเริ่มต้นของค่าและป้ายกำกับ.

ส่วนประกอบ

ส่วนคำอธิบาย
.labelคำบรรยายใต้ค่า.
.valueตัวเลขเมตริกขนาดใหญ่.

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

Tokenชนิดค่า
--instui-component-metric-gap-texts<length>0.5rem
--instui-component-metric-label-color<color>LightDarklight-dark(#273540, #ffffff)
--instui-component-metric-label-font-family[ <font-family-name> | <generic-font-family> ]#Atkinson Hyperlegible Next, "Helvetica Neue", Helvetica, Arial, sans-serif
--instui-component-metric-label-font-size<length>0.75rem
--instui-component-metric-label-font-weight<integer>400
--instui-component-metric-label-line-height<length>0.75rem
--instui-component-metric-padding-horizontal<length>0.5rem
--instui-component-metric-value-color<color>LightDarklight-dark(#273540, #ffffff)
--instui-component-metric-value-font-family[ <font-family-name> | <generic-font-family> ]#Inclusive Sans, "Helvetica Neue", Helvetica, Arial, sans-serif
--instui-component-metric-value-font-size<length>1.75rem
--instui-component-metric-value-font-weight<integer>600
--instui-component-metric-value-line-height<length>1.75rem