Skip to content

สีตัวแบ่ง

คลาสยูทิลิตี้เหล่านี้ใช้ตั้งค่าสีตัวแบ่งสำหรับองค์ประกอบที่ใช้เส้นขอบแบ่งระหว่างองค์ประกอบลูก ใช้เพื่อให้มั่นใจว่าการใช้สีตัวแบ่งจะสม่ำเสมอทั่วทั้ง UI ของคุณ

การใช้งาน

สีตัวแบ่งพื้นฐาน

ชื่อคลาสคำอธิบายโทเค็นสี
.spr-divide-color-strongสีตัวแบ่งแรงสำหรับการเน้นสูงspr-divide-mushroom-500
.spr-divide-color-supportingสีตัวแบ่งสนับสนุนspr-divide-mushroom-400
.spr-divide-color-baseสีตัวแบ่งฐานสำหรับสถานะเริ่มต้นspr-divide-mushroom-300
.spr-divide-color-hoverสีตัวแบ่งเมื่อ hoverspr-divide-mushroom-400
.spr-divide-color-pressedสีตัวแบ่งเมื่อกดspr-divide-mushroom-500
.spr-divide-color-weakสีตัวแบ่งอ่อนสำหรับการแยกแบบอ่อนspr-divide-mushroom-200
.spr-divide-color-disabledสีตัวแบ่งสำหรับองค์ประกอบที่ปิดใช้งานspr-divide-white-100
.spr-divide-color-on-fill-disabledสีตัวแบ่งบนองค์ประกอบที่เติมสีและปิดใช้งานspr-divide-white-200

สีตัวแบ่งแบรนด์

ชื่อคลาสคำอธิบายโทเค็นสี
.spr-divide-color-brand-baseสีตัวแบ่งแบรนด์spr-divide-kangkong-700
.spr-divide-color-brand-hoverตัวแบ่งแบรนด์เมื่อ hoverspr-divide-kangkong-800
.spr-divide-color-brand-pressedตัวแบ่งแบรนด์เมื่อกดspr-divide-kangkong-900

สีตัวแบ่งสำเร็จ

ชื่อคลาสคำอธิบายโทเค็นสี
.spr-divide-color-success-baseสีตัวแบ่งสำเร็จspr-divide-kangkong-700
.spr-divide-color-success-hoverตัวแบ่งสำเร็จเมื่อ hoverspr-divide-kangkong-800
.spr-divide-color-success-pressedตัวแบ่งสำเร็จเมื่อกดspr-divide-kangkong-900

สีตัวแบ่งข้อมูล

ชื่อคลาสคำอธิบายโทเค็นสี
.spr-divide-color-information-baseสีตัวแบ่งข้อมูลspr-divide-blueberry-700
.spr-divide-color-information-hoverตัวแบ่งข้อมูลเมื่อ hoverspr-divide-blueberry-800
.spr-divide-color-information-pressedตัวแบ่งข้อมูลเมื่อกดspr-divide-blueberry-900

สีตัวแบ่งอันตราย

ชื่อคลาสคำอธิบายโทเค็นสี
.spr-divide-color-danger-baseสีตัวแบ่งอันตรายspr-divide-tomato-600
.spr-divide-color-danger-hoverตัวแบ่งอันตรายเมื่อ hoverspr-divide-tomato-700
.spr-divide-color-danger-pressedตัวแบ่งอันตรายเมื่อกดspr-divide-tomato-800

สีตัวแบ่งรอดำเนินการ

ชื่อคลาสคำอธิบายโทเค็นสี
.spr-divide-color-pending-baseสีตัวแบ่งรอดำเนินการspr-divide-mango-700
.spr-divide-color-pending-hoverตัวแบ่งรอดำเนินการเมื่อ hoverspr-divide-mango-800
.spr-divide-color-pending-pressedตัวแบ่งรอดำเนินการเมื่อกดspr-divide-mango-900

สีตัวแบ่งระวัง

ชื่อคลาสคำอธิบายโทเค็นสี
.spr-divide-color-caution-baseสีตัวแบ่งระวังspr-divide-carrot-700
.spr-divide-color-caution-hoverตัวแบ่งระวังเมื่อ hoverspr-divide-carrot-800
.spr-divide-color-caution-pressedตัวแบ่งระวังเมื่อกดspr-divide-carrot-900

สีตัวแบ่งเน้น

ชื่อคลาสคำอธิบายโทเค็นสี
.spr-divide-color-accent-baseสีตัวแบ่งเน้นspr-divide-wintermelon-700
.spr-divide-color-accent-hoverตัวแบ่งเน้นเมื่อ hoverspr-divide-wintermelon-800
.spr-divide-color-accent-pressedตัวแบ่งเน้นเมื่อกดspr-divide-wintermelon-900

ตัวอย่าง

html
<!-- ตัวแบ่งแนวตั้งพื้นฐาน -->
<div class="divide-y spr-divide-color-base">
  <div class="py-2">รายการ 1</div>
  <div class="py-2">รายการ 2</div>
  <div class="py-2">รายการ 3</div>
</div>

<!-- ตัวแบ่งแนวนอน -->
<div class="divide-x spr-divide-color-weak">
  <span class="px-2">ลิงก์ 1</span>
  <span class="px-2">ลิงก์ 2</span>
  <span class="px-2">ลิงก์ 3</span>
</div>

<!-- รายการพร้อมตัวแบ่งที่มีความหมาย -->
<ul class="divide-y spr-divide-color-weak">
  <li class="py-3 spr-text-color-base">รายการปกติ</li>
  <li class="py-3 spr-text-color-success-base divide-y spr-divide-color-success-base">
    รายการสำเร็จพร้อมตัวแบ่งสำเร็จ
  </li>
  <li class="py-3 spr-text-color-danger-base">รายการข้อผิดพลาด</li>
</ul>

<!-- การนำทางพร้อมตัวแบ่งแบรนด์ -->
<nav class="flex divide-x spr-divide-color-brand-base">
  <a href="#" class="px-4 py-2">หน้าหลัก</a>
  <a href="#" class="px-4 py-2">ผลิตภัณฑ์</a>
  <a href="#" class="px-4 py-2">ติดต่อ</a>
</nav>

<!-- ตัวแบ่งตามสถานะ -->
<div class="space-y-4">
  <div class="divide-y spr-divide-color-information-base">
    <div class="py-2">ส่วนข้อมูล</div>
    <div class="py-2">ข้อมูลเพิ่มเติม</div>
  </div>

  <div class="divide-y spr-divide-color-pending-base">
    <div class="py-2">รายการรอดำเนินการ 1</div>
    <div class="py-2">รายการรอดำเนินการ 2</div>
  </div>
</div>

หมายเหตุการใช้งาน

  • ยูทิลิตี้ Divide ทำงานกับคลาส divide-x และ divide-y ของ Tailwind
  • ใช้ชื่อสีที่มีความหมายที่ตรงกับบริบทเนื้อหา (สำเร็จ, อันตราย, ฯลฯ)
  • สำหรับการแยกแบบอ่อน ใช้ spr-divide-color-weak
  • สำหรับการแยกที่เด่น ใช้ spr-divide-color-strong
  • ตรวจสอบให้แน่ใจว่ามีความคมชัดเพียงพอระหว่างตัวแบ่งและสีพื้นหลัง