@gridkitjs/theme-tailwind 0.0.0-dev-20261106222533

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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +124 -0
  3. package/package.json +32 -0
  4. package/src/styles.css +2015 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Blagoja Blazhevski
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,124 @@
1
+ # @gridkitjs/theme-tailwind
2
+
3
+ Tailwind v4 theme for [GridKit](https://github.com/gridkitjs/gridkitjs) —
4
+ palette tokens, dark mode and the grid's styles.
5
+
6
+ > **Early development.** The API is still moving and may break between minor
7
+ > versions.
8
+
9
+ ```bash
10
+ pnpm add @gridkitjs/theme-tailwind
11
+ ```
12
+
13
+ Import it after Tailwind, in the stylesheet where you import `tailwindcss`:
14
+
15
+ ```css
16
+ @import "tailwindcss";
17
+ @import "@gridkitjs/theme-tailwind/styles.css";
18
+ ```
19
+
20
+ That is all — `@gridkitjs/react` renders semantic class names
21
+ (`gridkit-data-grid`, `header-cell`, `grid-row`), and this stylesheet targets
22
+ them directly. Nothing needs to scan the component source.
23
+
24
+ ## Dark mode
25
+
26
+ GridKit doesn't register its own `dark:` variant — it follows whatever your
27
+ app's Tailwind build already resolves `dark:` to. Out of the box that's the
28
+ OS preference. For the common class-toggle pattern, declare it yourself,
29
+ same as any Tailwind v4 app would:
30
+
31
+ ```css
32
+ @import "tailwindcss";
33
+ @custom-variant dark (&:where(.dark, .dark *));
34
+ @import "@gridkitjs/theme-tailwind/styles.css";
35
+ ```
36
+
37
+ ```js
38
+ document.documentElement.classList.toggle("dark", isDark);
39
+ ```
40
+
41
+ ### Forcing a theme on one grid
42
+
43
+ `.gridkit-light` / `.gridkit-dark` pin a grid to one palette regardless of
44
+ the ambient `dark:` state. Put either on any ancestor of the grid, including
45
+ the grid's own root:
46
+
47
+ ```tsx
48
+ <div className="gridkit-dark">
49
+ <DataGrid ... />
50
+ </div>
51
+ ```
52
+
53
+ ## Theming
54
+
55
+ Every colour is a CSS custom property, so overriding one is plain CSS — no
56
+ Tailwind config:
57
+
58
+ ```css
59
+ :root {
60
+ --gridkit-accent: oklch(0.6 0.17 145);
61
+ --gridkit-line: oklch(0.9 0.01 145);
62
+ }
63
+ ```
64
+
65
+ | Token | What it colours |
66
+ | --------------------------- | ------------------------------------------------------------------------ |
67
+ | `--gridkit-surface` | Header background |
68
+ | `--gridkit-surface-muted` | Hover background |
69
+ | `--gridkit-line` | Borders |
70
+ | `--gridkit-hover-line` | Cell hover outline, resize edge |
71
+ | `--gridkit-fg` | Text |
72
+ | `--gridkit-fg-muted` | Secondary text and icons |
73
+ | `--gridkit-accent` | Focus rings, drop indicators, and the active sort, group and check marks |
74
+ | `--gridkit-selected` | Selected row, column or cell |
75
+ | `--gridkit-selected-strong` | A selected row or cell also hovered |
76
+
77
+ Redefine them inside `@variant dark { }` (or under `.gridkit-dark`) to change
78
+ the dark palette too:
79
+
80
+ ```css
81
+ :root {
82
+ --gridkit-accent: oklch(0.6 0.17 145);
83
+
84
+ @variant dark {
85
+ --gridkit-accent: oklch(0.7 0.15 145);
86
+ }
87
+ }
88
+ ```
89
+
90
+ `--gridkit-selected-strong` earns its place because hover already claims
91
+ `--gridkit-surface-muted`: with one token a selected row would lose its
92
+ highlight under the pointer.
93
+
94
+ ## State classes
95
+
96
+ The grid marks its own state, so a consumer's CSS can reach it too:
97
+
98
+ | Class | On |
99
+ | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
100
+ | `is-selected` | A selected `grid-row`, `header-cell` or `grid-cell` |
101
+ | `is-resizing` / `is-dragging` | The column being resized or dragged |
102
+ | `is-drop-before` / `is-drop-after` | Where a dragged column would land |
103
+ | `is-reorderable` / `is-wrapped` | A header that drags; a cell that wraps |
104
+ | `selectable-rows` / `selectable-columns` / `selectable-cells` | On the grid, per `selectable` |
105
+ | `no-hover-rows` / `no-hover-columns` / `no-hover-cells` | On the grid, per `hoverable` |
106
+ | `is-sorted-asc` / `is-sorted-desc` | A header's `header-sort-toggle` while its column sorts |
107
+ | `is-grouped` | A header's `header-group-toggle` while its column is grouped |
108
+ | `is-expanded` | A group row's `group-toggle` while the group is open |
109
+ | `is-drag-target` / `is-drag-blocked` | The group-by bar while a drag can drop on it; while a header already grouped is dragged at it |
110
+
111
+ The `selectable-*` classes enable and the `no-hover-*` classes disable, because
112
+ selection is off by default and hover is on — each follows its own default.
113
+
114
+ The toolbar (`gridkit-toolbar`), the overlay around every menu and panel
115
+ (`gridkit-overlay`), menus (`gridkit-menu`) and the column chooser
116
+ (`gridkit-column-chooser`) mark their state with ARIA attributes rather than
117
+ classes — `aria-disabled`, `aria-pressed`, `aria-checked`, `aria-expanded` —
118
+ and the stylesheet targets those. An overlay renders into `document.body` and
119
+ carries the grid's `gridkit-light`/`gridkit-dark`, so its selectors are
120
+ top-level, not under `gridkit-data-grid`.
121
+
122
+ ## License
123
+
124
+ MIT © Blagoja Blazhevski
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@gridkitjs/theme-tailwind",
3
+ "version": "0.0.0-dev-20261106222533",
4
+ "description": "Tailwind v4 theme for GridKit — palette tokens, dark mode and grid styles.",
5
+ "license": "MIT",
6
+ "author": "Blagoja Blazhevski",
7
+ "homepage": "https://github.com/gridkitjs/gridkitjs#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/gridkitjs/gridkitjs.git",
11
+ "directory": "packages/theme-tailwind"
12
+ },
13
+ "keywords": [
14
+ "gridkit",
15
+ "datagrid",
16
+ "tailwind",
17
+ "tailwindcss",
18
+ "theme",
19
+ "css"
20
+ ],
21
+ "exports": {
22
+ "./styles.css": "./src/styles.css"
23
+ },
24
+ "files": [
25
+ "src",
26
+ "LICENSE",
27
+ "README.md"
28
+ ],
29
+ "peerDependencies": {
30
+ "tailwindcss": "^4.3.3"
31
+ }
32
+ }