@vaadin/grid 25.0.0-beta4 → 25.0.0-beta6

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.
@@ -7,6 +7,7 @@ import '@vaadin/component-base/src/styles/style-props.js';
7
7
  import { css } from 'lit';
8
8
 
9
9
  export const gridStyles = css`
10
+ /* stylelint-disable no-duplicate-selectors */
10
11
  :host {
11
12
  display: flex;
12
13
  max-width: 100%;
@@ -24,6 +25,10 @@ export const gridStyles = css`
24
25
  --_border-color: var(--vaadin-grid-border-color, var(--vaadin-border-color-secondary));
25
26
  --_row-border-width: var(--vaadin-grid-row-border-width, 1px);
26
27
  --_column-border-width: var(--vaadin-grid-column-border-width, 0px);
28
+ --_cell-padding: var(
29
+ --vaadin-grid-cell-padding,
30
+ var(--vaadin-padding-block-container) var(--vaadin-padding-inline-container)
31
+ );
27
32
  border-radius: var(--vaadin-grid-border-radius, var(--vaadin-radius-m));
28
33
  }
29
34
 
@@ -94,13 +99,6 @@ export const gridStyles = css`
94
99
  position: sticky;
95
100
  left: 0;
96
101
  width: 100%;
97
- }
98
-
99
- :host([overflow~='top']) #header,
100
- :host([overflow~='bottom']) #footer,
101
- :host([navigating]) #header:has(tr:last-child:focus-within),
102
- :host([navigating]) #footer:has(tr:first-child:focus-within),
103
- [empty-state] #header {
104
102
  z-index: 2;
105
103
  }
106
104
 
@@ -123,13 +121,13 @@ export const gridStyles = css`
123
121
  }
124
122
 
125
123
  #header th,
126
- [part~='reorder-ghost'] {
124
+ .reorder-ghost {
127
125
  font-size: var(--vaadin-grid-header-font-size, 1em);
128
126
  font-weight: var(--vaadin-grid-header-font-weight, 500);
129
127
  color: var(--vaadin-grid-header-text-color, var(--vaadin-text-color));
130
128
  }
131
129
 
132
- [part~='row'] {
130
+ .row {
133
131
  display: flex;
134
132
  width: 100%;
135
133
  box-sizing: border-box;
@@ -137,51 +135,28 @@ export const gridStyles = css`
137
135
  position: relative;
138
136
  }
139
137
 
140
- [part~='row']:not(:focus-within) {
138
+ .row:not(:focus-within) {
141
139
  --_non-focused-row-none: none;
142
140
  }
143
141
 
144
- [part~='row'][loading] [part~='body-cell'] ::slotted(vaadin-grid-cell-content) {
142
+ .body-row[loading] .body-cell ::slotted(vaadin-grid-cell-content) {
145
143
  visibility: hidden;
146
144
  }
147
145
 
148
- [column-rendering='lazy'] [part~='body-cell']:not([frozen]):not([frozen-to-end]) {
146
+ [column-rendering='lazy'] .body-cell:not([frozen]):not([frozen-to-end]) {
149
147
  transform: translateX(var(--_grid-lazy-columns-start));
150
148
  }
151
149
 
152
- #items [part~='row']:empty {
150
+ #items .row:empty {
153
151
  height: 100%;
154
152
  }
155
153
 
156
- [part~='cell'] {
154
+ .cell {
157
155
  padding: 0;
158
156
  box-sizing: border-box;
159
- background: var(--vaadin-grid-cell-background, var(--vaadin-background-color));
160
- border-block: var(--_row-border-width) solid var(--_border-color);
161
- margin-top: calc(var(--_row-border-width) * -1);
162
-
163
- /*
164
- Box-shadows are used to create a "fake" border at the end of the cell/row, which is visible when a row/cell ends
165
- before the edge of the grid viewport, as well as frozen columns and rows (header and footer).
166
- If there are frozen columns, we'll make the "fake box-shadow border" on the header and footer opaque by rendering
167
- both the border color and cell background color, so that a semi-transparent border color doesn't "stack" when
168
- scrolling horizontally.
169
- */
170
- --_fake-border:
171
- 0 calc(var(--_top, 0) * var(--_row-border-width) * -1) 0 0 var(--_border-color),
172
- 0 calc(var(--_top-opaque, 0) * var(--_row-border-width) * -1) 0 0
173
- var(--vaadin-grid-cell-background-color, var(--vaadin-background-color)),
174
- 0 calc(var(--_bottom, 0) * var(--_row-border-width)) 0 0 var(--_border-color),
175
- 0 calc(var(--_bottom-opaque, 0) * var(--_row-border-width)) 0 0
176
- var(--vaadin-grid-cell-background-color, var(--vaadin-background-color)),
177
- calc(var(--_start, 0) * var(--_column-border-width) * -1) 0 0 0 var(--_border-color),
178
- calc(var(--_end, 0) * var(--_column-border-width)) 0 0 0 var(--_border-color),
179
- calc(var(--_end-opaque, 0) * var(--_column-border-width)) 0 0 0
180
- var(--vaadin-grid-cell-background-color, var(--vaadin-background-color));
181
- box-shadow: var(--_fake-border);
182
- }
183
-
184
- [part~='cell']:where(:not([part~='details-cell'])) {
157
+ }
158
+
159
+ .cell:where(:not(.details-cell)) {
185
160
  flex-shrink: 0;
186
161
  flex-grow: 1;
187
162
  display: flex;
@@ -189,152 +164,230 @@ export const gridStyles = css`
189
164
  position: relative;
190
165
  align-items: center;
191
166
  white-space: nowrap;
192
- border-inline-start: var(--_column-border-width) solid var(--_border-color);
193
167
  }
194
168
 
195
- [part~='first-column-cell'] {
196
- border-inline-start: 0;
169
+ /*
170
+ Block borders
171
+
172
+ ::after - row and cell focus outline
173
+ ::before - header bottom and footer top borders that only appear when scrolling
174
+ */
175
+
176
+ .row::after {
177
+ top: 0;
178
+ bottom: calc(var(--_row-border-width) * -1);
197
179
  }
198
180
 
199
- [part~='first-header-row-cell'],
200
- [part~='first-footer-row-cell'],
201
- [part~='first-row-cell'] {
202
- margin-top: 0;
203
- border-top: 0;
181
+ .body-row {
182
+ scroll-margin-bottom: var(--_row-border-width);
204
183
  }
205
184
 
206
- table[has-header] [part~='first-row-cell'] {
207
- border-top: var(--_row-border-width) solid var(--_border-color);
185
+ .cell {
186
+ border-block: var(--_row-border-width) var(--_border-color);
187
+ border-top-style: solid;
208
188
  }
209
189
 
210
- [part~='last-column-cell'] {
211
- --_end: 1;
190
+ .cell::after {
191
+ top: calc(var(--_row-border-width) * -1);
192
+ bottom: calc(var(--_row-border-width) * -1);
212
193
  }
213
194
 
214
- [part~='last-column-cell']:is([part~='header-cell'], [part~='footer-cell']) {
215
- --_end-opaque: 1;
195
+ /* Block borders / Last header row and first footer row */
196
+
197
+ .last-header-row::before,
198
+ .first-footer-row::before {
199
+ position: absolute;
200
+ inset-inline: 0;
201
+ border-block: var(--_row-border-width) var(--_border-color);
202
+ transform: translateX(var(--_grid-horizontal-scroll-position));
216
203
  }
217
204
 
218
- [part~='last-row-cell']:where(:not([part~='details-opened-row-cell'])),
219
- [part~='last-footer-row-cell'] {
220
- border-bottom: 0;
221
- --_bottom: 1;
205
+ /* Block borders / First header row */
206
+
207
+ .first-header-row-cell {
208
+ border-top-style: none;
222
209
  }
223
210
 
224
- [part~='last-frozen-cell'] {
225
- --_end: 1;
211
+ .first-header-row-cell::after {
212
+ top: 0;
226
213
  }
227
214
 
228
- [part~='last-frozen-cell'] + [part~='cell'] {
229
- border-inline-start-color: transparent;
215
+ /* Block borders / Last header row */
216
+
217
+ :host([overflow~='top']) .last-header-row::before {
218
+ content: '';
219
+ bottom: calc(var(--_row-border-width) * -1);
220
+ border-bottom-style: solid;
230
221
  }
231
222
 
232
- [part~='first-frozen-to-end-cell'] {
233
- border-inline-start: 0;
234
- --_start: 1;
223
+ /* Block borders / First body row */
224
+
225
+ #table:not([has-header]) .first-row-cell {
226
+ border-top-style: none;
235
227
  }
236
228
 
237
- [part~='last-header-row-cell'] {
238
- border-bottom: 0;
229
+ #table:not([has-header]) .first-row-cell::after {
230
+ top: 0;
239
231
  }
240
232
 
241
- :host([overflow~='top']) [part~='last-header-row-cell'],
242
- [empty-state] [part~='last-header-row-cell'] {
243
- --_bottom: 1;
233
+ /* Block borders / Last body row */
234
+
235
+ .last-row::after {
236
+ bottom: 0;
244
237
  }
245
238
 
246
- #header:has(:is([frozen], [frozen-to-end])) [part~='last-header-row-cell'] {
247
- --_bottom-opaque: 1;
239
+ .last-row .details-cell,
240
+ .last-row-cell:not(.details-opened-row-cell) {
241
+ border-bottom-style: solid;
248
242
  }
249
243
 
250
- :host([overflow~='bottom']) [part~='first-footer-row-cell'],
251
- [empty-state] [part~='first-footer-row-cell'] {
252
- --_top: 1;
244
+ /* Block borders / Last body row without footer */
245
+
246
+ :host([all-rows-visible]),
247
+ :host([overflow~='top']),
248
+ :host([overflow~='bottom']) {
249
+ #table:not([has-footer]) .last-row .details-cell,
250
+ #table:not([has-footer]) .last-row-cell:not(.details-opened-row-cell) {
251
+ border-bottom-style: none;
252
+
253
+ &::after {
254
+ bottom: 0;
255
+ }
256
+ }
253
257
  }
254
258
 
255
- #footer:has(:is([frozen], [frozen-to-end])) [part~='first-footer-row-cell'] {
256
- --_top-opaque: 1;
259
+ /* Block borders / First footer row */
260
+
261
+ .first-footer-row::after {
262
+ top: calc(var(--_row-border-width) * -1);
257
263
  }
258
264
 
259
- table[has-footer] [part~='last-row-cell']:not([part~='details-opened-row-cell']) {
260
- border-bottom: var(--_row-border-width) solid var(--_border-color);
261
- --_bottom: 0;
265
+ .first-footer-row-cell {
266
+ border-top-style: none;
262
267
  }
263
268
 
264
- [part~='body-cell']:where(:not([part~='details-cell'])) {
265
- --_highlight-background-color: var(--vaadin-grid-row-highlight-background-color, transparent);
266
- --_highlight-background-image: linear-gradient(
267
- var(--_highlight-background-color),
268
- var(--_highlight-background-color)
269
- );
270
- background:
271
- var(--_hover-background-image, none), var(--_selected-background-image, none), var(--_highlight-background-image),
272
- var(--vaadin-grid-cell-background-color, var(--vaadin-background-color));
269
+ :host([overflow~='bottom']),
270
+ :host(:not([overflow~='top']):not([all-rows-visible])) #scroller:not([empty-state]) {
271
+ .first-footer-row::before {
272
+ content: '';
273
+ top: calc(var(--_row-border-width) * -1);
274
+ border-top-style: solid;
275
+ }
273
276
  }
274
277
 
275
- /* Variant: wrap cell contents */
278
+ /* Block borders / Last footer row */
276
279
 
277
- :host([theme~='wrap-cell-content']) [part~='cell']:not([part~='details-cell']) {
278
- white-space: normal;
280
+ .last-footer-row::after,
281
+ .last-footer-row-cell::after {
282
+ bottom: 0;
283
+ }
284
+
285
+ /* Inline borders */
286
+
287
+ .cell {
288
+ border-inline: var(--_column-border-width) var(--_border-color);
279
289
  }
280
290
 
281
- /* Variant: row stripes */
282
- [part~='odd-row'] {
283
- --vaadin-grid-cell-background-color: var(--vaadin-grid-row-odd-background-color, var(--vaadin-background-color));
291
+ .header-cell:not(.first-column-cell),
292
+ .footer-cell:not(.first-column-cell),
293
+ .body-cell:not(.first-column-cell) {
294
+ border-inline-start-style: solid;
284
295
  }
285
296
 
286
- :host([theme~='row-stripes']) [part~='odd-row'] {
287
- --vaadin-grid-cell-background-color: var(
288
- --vaadin-grid-row-odd-background-color,
289
- color-mix(in srgb, var(--vaadin-text-color) 4%, var(--vaadin-background-color))
297
+ .last-frozen-cell:not(.last-column-cell) {
298
+ border-inline-end-style: solid;
299
+
300
+ & + .cell {
301
+ border-inline-start-style: none;
302
+ }
303
+ }
304
+
305
+ /* Row and cell background */
306
+
307
+ .row {
308
+ background-color: var(--vaadin-grid-row-background-color, var(--vaadin-background-color));
309
+ }
310
+
311
+ .cell {
312
+ --_cell-background-image: linear-gradient(
313
+ var(--vaadin-grid-cell-background-color, transparent),
314
+ var(--vaadin-grid-cell-background-color, transparent)
290
315
  );
316
+
317
+ background-color: inherit;
318
+ background-repeat: no-repeat;
319
+ background-origin: padding-box;
320
+ background-image: var(--_cell-background-image);
291
321
  }
292
322
 
293
- /* Raise highlighted rows above others */
323
+ .body-cell {
324
+ --_cell-highlight-background-image: linear-gradient(
325
+ var(--vaadin-grid-row-highlight-background-color, transparent),
326
+ var(--vaadin-grid-row-highlight-background-color, transparent)
327
+ );
294
328
 
295
- [part~='row']:focus,
296
- [part~='row']:focus-within,
297
- [part~='body-row']:where([selected]) {
298
- z-index: 3;
329
+ background-image:
330
+ var(--_row-hover-background-image, none), var(--_row-selected-background-image, none),
331
+ var(--_cell-highlight-background-image, none), var(--_row-odd-background-image, none),
332
+ var(--_cell-background-image, none);
299
333
  }
300
334
 
301
- @container style(--vaadin-grid-row-odd-background-color) {
302
- [part~='odd-row'] {
303
- z-index: 1;
304
- }
335
+ .selected-row {
336
+ --_row-selected-background-color: var(
337
+ --vaadin-grid-row-selected-background-color,
338
+ color-mix(in srgb, currentColor 8%, transparent)
339
+ );
340
+ --_row-selected-background-image: linear-gradient(
341
+ var(--_row-selected-background-color),
342
+ var(--_row-selected-background-color)
343
+ );
305
344
  }
306
345
 
307
- /* Row hover */
308
346
  @media (any-hover: hover) {
309
- @container style(--vaadin-grid-row-hover-background-color) {
310
- [part~='body-row']:hover {
311
- z-index: 2;
312
- }
347
+ .body-row:hover {
348
+ --_row-hover-background-color: var(--vaadin-grid-row-hover-background-color, transparent);
349
+ --_row-hover-background-image: linear-gradient(
350
+ var(--_row-hover-background-color),
351
+ var(--_row-hover-background-color)
352
+ );
313
353
  }
354
+ }
355
+
356
+ :host([theme~='row-stripes']) .odd-row {
357
+ --_row-odd-background-color: var(
358
+ --vaadin-grid-row-odd-background-color,
359
+ color-mix(in srgb, var(--vaadin-text-color) 4%, transparent)
360
+ );
361
+ --_row-odd-background-image: linear-gradient(var(--_row-odd-background-color), var(--_row-odd-background-color));
362
+ }
363
+
364
+ /* Variant: wrap cell contents */
365
+
366
+ :host([theme~='wrap-cell-content']) .cell:not(.details-cell) {
367
+ white-space: normal;
368
+ }
314
369
 
315
- [part~='body-row']:hover [part~='cell']:where(:not([part~='details-cell'])) {
316
- --_hover-background-color: var(--vaadin-grid-row-hover-background-color, transparent);
317
- --_hover-background-image: linear-gradient(var(--_hover-background-color), var(--_hover-background-color));
370
+ /* Raise highlighted rows above others */
371
+ .row,
372
+ .frozen-cell,
373
+ .frozen-to-end-cell {
374
+ &:focus,
375
+ &:focus-within {
376
+ z-index: 3;
318
377
  }
319
378
  }
320
379
 
321
- [part~='details-cell'] {
380
+ .details-cell {
322
381
  position: absolute;
323
382
  bottom: 0;
324
383
  width: 100%;
325
- margin-top: 0;
326
- border-top: 0;
327
384
  }
328
385
 
329
- [part~='last-row-cell'] + [part~='details-cell'] {
330
- border-bottom: 0;
331
- }
332
-
333
- [part~='cell'] ::slotted(vaadin-grid-cell-content) {
386
+ .cell ::slotted(vaadin-grid-cell-content) {
334
387
  display: block;
335
388
  overflow: hidden;
336
389
  text-overflow: ellipsis;
337
- padding: var(--vaadin-grid-cell-padding, var(--vaadin-padding-container));
390
+ padding: var(--_cell-padding);
338
391
  flex: 1;
339
392
  min-height: 1lh;
340
393
  min-width: 0;
@@ -346,15 +399,6 @@ export const gridStyles = css`
346
399
  will-change: transform;
347
400
  }
348
401
 
349
- /* Selected row */
350
- [part~='body-row'][selected] {
351
- --_selected-background-color: var(
352
- --vaadin-grid-row-selected-background-color,
353
- color-mix(in srgb, currentColor 8%, transparent)
354
- );
355
- --_selected-background-image: linear-gradient(var(--_selected-background-color), var(--_selected-background-color));
356
- }
357
-
358
402
  /* Empty state */
359
403
  #scroller:not([empty-state]) #emptystatebody,
360
404
  #scroller[empty-state] #items {
@@ -367,7 +411,6 @@ export const gridStyles = css`
367
411
  inset: 0;
368
412
  flex: 1;
369
413
  overflow: hidden;
370
- margin-top: calc(var(--_row-border-width) * -1);
371
414
  }
372
415
 
373
416
  #emptystaterow {
@@ -379,9 +422,17 @@ export const gridStyles = css`
379
422
  display: block;
380
423
  flex: 1;
381
424
  overflow: auto;
382
- padding: var(--vaadin-grid-cell-padding, var(--vaadin-padding-container));
383
- border-top: var(--_row-border-width) solid transparent;
425
+ padding: var(--_cell-padding);
384
426
  outline: none;
427
+ border-block: var(--_row-border-width) var(--_border-color);
428
+ }
429
+
430
+ #table[has-header] #emptystatecell {
431
+ border-top-style: solid;
432
+ }
433
+
434
+ #table[has-footer] #emptystatecell {
435
+ border-bottom-style: solid;
385
436
  }
386
437
 
387
438
  #emptystatecell:focus-visible {
@@ -390,20 +441,20 @@ export const gridStyles = css`
390
441
  }
391
442
 
392
443
  /* Reordering styles */
393
- :host([reordering]) [part~='cell'] ::slotted(vaadin-grid-cell-content),
394
- :host([reordering]) [part~='resize-handle'],
395
- #scroller[no-content-pointer-events] [part~='cell'] ::slotted(vaadin-grid-cell-content) {
444
+ :host([reordering]) .cell ::slotted(vaadin-grid-cell-content),
445
+ :host([reordering]) .resize-handle,
446
+ #scroller[no-content-pointer-events] .cell ::slotted(vaadin-grid-cell-content) {
396
447
  pointer-events: none;
397
448
  }
398
449
 
399
- [part~='reorder-ghost'] {
450
+ .reorder-ghost {
400
451
  visibility: hidden;
401
452
  position: fixed;
402
453
  pointer-events: none;
403
454
  box-shadow:
404
455
  0 0 0 1px hsla(0deg, 0%, 0%, 0.2),
405
456
  0 8px 24px -2px hsla(0deg, 0%, 0%, 0.2);
406
- padding: var(--vaadin-grid-cell-padding, var(--vaadin-padding-container)) !important;
457
+ padding: var(--_cell-padding) !important;
407
458
  border-radius: 3px;
408
459
 
409
460
  /* Prevent overflowing the grid in Firefox */
@@ -416,12 +467,12 @@ export const gridStyles = css`
416
467
  user-select: none;
417
468
  }
418
469
 
419
- :host([reordering]) [part~='cell'] {
470
+ :host([reordering]) .cell {
420
471
  /* TODO expose a custom property to control this */
421
472
  --_reorder-curtain-filter: brightness(0.9) contrast(1.1);
422
473
  }
423
474
 
424
- :host([reordering]) [part~='cell']::after {
475
+ :host([reordering]) .cell::after {
425
476
  content: '';
426
477
  position: absolute;
427
478
  inset: 0;
@@ -431,17 +482,17 @@ export const gridStyles = css`
431
482
  outline: 0;
432
483
  }
433
484
 
434
- :host([reordering]) [part~='cell'][reorder-status='allowed'] {
485
+ :host([reordering]) .cell[reorder-status='allowed'] {
435
486
  /* TODO expose a custom property to control this */
436
487
  --_reorder-curtain-filter: brightness(0.94) contrast(1.07);
437
488
  }
438
489
 
439
- :host([reordering]) [part~='cell'][reorder-status='dragging'] {
490
+ :host([reordering]) .cell[reorder-status='dragging'] {
440
491
  --_reorder-curtain-filter: none;
441
492
  }
442
493
 
443
494
  /* Resizing styles */
444
- [part~='resize-handle'] {
495
+ .resize-handle {
445
496
  position: absolute;
446
497
  top: 0;
447
498
  inset-inline-end: 0;
@@ -455,17 +506,17 @@ export const gridStyles = css`
455
506
  translate: var(--_column-border-width);
456
507
  }
457
508
 
458
- [part~='last-column-cell'] [part~='resize-handle'] {
509
+ .last-column-cell .resize-handle {
459
510
  translate: 0;
460
511
  }
461
512
 
462
- :host(:not([reordering])) *:not([column-resizing]) [part='resize-handle']:hover,
463
- [part='resize-handle']:active {
513
+ :host(:not([reordering])) *:not([column-resizing]) .resize-handle:hover,
514
+ .resize-handle:active {
464
515
  opacity: 1;
465
516
  transition-delay: 0.15s;
466
517
  }
467
518
 
468
- [part~='resize-handle']::before {
519
+ .resize-handle::before {
469
520
  position: absolute;
470
521
  content: '';
471
522
  height: 100%;
@@ -473,25 +524,25 @@ export const gridStyles = css`
473
524
  translate: calc(-50% + var(--vaadin-focus-ring-width) / 2);
474
525
  }
475
526
 
476
- :host([dir='rtl']) [part~='resize-handle']::before {
527
+ :host([dir='rtl']) .resize-handle::before {
477
528
  translate: calc(50% - var(--vaadin-focus-ring-width) / 2);
478
529
  }
479
530
 
480
- [first-frozen-to-end] [part~='resize-handle']::before,
481
- :is([last-column], [last-frozen]) [part~='resize-handle']::before {
531
+ [first-frozen-to-end] .resize-handle::before,
532
+ :is([last-column], [last-frozen]) .resize-handle::before {
482
533
  width: 8px;
483
534
  translate: 0;
484
535
  }
485
536
 
486
- :is([last-column], [last-frozen]) [part~='resize-handle']::before {
537
+ :is([last-column], [last-frozen]) .resize-handle::before {
487
538
  inset-inline-end: 0;
488
539
  }
489
540
 
490
- [frozen-to-end] :is([part~='resize-handle'], [part~='resize-handle']::before) {
541
+ [frozen-to-end] :is(.resize-handle, .resize-handle::before) {
491
542
  inset-inline: 0 auto;
492
543
  }
493
544
 
494
- [frozen-to-end] [part~='resize-handle'] {
545
+ [frozen-to-end] .resize-handle {
495
546
  translate: calc(var(--_column-border-width) * -1);
496
547
  }
497
548
 
@@ -505,65 +556,45 @@ export const gridStyles = css`
505
556
  }
506
557
 
507
558
  /* Focus outline element, also used for d'n'd indication */
508
- :is([part~='row'], [part~='cell'])::after {
559
+ :is(.row, .cell)::after {
509
560
  position: absolute;
510
- inset: calc(var(--_row-border-width) * -1) calc(var(--_column-border-width) * -1);
511
561
  z-index: 3;
562
+ inset-inline: 0;
512
563
  pointer-events: none;
513
564
  outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
514
565
  outline-offset: calc(var(--vaadin-focus-ring-width) * -1);
515
566
  }
516
567
 
517
- [part~='first-column-cell']::after {
518
- inset-inline-start: 0;
519
- }
520
-
521
- [part~='last-column-cell']::after {
522
- inset-inline-end: 0;
523
- }
524
-
525
- #header [part~='row']:first-child::after,
526
- [part~='first-header-row-cell']::after,
527
- [part*='first-row']::after {
528
- top: 0;
568
+ .row::after {
569
+ transform: translateX(var(--_grid-horizontal-scroll-position));
529
570
  }
530
571
 
531
- table[has-header] [part~='first-row-cell']::after {
532
- top: calc(var(--_row-border-width) * -1);
572
+ .cell:where(:not(.details-cell))::after {
573
+ inset-inline: calc(var(--_column-border-width) * -1);
533
574
  }
534
575
 
535
- #footer [part~='row']:last-child::after,
536
- [part~='last-footer-row-cell']::after,
537
- [part~='last-row']::after,
538
- [part~='last-row-cell']::after {
539
- bottom: 0;
576
+ .first-column-cell::after {
577
+ inset-inline-start: 0;
540
578
  }
541
579
 
542
- #header [part~='row']:last-child::after,
543
- table[has-footer] [part*='last-row']::after {
544
- bottom: calc(var(--_row-border-width) * -1);
580
+ .last-column-cell::after {
581
+ inset-inline-end: 0;
545
582
  }
546
583
 
547
- :host([navigating]) [part~='row']:focus,
548
- :host([navigating]) [part~='cell']:focus {
584
+ :host([navigating]) .row:focus,
585
+ :host([navigating]) .cell:focus {
549
586
  outline: 0;
550
587
  }
551
588
 
552
- [part~='row']::after {
553
- transform: translateX(var(--_grid-horizontal-scroll-position));
554
- inset-inline: 0;
555
- bottom: 0;
556
- }
557
-
558
- [part~='row']:focus-visible,
559
- [part~='cell']:focus-visible {
589
+ .row:focus-visible,
590
+ .cell:focus-visible {
560
591
  outline: 0;
561
592
  }
562
593
 
563
- [part~='row']:focus-visible::after,
564
- [part~='cell']:focus-visible::after,
565
- :host([navigating]) [part~='row']:focus::after,
566
- :host([navigating]) [part~='cell']:focus::after {
594
+ .row:focus-visible::after,
595
+ .cell:focus-visible::after,
596
+ :host([navigating]) .row:focus::after,
597
+ :host([navigating]) .cell:focus::after {
567
598
  content: '';
568
599
  }
569
600
 
@@ -573,50 +604,48 @@ export const gridStyles = css`
573
604
  outline-offset: calc(var(--vaadin-grid-border-width, 1px) * -1);
574
605
  }
575
606
 
576
- [part~='row'][dragover] {
607
+ .row[dragover] {
577
608
  z-index: 100 !important;
578
609
  }
579
610
 
580
- [part~='row'][dragover]::after {
611
+ .row[dragover]::after {
581
612
  content: '';
582
613
  }
583
614
 
584
- [part~='row'][dragover='above']::after {
615
+ .row[dragover='above']::after {
585
616
  outline: 0;
586
617
  border-top: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
587
618
  }
588
619
 
589
- [part~='row']:not([part*='first-row'])[dragover='above']::after,
590
- table[has-header] [part*='first-row'][dragover='above']::after {
620
+ .row:not(.first-row)[dragover='above']::after {
591
621
  top: calc(var(--vaadin-focus-ring-width) / -2);
592
622
  }
593
623
 
594
- [part~='row'][dragover='below']::after {
624
+ .row[dragover='below']::after {
595
625
  outline: 0;
596
626
  border-bottom: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
597
627
  }
598
628
 
599
- [part~='row']:not([part*='last-row'])[dragover='below']::after,
600
- table[has-footer] [part*='last-row'][dragover='below']::after {
629
+ .row:not(.last-row)[dragover='below']::after {
601
630
  bottom: calc(var(--vaadin-focus-ring-width) / -2);
602
631
  }
603
632
 
604
- [part~='row'][dragstart] [part~='cell'] {
605
- border-block-color: transparent !important;
606
- box-shadow: none;
633
+ .row[dragstart] .cell {
634
+ border-block: none !important;
635
+ padding-block: var(--_row-border-width) !important;
607
636
  }
608
637
 
609
- [part~='row'][dragstart] [part~='cell'][last-column] {
638
+ .row[dragstart] .cell[last-column] {
610
639
  border-radius: 0 3px 3px 0;
611
640
  }
612
641
 
613
- [part~='row'][dragstart] [part~='cell'][first-column] {
642
+ .row[dragstart] .cell[first-column] {
614
643
  border-radius: 3px 0 0 3px;
615
644
  }
616
645
 
617
646
  /* Indicates the number of dragged rows */
618
647
  /* TODO export custom properties to control styles */
619
- #scroller [part~='row'][dragstart]:not([dragstart=''])::before {
648
+ #scroller .row[dragstart]:not([dragstart=''])::before {
620
649
  position: absolute;
621
650
  left: var(--_grid-drag-start-x);
622
651
  top: var(--_grid-drag-start-y);
@@ -640,12 +669,12 @@ export const gridStyles = css`
640
669
  visibility: hidden;
641
670
  }
642
671
 
643
- #sizer [part~='details-cell'],
644
- #sizer [part~='cell'] ::slotted(vaadin-grid-cell-content) {
672
+ #sizer .details-cell,
673
+ #sizer .cell ::slotted(vaadin-grid-cell-content) {
645
674
  display: none !important;
646
675
  }
647
676
 
648
- #sizer [part~='cell'] {
677
+ #sizer .cell {
649
678
  display: block;
650
679
  flex-shrink: 0;
651
680
  line-height: 0;
@@ -656,19 +685,7 @@ export const gridStyles = css`
656
685
  border: none !important;
657
686
  }
658
687
 
659
- #sizer [part~='cell']::before {
688
+ #sizer .cell::before {
660
689
  content: '-';
661
690
  }
662
-
663
- @media (forced-colors: active) {
664
- :host([overflow~='top']) [part~='last-header-row-cell'] {
665
- border-bottom: var(--_row-border-width) solid;
666
- margin-bottom: calc(var(--_row-border-width) * -1);
667
- }
668
-
669
- :host([overflow~='bottom']) [part~='first-footer-row-cell'] {
670
- border-top: var(--_row-border-width) solid;
671
- margin-top: calc(var(--_row-border-width) * -1);
672
- }
673
- }
674
691
  `;