@gridkitjs/theme-css 0.0.0-dev-20261118111459 → 0.0.0-dev-20261118134132
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.
- package/package.json +1 -1
- package/src/styles.css +177 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridkitjs/theme-css",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20261118134132",
|
|
4
4
|
"description": "Plain-CSS theme for GridKit — palette tokens, dark mode and grid styles, no Tailwind needed.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Blagoja Blazhevski",
|
package/src/styles.css
CHANGED
|
@@ -275,10 +275,10 @@
|
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
/*
|
|
278
|
-
* The
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
278
|
+
* The grid's root. The tables scroll inside it, in
|
|
279
|
+
* `.gridkit-data-grid-tables`, so the toolbar, the group-by bar and the
|
|
280
|
+
* pager stay where they are; it scrolls sideways itself only when one of
|
|
281
|
+
* those is wider than it.
|
|
282
282
|
*/
|
|
283
283
|
.gridkit-data-grid-viewport {
|
|
284
284
|
overflow-x: auto;
|
|
@@ -301,35 +301,81 @@
|
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
/*
|
|
304
|
-
* The
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
304
|
+
* The one scroll area for the header, the rows and the footer, on both
|
|
305
|
+
* axes. The tables are exactly as wide as their columns, so columns wider
|
|
306
|
+
* than the space available scroll here rather than squash. The header and
|
|
307
|
+
* footer stick to its top and bottom and stay in view while the rows
|
|
308
|
+
* scroll under them; with one element scrolling sideways they cannot fall
|
|
309
|
+
* out of line with the rows, and a cell made to stick sideways sticks in
|
|
310
|
+
* all three tables alike.
|
|
309
311
|
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
|
|
312
|
+
* `height` bounds the rows alone: the grid sets `--gridkit-body-height`
|
|
313
|
+
* here from it, and `--gridkit-header-height` and
|
|
314
|
+
* `--gridkit-footer-height` from the two tables' measured heights, and
|
|
315
|
+
* the area grows by both. Without `height` the area is as tall as its
|
|
316
|
+
* content and scrolls only sideways, and the header, with nothing
|
|
317
|
+
* scrolling under it, never sticks.
|
|
318
|
+
*/
|
|
319
|
+
.gridkit-data-grid-tables {
|
|
320
|
+
overflow: auto;
|
|
321
|
+
height: calc(
|
|
322
|
+
var(--gridkit-body-height) + var(--gridkit-header-height, 0px) +
|
|
323
|
+
var(--gridkit-footer-height, 0px)
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/*
|
|
328
|
+
* Above the rows scrolled under them. A consumer wanting a divider or
|
|
329
|
+
* shadow at the seam adds their own CSS targeting
|
|
330
|
+
* `.gridkit-data-grid-header`/`.gridkit-data-grid-footer`.
|
|
331
|
+
*/
|
|
332
|
+
.gridkit-data-grid-header {
|
|
333
|
+
position: sticky;
|
|
334
|
+
inset-block-start: 0;
|
|
335
|
+
z-index: 2;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.gridkit-data-grid-footer {
|
|
339
|
+
position: sticky;
|
|
340
|
+
inset-block-end: 0;
|
|
341
|
+
z-index: 2;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/*
|
|
345
|
+
* The rows' rowgroup. As wide as its table, and never narrower than the
|
|
346
|
+
* scroll area, so its box covers every row however far the area scrolls
|
|
347
|
+
* sideways; and at least `height` tall, so under a few rows the space
|
|
348
|
+
* down to the footer is the body's.
|
|
317
349
|
*/
|
|
318
350
|
.gridkit-data-grid-body {
|
|
319
|
-
|
|
320
|
-
|
|
351
|
+
width: max-content;
|
|
352
|
+
min-width: 100%;
|
|
353
|
+
min-height: var(--gridkit-body-height, 0);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/*
|
|
357
|
+
* Keeps a row or cell that keyboard focus or `scrollToRow` scrolls into
|
|
358
|
+
* view clear of the header and footer stuck over the rows. A margin on the
|
|
359
|
+
* rows rather than padding on the scroll area: a header cell, stuck at the
|
|
360
|
+
* area's top, would sit inside that padding, and focusing it would scroll
|
|
361
|
+
* the rows to make room.
|
|
362
|
+
*/
|
|
363
|
+
.gridkit-data-grid-body tr,
|
|
364
|
+
.gridkit-data-grid-body td {
|
|
365
|
+
scroll-margin-block: var(--gridkit-header-height, 0px)
|
|
366
|
+
var(--gridkit-footer-height, 0px);
|
|
321
367
|
}
|
|
322
368
|
|
|
323
369
|
/*
|
|
324
370
|
* Slim scrollbars on the grid's own scroll regions, never on the page: the
|
|
325
|
-
* viewport, the
|
|
326
|
-
* checklist lists. Chromium and Firefox honour
|
|
371
|
+
* viewport, the tables' scroll area, the menus, and the column chooser and
|
|
372
|
+
* filter checklist lists. Chromium and Firefox honour
|
|
327
373
|
* `scrollbar-width`/`scrollbar-color`; the `::-webkit-scrollbar` rules are
|
|
328
374
|
* only for engines that do not, since a browser that supports the standard
|
|
329
375
|
* properties ignores them anyway.
|
|
330
376
|
*/
|
|
331
377
|
.gridkit-data-grid-viewport,
|
|
332
|
-
.gridkit-data-grid-
|
|
378
|
+
.gridkit-data-grid-tables,
|
|
333
379
|
.gridkit-menu,
|
|
334
380
|
.gridkit-column-chooser-list,
|
|
335
381
|
.gridkit-filter-menu-checklist {
|
|
@@ -339,7 +385,7 @@
|
|
|
339
385
|
|
|
340
386
|
@supports not (scrollbar-color: auto) {
|
|
341
387
|
.gridkit-data-grid-viewport::-webkit-scrollbar,
|
|
342
|
-
.gridkit-data-grid-
|
|
388
|
+
.gridkit-data-grid-tables::-webkit-scrollbar,
|
|
343
389
|
.gridkit-menu::-webkit-scrollbar,
|
|
344
390
|
.gridkit-column-chooser-list::-webkit-scrollbar,
|
|
345
391
|
.gridkit-filter-menu-checklist::-webkit-scrollbar {
|
|
@@ -348,7 +394,7 @@
|
|
|
348
394
|
}
|
|
349
395
|
|
|
350
396
|
.gridkit-data-grid-viewport::-webkit-scrollbar-track,
|
|
351
|
-
.gridkit-data-grid-
|
|
397
|
+
.gridkit-data-grid-tables::-webkit-scrollbar-track,
|
|
352
398
|
.gridkit-menu::-webkit-scrollbar-track,
|
|
353
399
|
.gridkit-column-chooser-list::-webkit-scrollbar-track,
|
|
354
400
|
.gridkit-filter-menu-checklist::-webkit-scrollbar-track {
|
|
@@ -356,7 +402,7 @@
|
|
|
356
402
|
}
|
|
357
403
|
|
|
358
404
|
.gridkit-data-grid-viewport::-webkit-scrollbar-thumb,
|
|
359
|
-
.gridkit-data-grid-
|
|
405
|
+
.gridkit-data-grid-tables::-webkit-scrollbar-thumb,
|
|
360
406
|
.gridkit-menu::-webkit-scrollbar-thumb,
|
|
361
407
|
.gridkit-column-chooser-list::-webkit-scrollbar-thumb,
|
|
362
408
|
.gridkit-filter-menu-checklist::-webkit-scrollbar-thumb {
|
|
@@ -478,8 +524,8 @@
|
|
|
478
524
|
* cell is the only sign of where that stop currently is — without this ring a
|
|
479
525
|
* keyboard user is navigating blind.
|
|
480
526
|
*
|
|
481
|
-
* Inset because the
|
|
482
|
-
* would be cut off on the first and last columns.
|
|
527
|
+
* Inset because the scroll area clips its overflow: an outline drawn
|
|
528
|
+
* outwards would be cut off on the first and last columns.
|
|
483
529
|
*/
|
|
484
530
|
.gridkit-data-grid .gridkit-header-cell:focus-visible,
|
|
485
531
|
.gridkit-data-grid .gridkit-grid-cell:focus-visible {
|
|
@@ -751,6 +797,93 @@
|
|
|
751
797
|
);
|
|
752
798
|
}
|
|
753
799
|
|
|
800
|
+
/*
|
|
801
|
+
* A screen that cannot hover never brings the header's toggles out, so
|
|
802
|
+
* there they show at rest, still told apart by colour and fill once the
|
|
803
|
+
* column is sorted, filtered or grouped.
|
|
804
|
+
*/
|
|
805
|
+
@media (hover: none) {
|
|
806
|
+
.gridkit-data-grid
|
|
807
|
+
.gridkit-header-sort-toggle:not(.is-sorted-asc):not(.is-sorted-desc),
|
|
808
|
+
.gridkit-data-grid .gridkit-header-filter-toggle:not(.is-filtered),
|
|
809
|
+
.gridkit-data-grid .gridkit-header-group-toggle:not(.is-grouped) {
|
|
810
|
+
opacity: 1;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
/*
|
|
815
|
+
* A finger needs 24 by 24 pixels to land on, WCAG 2.2's minimum target.
|
|
816
|
+
* Each toggle grows its box by padding around an unchanged icon, and the
|
|
817
|
+
* ones docked to the inline end move inward to sit side by side, clear of
|
|
818
|
+
* the resize handle, which widens to the same 24 pixels. The handle draws
|
|
819
|
+
* nothing of its own, so the line a resize colours stays on the column's
|
|
820
|
+
* edge.
|
|
821
|
+
*/
|
|
822
|
+
@media (pointer: coarse) {
|
|
823
|
+
.gridkit-data-grid .gridkit-header-resize-handle {
|
|
824
|
+
width: 24px;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
.gridkit-data-grid .gridkit-header-sort-toggle,
|
|
828
|
+
.gridkit-data-grid .gridkit-header-filter-toggle,
|
|
829
|
+
.gridkit-data-grid .gridkit-header-group-toggle {
|
|
830
|
+
box-sizing: border-box;
|
|
831
|
+
min-width: 24px;
|
|
832
|
+
min-height: 24px;
|
|
833
|
+
justify-content: center;
|
|
834
|
+
padding: max(0px, calc((24px - var(--gridkit-header-icon-size)) / 2));
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
.gridkit-data-grid .gridkit-header-sort-toggle,
|
|
838
|
+
.gridkit-data-grid .gridkit-header-filter-toggle {
|
|
839
|
+
inset-inline-end: 24px;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
.gridkit-data-grid
|
|
843
|
+
.gridkit-header-cell:has(> .gridkit-header-filter-toggle)
|
|
844
|
+
.gridkit-header-sort-toggle {
|
|
845
|
+
inset-inline-end: 48px;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
/*
|
|
849
|
+
* A touch screen shows the docked toggles at rest, where they would sit
|
|
850
|
+
* over the label, so the label keeps clear of them and is cut short
|
|
851
|
+
* instead.
|
|
852
|
+
*/
|
|
853
|
+
.gridkit-data-grid
|
|
854
|
+
.gridkit-grid-header
|
|
855
|
+
.gridkit-header-cell:has(> .gridkit-header-sort-toggle),
|
|
856
|
+
.gridkit-data-grid
|
|
857
|
+
.gridkit-grid-header
|
|
858
|
+
.gridkit-header-cell:has(> .gridkit-header-filter-toggle) {
|
|
859
|
+
padding-inline-end: 48px;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
.gridkit-data-grid
|
|
863
|
+
.gridkit-grid-header
|
|
864
|
+
.gridkit-header-cell:has(> .gridkit-header-sort-toggle):has(
|
|
865
|
+
> .gridkit-header-filter-toggle
|
|
866
|
+
) {
|
|
867
|
+
padding-inline-end: 72px;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
/* Grown into the header's padding, so the label stays where it was. */
|
|
871
|
+
.gridkit-data-grid .gridkit-header-group-toggle {
|
|
872
|
+
margin-block: min(
|
|
873
|
+
0px,
|
|
874
|
+
calc((var(--gridkit-header-icon-size) - 24px) / 2)
|
|
875
|
+
);
|
|
876
|
+
margin-inline-start: min(
|
|
877
|
+
0px,
|
|
878
|
+
calc((var(--gridkit-header-icon-size) - 24px) / 2)
|
|
879
|
+
);
|
|
880
|
+
margin-inline-end: calc(
|
|
881
|
+
var(--gridkit-spacing) * 1.5 +
|
|
882
|
+
min(0px, calc((var(--gridkit-header-icon-size) - 24px) / 2))
|
|
883
|
+
);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
|
|
754
887
|
.gridkit-data-grid .gridkit-grid-cell {
|
|
755
888
|
padding: var(--gridkit-cell-padding-y) var(--gridkit-cell-padding-x);
|
|
756
889
|
}
|
|
@@ -1121,9 +1254,10 @@
|
|
|
1121
1254
|
|
|
1122
1255
|
/*
|
|
1123
1256
|
* The toolbar: the grid's first child, above the group-by bar, and unscoped
|
|
1124
|
-
* by `.gridkit-data-grid` for the same reason that bar is.
|
|
1125
|
-
*
|
|
1126
|
-
*
|
|
1257
|
+
* by `.gridkit-data-grid` for the same reason that bar is. It sits outside
|
|
1258
|
+
* the tables' scroll area, so it stays in view while they scroll, and it
|
|
1259
|
+
* sticks to the viewport's start edge for the rare grid whose viewport
|
|
1260
|
+
* scrolls sideways itself, under a group-by bar wider than it.
|
|
1127
1261
|
*
|
|
1128
1262
|
* Its entries keep to one row at their own widths, which is what the
|
|
1129
1263
|
* overflow measures: what does not fit goes into "More", and `overflow:
|
|
@@ -2288,13 +2422,25 @@
|
|
|
2288
2422
|
display: none;
|
|
2289
2423
|
}
|
|
2290
2424
|
|
|
2291
|
-
/*
|
|
2425
|
+
/*
|
|
2426
|
+
* No height bound, and nothing scrolls or sticks, so no row is cut off
|
|
2427
|
+
* or printed over, and the footer follows the last row.
|
|
2428
|
+
*/
|
|
2292
2429
|
.gridkit-data-grid-viewport,
|
|
2293
|
-
.gridkit-data-grid-viewport .gridkit-data-grid-
|
|
2430
|
+
.gridkit-data-grid-viewport .gridkit-data-grid-tables {
|
|
2294
2431
|
height: auto;
|
|
2295
2432
|
overflow: visible;
|
|
2296
2433
|
}
|
|
2297
2434
|
|
|
2435
|
+
.gridkit-data-grid-viewport .gridkit-data-grid-header,
|
|
2436
|
+
.gridkit-data-grid-viewport .gridkit-data-grid-footer {
|
|
2437
|
+
position: static;
|
|
2438
|
+
}
|
|
2439
|
+
|
|
2440
|
+
.gridkit-data-grid-viewport .gridkit-data-grid-body {
|
|
2441
|
+
min-height: 0;
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2298
2444
|
.gridkit-data-grid-viewport :focus-visible {
|
|
2299
2445
|
outline: none;
|
|
2300
2446
|
}
|