@gridkitjs/theme-tailwind 0.0.1 → 0.1.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 +65 -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.1.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
@@ -126,6 +126,71 @@
126
126
  box-shadow: inset -2px 0 0 0 var(--gridkit-hover-line);
127
127
  }
128
128
 
129
+ /*
130
+ * A reorderable header is the grab zone for its own drag, so a press on it
131
+ * must not select the label instead.
132
+ */
133
+ .gridkit-data-grid .header-cell[tabindex] {
134
+ cursor: grab;
135
+ touch-action: none;
136
+ user-select: none;
137
+ }
138
+
139
+ .gridkit-data-grid .header-cell.is-dragging {
140
+ cursor: grabbing;
141
+ opacity: 0.5;
142
+ }
143
+
144
+ /*
145
+ * The header trailing the pointer. It sits on the body rather than in the
146
+ * table, so it restates what a header cell gets from its place in the grid.
147
+ *
148
+ * `pointer-events: none` is load-bearing: sitting under the cursor, it would
149
+ * otherwise mask every header it passes over and there would be no drop
150
+ * target at all.
151
+ */
152
+ .gridkit-data-grid.drag-ghost {
153
+ position: fixed;
154
+ top: 0;
155
+ left: 0;
156
+ z-index: 50;
157
+ padding: 0.5rem;
158
+ font-weight: 700;
159
+ text-align: center;
160
+ background-color: var(--gridkit-surface);
161
+ border: 1px dashed var(--gridkit-accent);
162
+ /* border-radius: 0.25rem; */
163
+ /* box-shadow: 0 4px 12px oklch(0 0 0 / 0.15); */
164
+ opacity: 0.75;
165
+ pointer-events: none;
166
+ /*
167
+ * Restated because the rule that clips a header's text is scoped to a
168
+ * `.header-cell` inside the grid, and the ghost carries that class while
169
+ * being the grid element itself.
170
+ */
171
+ overflow: hidden;
172
+ text-overflow: ellipsis;
173
+ white-space: nowrap;
174
+ /* Placed by a transform written straight to the node each pointer move. */
175
+ will-change: transform;
176
+ }
177
+
178
+ /*
179
+ * Where the column would land, drawn on the gap's own edge so the one gap
180
+ * between two columns reads as one line.
181
+ *
182
+ * `box-shadow` for the reason the resize line uses it, and because a
183
+ * recoloured `borders-vertical` border would land on the neighbour and read
184
+ * as a column out.
185
+ */
186
+ .gridkit-data-grid .header-cell.is-drop-before {
187
+ box-shadow: inset 2px 0 0 0 var(--gridkit-accent);
188
+ }
189
+
190
+ .gridkit-data-grid .header-cell.is-drop-after {
191
+ box-shadow: inset -2px 0 0 0 var(--gridkit-accent);
192
+ }
193
+
129
194
  /*
130
195
  * `pointer-events: none` keeps the grab zone exactly the handle's 6px — the
131
196
  * grip only says where to click.