@gridkitjs/theme-css 0.0.0-dev-20261118115237 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/styles.css +90 -31
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridkitjs/theme-css",
3
- "version": "0.0.0-dev-20261118115237",
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 table is exactly as wide as its columns, so anything wider than the
279
- * space available scrolls here rather than squashing the columns. Scrolls
280
- * the header, body, and footer tables together, since all three are
281
- * descendants of this one viewport.
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 row area alone. `height` unset leaves this `auto` — exactly the
305
- * content-driven height the single-table layout had before the
306
- * header/body/footer split — and a consumer-set `height` bounds only this
307
- * div, so the group-by bar, header, footer, and pager stay outside it and
308
- * always visible while the rows scroll independently.
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
- * No `position: sticky` here or anywhere else in this file for the header/
311
- * footer: they don't need it. Splitting header, body, and footer into
312
- * sibling `<table>`s already keeps the header and footer out of the region
313
- * that scrolls — there's nothing to "stick," since they were never going
314
- * to scroll away. A consumer wanting a divider or shadow at the seam adds
315
- * their own CSS targeting `.gridkit-data-grid-header`/
316
- * `.gridkit-data-grid-footer`.
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
- overflow-y: auto;
320
- height: var(--gridkit-body-height, auto);
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 row area, the menus, and the column chooser and filter
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-body,
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-body::-webkit-scrollbar,
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-body::-webkit-scrollbar-track,
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-body::-webkit-scrollbar-thumb,
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 viewport clips its overflow: an outline drawn outwards
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 {
@@ -1208,9 +1254,10 @@
1208
1254
 
1209
1255
  /*
1210
1256
  * The toolbar: the grid's first child, above the group-by bar, and unscoped
1211
- * by `.gridkit-data-grid` for the same reason that bar is. The grid scrolls
1212
- * sideways with everything in it, so the toolbar sticks to its start edge
1213
- * and stays in view while the tables scroll on under it.
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.
1214
1261
  *
1215
1262
  * Its entries keep to one row at their own widths, which is what the
1216
1263
  * overflow measures: what does not fit goes into "More", and `overflow:
@@ -2375,13 +2422,25 @@
2375
2422
  display: none;
2376
2423
  }
2377
2424
 
2378
- /* No height bound, and nothing scrolls, so no row is cut off. */
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
+ */
2379
2429
  .gridkit-data-grid-viewport,
2380
- .gridkit-data-grid-viewport .gridkit-data-grid-body {
2430
+ .gridkit-data-grid-viewport .gridkit-data-grid-tables {
2381
2431
  height: auto;
2382
2432
  overflow: visible;
2383
2433
  }
2384
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
+
2385
2444
  .gridkit-data-grid-viewport :focus-visible {
2386
2445
  outline: none;
2387
2446
  }