Skip to content

Commit 904d0db

Browse files
[ui] [tables] fully redesigned tables with better color for accessiblity on both dark and light mode
1 parent 288aa1c commit 904d0db

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

docs/.vitepress/theme/style.css

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,4 +1069,110 @@ pre[class*='language-'] *:hover {
10691069

10701070
.title {
10711071
@apply border-0 !important;
1072+
}
1073+
1074+
/* Modern Table Styling */
1075+
.vp-doc table {
1076+
border-collapse: collapse;
1077+
border-spacing: 0;
1078+
width: 100%;
1079+
margin: 1.5rem 0;
1080+
font-size: 0.875rem;
1081+
line-height: 1.5;
1082+
border-radius: 8px;
1083+
overflow: hidden;
1084+
border: 1px solid var(--coollabs-border-zinc-300-20);
1085+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
1086+
}
1087+
1088+
.vp-doc th,
1089+
.vp-doc td {
1090+
padding: 0.75rem 1rem;
1091+
text-align: left;
1092+
border-bottom: 1px solid var(--vp-c-divider);
1093+
vertical-align: top;
1094+
}
1095+
1096+
.vp-doc th {
1097+
font-weight: 600;
1098+
background: var(--coollabs-bg-zinc-300-5);
1099+
color: var(--vp-c-text-1);
1100+
position: relative;
1101+
}
1102+
1103+
.vp-doc th:first-child,
1104+
.vp-doc td:first-child {
1105+
width: 200px;
1106+
min-width: 200px;
1107+
vertical-align: middle;
1108+
}
1109+
1110+
.vp-doc td {
1111+
background: var(--vp-c-bg);
1112+
color: var(--vp-c-text-2);
1113+
}
1114+
1115+
/* Right-align numeric columns (common in tables) */
1116+
.vp-doc th:nth-child(n+2),
1117+
.vp-doc td:nth-child(n+2) {
1118+
text-align: right;
1119+
}
1120+
1121+
/* Caption styling */
1122+
.vp-doc caption {
1123+
caption-side: top;
1124+
padding: 0.5rem 1rem;
1125+
font-size: 0.875rem;
1126+
font-weight: 500;
1127+
color: var(--vp-c-text-3);
1128+
text-align: left;
1129+
background: var(--vp-c-bg-soft);
1130+
border-bottom: 1px solid var(--vp-c-divider);
1131+
}
1132+
1133+
/* Footer styling */
1134+
.vp-doc tfoot th,
1135+
.vp-doc tfoot td {
1136+
background: var(--coollabs-bg-zinc-300-5);
1137+
font-weight: 600;
1138+
}
1139+
1140+
/* Responsive table wrapper for horizontal scroll on small screens */
1141+
@media (max-width: 768px) {
1142+
.vp-doc table {
1143+
font-size: 0.8rem;
1144+
}
1145+
1146+
.vp-doc th,
1147+
.vp-doc td {
1148+
padding: 0.5rem 0.75rem;
1149+
white-space: nowrap;
1150+
}
1151+
1152+
.vp-doc {
1153+
overflow-x: auto;
1154+
-webkit-overflow-scrolling: touch;
1155+
}
1156+
1157+
.vp-doc table {
1158+
min-width: 600px;
1159+
}
1160+
}
1161+
1162+
/* Dark mode table adjustments */
1163+
.dark .vp-doc table {
1164+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
1165+
}
1166+
1167+
.dark .vp-doc th {
1168+
background: var(--coollabs-bg-zinc-300-5);
1169+
}
1170+
1171+
.dark .vp-doc tfoot th,
1172+
.dark .vp-doc tfoot td {
1173+
background: var(--coollabs-bg-zinc-300-5);
1174+
}
1175+
1176+
.dark .vp-doc caption {
1177+
background: var(--vp-c-bg-elv);
10721178
}

0 commit comments

Comments
 (0)