@gridkitjs/theme-tailwind 0.0.1 → 0.2.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 +2 -2
  2. package/src/styles.css +79 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridkitjs/theme-tailwind",
3
- "version": "0.0.1",
3
+ "version": "0.2.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",
@@ -29,4 +29,4 @@
29
29
  "peerDependencies": {
30
30
  "tailwindcss": "^4.3.3"
31
31
  }
32
- }
32
+ }
package/src/styles.css CHANGED
@@ -89,6 +89,20 @@
89
89
  white-space: nowrap;
90
90
  }
91
91
 
92
+ /*
93
+ * A column that opts into `wrap` needs all three of the rule above undone —
94
+ * `overflow: hidden` alone would still clip a second line, and
95
+ * `text-overflow: ellipsis` only matters once `overflow` stops being
96
+ * `visible`. Fixed layout still holds the column's width; only its height
97
+ * stops being one line's worth.
98
+ */
99
+ .gridkit-data-grid .header-cell.is-wrapped,
100
+ .gridkit-data-grid .grid-cell.is-wrapped {
101
+ overflow: visible;
102
+ text-overflow: clip;
103
+ white-space: normal;
104
+ }
105
+
92
106
  .gridkit-data-grid .grid-header {
93
107
  background-color: var(--gridkit-surface);
94
108
  }
@@ -126,6 +140,71 @@
126
140
  box-shadow: inset -2px 0 0 0 var(--gridkit-hover-line);
127
141
  }
128
142
 
143
+ /*
144
+ * A reorderable header is the grab zone for its own drag, so a press on it
145
+ * must not select the label instead.
146
+ */
147
+ .gridkit-data-grid .header-cell[tabindex] {
148
+ cursor: grab;
149
+ touch-action: none;
150
+ user-select: none;
151
+ }
152
+
153
+ .gridkit-data-grid .header-cell.is-dragging {
154
+ cursor: grabbing;
155
+ opacity: 0.5;
156
+ }
157
+
158
+ /*
159
+ * The header trailing the pointer. It sits on the body rather than in the
160
+ * table, so it restates what a header cell gets from its place in the grid.
161
+ *
162
+ * `pointer-events: none` is load-bearing: sitting under the cursor, it would
163
+ * otherwise mask every header it passes over and there would be no drop
164
+ * target at all.
165
+ */
166
+ .gridkit-data-grid.drag-ghost {
167
+ position: fixed;
168
+ top: 0;
169
+ left: 0;
170
+ z-index: 50;
171
+ padding: 0.5rem;
172
+ font-weight: 700;
173
+ text-align: center;
174
+ background-color: var(--gridkit-surface);
175
+ border: 1px dashed var(--gridkit-accent);
176
+ /* border-radius: 0.25rem; */
177
+ /* box-shadow: 0 4px 12px oklch(0 0 0 / 0.15); */
178
+ opacity: 0.75;
179
+ pointer-events: none;
180
+ /*
181
+ * Restated because the rule that clips a header's text is scoped to a
182
+ * `.header-cell` inside the grid, and the ghost carries that class while
183
+ * being the grid element itself.
184
+ */
185
+ overflow: hidden;
186
+ text-overflow: ellipsis;
187
+ white-space: nowrap;
188
+ /* Placed by a transform written straight to the node each pointer move. */
189
+ will-change: transform;
190
+ }
191
+
192
+ /*
193
+ * Where the column would land, drawn on the gap's own edge so the one gap
194
+ * between two columns reads as one line.
195
+ *
196
+ * `box-shadow` for the reason the resize line uses it, and because a
197
+ * recoloured `borders-vertical` border would land on the neighbour and read
198
+ * as a column out.
199
+ */
200
+ .gridkit-data-grid .header-cell.is-drop-before {
201
+ box-shadow: inset 2px 0 0 0 var(--gridkit-accent);
202
+ }
203
+
204
+ .gridkit-data-grid .header-cell.is-drop-after {
205
+ box-shadow: inset -2px 0 0 0 var(--gridkit-accent);
206
+ }
207
+
129
208
  /*
130
209
  * `pointer-events: none` keeps the grab zone exactly the handle's 6px — the
131
210
  * grip only says where to click.