@gridkitjs/theme-tailwind 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/styles.css +162 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridkitjs/theme-tailwind",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Tailwind v4 theme for GridKit — palette tokens, dark mode and grid styles.",
5
5
  "license": "MIT",
6
6
  "author": "Blagoja Blazhevski",
package/src/styles.css CHANGED
@@ -24,6 +24,7 @@
24
24
  * than `:root` simply wins.
25
25
  */
26
26
  :root {
27
+ --gridkit-radius: 0.25rem;
27
28
  --gridkit-surface-light: oklch(1 0 0);
28
29
  --gridkit-surface-dark: oklch(0.21 0.01 250);
29
30
  --gridkit-surface-muted-light: oklch(0.97 0.003 250);
@@ -126,6 +127,7 @@
126
127
  */
127
128
  .gridkit-data-grid-viewport {
128
129
  overflow-x: auto;
130
+ border-radius: var(--gridkit-radius);
129
131
  }
130
132
 
131
133
  /*
@@ -148,6 +150,61 @@
148
150
  height: var(--gridkit-body-height, auto);
149
151
  }
150
152
 
153
+ /*
154
+ * Slim scrollbars on the grid's own scroll regions, never on the page: the
155
+ * viewport, the row area, the menus, and the column chooser and filter
156
+ * checklist lists. The thumb is the muted text colour thinned out, so it
157
+ * follows the light/dark swap above with no tokens of its own. Chromium
158
+ * and Firefox honour `scrollbar-width`/`scrollbar-color`; the
159
+ * `::-webkit-scrollbar` rules are only for engines that do not, since a
160
+ * browser that supports the standard properties ignores them anyway.
161
+ */
162
+ .gridkit-data-grid-viewport,
163
+ .gridkit-data-grid-body,
164
+ .gridkit-menu,
165
+ .column-chooser-list,
166
+ .filter-menu-checklist {
167
+ scrollbar-width: thin;
168
+ scrollbar-color: color-mix(
169
+ in oklch,
170
+ var(--gridkit-fg-muted) 45%,
171
+ transparent
172
+ )
173
+ transparent;
174
+ }
175
+
176
+ @supports not (scrollbar-color: auto) {
177
+ .gridkit-data-grid-viewport::-webkit-scrollbar,
178
+ .gridkit-data-grid-body::-webkit-scrollbar,
179
+ .gridkit-menu::-webkit-scrollbar,
180
+ .column-chooser-list::-webkit-scrollbar,
181
+ .filter-menu-checklist::-webkit-scrollbar {
182
+ width: 8px;
183
+ height: 8px;
184
+ }
185
+
186
+ .gridkit-data-grid-viewport::-webkit-scrollbar-track,
187
+ .gridkit-data-grid-body::-webkit-scrollbar-track,
188
+ .gridkit-menu::-webkit-scrollbar-track,
189
+ .column-chooser-list::-webkit-scrollbar-track,
190
+ .filter-menu-checklist::-webkit-scrollbar-track {
191
+ background: transparent;
192
+ }
193
+
194
+ .gridkit-data-grid-viewport::-webkit-scrollbar-thumb,
195
+ .gridkit-data-grid-body::-webkit-scrollbar-thumb,
196
+ .gridkit-menu::-webkit-scrollbar-thumb,
197
+ .column-chooser-list::-webkit-scrollbar-thumb,
198
+ .filter-menu-checklist::-webkit-scrollbar-thumb {
199
+ background-color: color-mix(
200
+ in oklch,
201
+ var(--gridkit-fg-muted) 45%,
202
+ transparent
203
+ );
204
+ border-radius: 4px;
205
+ }
206
+ }
207
+
151
208
  /*
152
209
  * Read but not seen — the grid's live region, which reports a reorder or a
153
210
  * resize that only a sighted user could otherwise notice.
@@ -1077,7 +1134,7 @@
1077
1134
  display: flex;
1078
1135
  flex-wrap: wrap;
1079
1136
  align-items: center;
1080
- gap: 1rem;
1137
+ gap: 0.5rem 1rem;
1081
1138
  padding: 0.5rem;
1082
1139
  font-size: 0.8125rem;
1083
1140
  color: var(--gridkit-fg);
@@ -1085,14 +1142,75 @@
1085
1142
  border-top: 1px solid var(--gridkit-line);
1086
1143
  }
1087
1144
 
1088
- .grid-pager-button {
1089
- padding: 0.25rem 0.625rem;
1090
- font-size: 0.8125rem;
1091
- color: var(--gridkit-fg);
1092
- cursor: pointer;
1145
+ /*
1146
+ * First, previous, the page numbers (or the compact status), next and
1147
+ * last as adjoining segments of one bar: an outer hairline, a shared one
1148
+ * between segments, and the radius on the bar's outer corners only. Every
1149
+ * number slot is the same width, sized by `--gridkit-pager-digits` (the
1150
+ * page count's digits, which the pager sets) in tabular numerals, so with
1151
+ * `paginationWindow`'s constant slot count the arrows never move.
1152
+ */
1153
+ .grid-pager-bar {
1154
+ --gridkit-pager-segment: 2rem;
1155
+ display: inline-flex;
1156
+ align-items: stretch;
1157
+ height: var(--gridkit-pager-segment);
1158
+ font-variant-numeric: tabular-nums;
1093
1159
  background-color: var(--gridkit-surface);
1094
1160
  border: 1px solid var(--gridkit-line);
1095
- border-radius: 0.25rem;
1161
+ border-radius: var(--gridkit-radius);
1162
+ }
1163
+
1164
+ .grid-pager-button,
1165
+ .grid-pager-ellipsis,
1166
+ .grid-pager-status-slot {
1167
+ position: relative;
1168
+ box-sizing: border-box;
1169
+ display: inline-flex;
1170
+ align-items: center;
1171
+ justify-content: center;
1172
+ min-width: var(--gridkit-pager-segment);
1173
+ margin: 0;
1174
+ padding: 0;
1175
+ font: inherit;
1176
+ line-height: 1;
1177
+ color: var(--gridkit-fg);
1178
+ background-color: transparent;
1179
+ border: 0;
1180
+ border-inline-start: 1px solid var(--gridkit-line);
1181
+ border-radius: 0;
1182
+ }
1183
+
1184
+ .grid-pager-bar > :first-child {
1185
+ border-inline-start: 0;
1186
+ border-start-start-radius: calc(var(--gridkit-radius) - 1px);
1187
+ border-end-start-radius: calc(var(--gridkit-radius) - 1px);
1188
+ }
1189
+
1190
+ .grid-pager-bar > :last-child {
1191
+ border-start-end-radius: calc(var(--gridkit-radius) - 1px);
1192
+ border-end-end-radius: calc(var(--gridkit-radius) - 1px);
1193
+ }
1194
+
1195
+ .grid-pager-button {
1196
+ cursor: pointer;
1197
+ }
1198
+
1199
+ .grid-pager-page,
1200
+ .grid-pager-ellipsis {
1201
+ width: max(
1202
+ var(--gridkit-pager-segment),
1203
+ calc(var(--gridkit-pager-digits, 1) * 1ch + 1rem)
1204
+ );
1205
+ }
1206
+
1207
+ .grid-pager-nav svg {
1208
+ width: 1rem;
1209
+ height: 1rem;
1210
+ }
1211
+
1212
+ .grid-pager-nav:dir(rtl) svg {
1213
+ transform: scaleX(-1);
1096
1214
  }
1097
1215
 
1098
1216
  .grid-pager-button:hover:not(:disabled) {
@@ -1100,46 +1218,68 @@
1100
1218
  }
1101
1219
 
1102
1220
  .grid-pager-button:focus-visible {
1221
+ z-index: 2;
1103
1222
  outline: 2px solid var(--gridkit-accent);
1104
- outline-offset: 1px;
1223
+ outline-offset: -2px;
1105
1224
  }
1106
1225
 
1107
1226
  .grid-pager-button:disabled {
1108
1227
  color: var(--gridkit-fg-muted);
1109
1228
  cursor: default;
1110
- opacity: 0.5;
1229
+ opacity: 0.45;
1111
1230
  }
1112
1231
 
1113
- .grid-pager-button[aria-current="page"] {
1114
- color: var(--gridkit-fg);
1115
- background-color: var(--gridkit-selected-strong);
1116
- border-color: var(--gridkit-accent);
1232
+ .grid-pager-button[aria-current="page"],
1233
+ .grid-pager-button[aria-current="page"]:hover:not(:disabled) {
1234
+ z-index: 1;
1235
+ color: var(--gridkit-accent);
1236
+ background-color: var(--gridkit-selected);
1237
+ box-shadow: inset 0 0 0 1px var(--gridkit-accent);
1117
1238
  }
1118
1239
 
1119
- .grid-pager-button[aria-current="page"]:hover:not(:disabled) {
1120
- background-color: var(--gridkit-selected-strong);
1240
+ .grid-pager-ellipsis {
1241
+ color: var(--gridkit-fg-muted);
1242
+ cursor: default;
1243
+ user-select: none;
1244
+ }
1245
+
1246
+ /*
1247
+ * The compact status, stacked on an invisible copy of its widest text so
1248
+ * its segment keeps one width from the first page to the last.
1249
+ */
1250
+ .grid-pager-status-slot {
1251
+ display: inline-grid;
1252
+ padding: 0 0.75rem;
1253
+ white-space: nowrap;
1254
+ }
1255
+
1256
+ .grid-pager-status,
1257
+ .grid-pager-status-sizer {
1258
+ grid-area: 1 / 1;
1259
+ text-align: center;
1121
1260
  }
1122
1261
 
1123
1262
  .grid-pager-status {
1124
1263
  color: var(--gridkit-fg-muted);
1125
1264
  }
1126
1265
 
1127
- .grid-pager-ellipsis {
1128
- padding: 0.25rem 0.625rem;
1129
- font-size: 0.8125rem;
1130
- color: var(--gridkit-fg-muted);
1266
+ .grid-pager-status-sizer {
1267
+ visibility: hidden;
1131
1268
  }
1132
1269
 
1133
1270
  .grid-pager-page-size {
1134
1271
  display: inline-flex;
1135
1272
  align-items: center;
1136
- gap: 0.375rem;
1137
- margin-inline-start: auto;
1273
+ gap: 0.5rem;
1138
1274
  color: var(--gridkit-fg-muted);
1139
1275
  }
1140
1276
 
1141
1277
  .grid-pager-page-size select {
1142
- padding: 0.125rem 0.375rem;
1278
+ box-sizing: border-box;
1279
+ height: 2rem;
1280
+ padding: 0 0.375rem;
1281
+ font: inherit;
1282
+ font-variant-numeric: tabular-nums;
1143
1283
  color: var(--gridkit-fg);
1144
1284
  background-color: var(--gridkit-surface);
1145
1285
  border: 1px solid var(--gridkit-line);