adapt table compact mode

This commit is contained in:
pa
2026-01-07 00:08:48 +09:00
committed by Natsumi
parent 08c2499fa0
commit c0cb01a117
3 changed files with 5 additions and 3 deletions

View File

@@ -8,7 +8,9 @@
<template>
<div data-slot="table-container" class="relative w-full">
<table data-slot="table" :class="cn('w-full caption-bottom text-[13px]', props.class)">
<table
data-slot="table"
:class="cn('w-full caption-bottom text-[13px] in-[.is-compact-table]:text-[12px]', props.class)">
<slot />
</table>
</div>

View File

@@ -11,7 +11,7 @@
data-slot="table-cell"
:class="
cn(
'p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
'p-2 align-middle whitespace-nowrap in-[.is-compact-table]:py-1! in-[.is-compact-table]:px-2.5! [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5',
props.class
)
">

View File

@@ -11,7 +11,7 @@
data-slot="table-head"
:class="
cn(
'text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
'text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap in-[.is-compact-table]:h-8! in-[.is-compact-table]:px-2.5! [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-0.5',
props.class
)
">