Skip to content

Commit ad30f20

Browse files
committed
Iterate on styles of Tables
1 parent a178d76 commit ad30f20

File tree

2 files changed

+32
-9
lines changed

2 files changed

+32
-9
lines changed

packages/gitbook/src/components/DocumentView/Table/ViewGrid.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,15 @@ export function ViewGrid(props: TableViewProps<DocumentTableViewGrid>) {
3434
<div role="table" className={tcls('flex', 'flex-col')}>
3535
{/* Header */}
3636
{withHeader && (
37-
<div role="rowgroup" className={tcls('flex flex-col', tableWidth)}>
38-
<div role="row" className={tcls('flex', 'w-full', '[&>*+*]:border-l')}>
37+
<div
38+
role="rowgroup"
39+
className={tcls(
40+
tableWidth,
41+
styles.rowGroup,
42+
'straight-corners:rounded-none',
43+
)}
44+
>
45+
<div role="row" className={tcls('flex', 'w-full')}>
3946
{view.columns.map((column) => {
4047
const alignment = getColumnAlignment(block.data.definition[column]);
4148
return (

packages/gitbook/src/components/DocumentView/Table/table.module.css

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,37 @@
2323
}
2424

2525
:global(.dark) .tableWrapper {
26-
@apply border-light/2;
26+
@apply border-tint-50;
27+
}
28+
29+
.columnHeader {
30+
@apply text-sm font-medium py-3 px-4 text-tint-900;
31+
}
32+
33+
:global(.dark) .columnHeader {
34+
@apply text-white;
2735
}
2836

2937
.row {
30-
@apply flex border-dark/3 dark:border-light/2;
38+
@apply flex border-tint-700/2;
3139
}
3240

33-
.row > * + * {
34-
@apply border-l;
41+
:global(.dark) .row {
42+
@apply border-tint-300/3;
43+
}
44+
45+
.rowGroup {
46+
@apply flex flex-col border rounded-lg bg-tint-800/1 border-tint-700/2;
47+
}
48+
49+
:global(.dark) .rowGroup {
50+
@apply bg-tint-300/2 border-tint-300/3;
3551
}
3652

3753
.cell {
38-
@apply flex-1 align-middle border-dark/2 py-2 px-3 text-sm lg:text-base dark:border-light/2;
54+
@apply flex-1 align-middle border-dark/2 py-2 px-4 text-sm;
3955
}
4056

41-
.columnHeader {
42-
@apply align-middle text-left text-base font-medium border-b dark:border-l-light/2 dark:border-b-light/4 py-2 px-3;
57+
:global(.dark) .cell {
58+
@apply border-light/2;
4359
}

0 commit comments

Comments
 (0)