Skip to content

Commit 2f88a7d

Browse files
committed
wip
1 parent 7a74578 commit 2f88a7d

File tree

1 file changed

+77
-28
lines changed

1 file changed

+77
-28
lines changed

packages/grid/src/styles/vaadin-grid-base-styles.js

Lines changed: 77 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,8 @@ export const gridStyles = css`
9595
position: sticky;
9696
left: 0;
9797
width: 100%;
98-
}
99-
100-
/* :host([overflow~='top']) #header,
101-
:host([overflow~='bottom']) #footer,
102-
:host([navigating]) #header:has(tr:last-child:focus-within),
103-
:host([navigating]) #footer:has(tr:first-child:focus-within),
104-
[empty-state] #header {
10598
z-index: 2;
106-
} */
99+
}
107100
108101
:host([dir='rtl']) #items,
109102
:host([dir='rtl']) #header,
@@ -130,11 +123,6 @@ export const gridStyles = css`
130123
color: var(--vaadin-grid-header-text-color, var(--vaadin-text-color));
131124
}
132125
133-
#header,
134-
#footer {
135-
z-index: 2;
136-
}
137-
138126
[part~='row'] {
139127
display: inline-flex;
140128
min-width: 100%;
@@ -148,6 +136,14 @@ export const gridStyles = css`
148136
#header [part~='row'] {
149137
border-block-start-style: none;
150138
139+
&:first-child,
140+
&:first-child [part~='cell'] {
141+
/* Focus outline */
142+
&::after {
143+
inset-block-start: 0;
144+
}
145+
}
146+
151147
&:last-child {
152148
background: transparent;
153149
}
@@ -165,25 +161,80 @@ export const gridStyles = css`
165161
height: var(--_row-border-width);
166162
background: var(--_border-color);
167163
position: absolute;
168-
inset-inline: 0;
169164
inset-block-start: calc(-1 * var(--_row-border-width));
165+
inset-inline: 0;
166+
}
167+
}
168+
169+
&:last-child,
170+
&:last-child [part~='cell'] {
171+
/* Focus outline */
172+
&::after {
173+
inset-block-end: 0;
170174
}
171175
}
172176
}
173177
174178
#items [part~='row'] {
175179
border-block-start-style: none;
180+
181+
&:empty {
182+
height: 100%;
183+
}
176184
}
177185
178-
:host([overflow~='top']) [part~='last-row'] {
179-
border-block-end-style: none;
186+
/* Grid without header */
187+
#table:not(:has(#header > tr:not([hidden]))) {
188+
#header {
189+
margin-block-start: calc(var(--_row-border-width) * -1);
190+
padding-block-start: var(--_row-border-width);
191+
}
192+
193+
[part~='first-row'],
194+
[part~='first-row'] [part~='cell'] {
195+
/* Focus outline */
196+
&::after {
197+
inset-block-start: 0;
198+
}
199+
}
180200
}
181201
182-
:host([overflow~='bottom']),
183-
:host([overflow~='top']) {
184-
#table:has(#footer > tr:not([hidden])) [part~='last-row'] {
185-
border-block-end-style: solid;
186-
border-block-end-color: transparent;
202+
/* Grid without footer and is at the end */
203+
:host([overflow~='top']):not(:has(#footer > tr:not([hidden]))) {
204+
[part~='last-row'] {
205+
border-block-end-style: none;
206+
}
207+
208+
[part~='last-row'],
209+
[part~='last-row'] [part~='cell'] {
210+
/* Focus outline */
211+
&::after {
212+
inset-block-end: 0;
213+
}
214+
}
215+
}
216+
217+
:host(:is([overflow~='top'], [overflow~='bottom'])) {
218+
#table:has(#footer > tr:not([hidden])) {
219+
[part~='last-row'] {
220+
border-block-end-color: transparent;
221+
}
222+
}
223+
224+
#footer [part~='row']::before {
225+
display: block;
226+
}
227+
}
228+
229+
#scroller[empty-state] {
230+
#table:has(#header > tr:not([hidden])) {
231+
& #emptystatebody {
232+
margin-top: calc(var(--_row-border-width) * -1);
233+
}
234+
235+
& #emptystatecell {
236+
border-block: var(--_row-border-width) solid transparent;
237+
}
187238
}
188239
189240
#footer [part~='row']::before {
@@ -199,10 +250,6 @@ export const gridStyles = css`
199250
transform: translateX(var(--_grid-lazy-columns-start));
200251
}
201252
202-
#items [part~='row']:empty {
203-
height: 100%;
204-
}
205-
206253
[part~='cell'] {
207254
box-sizing: border-box;
208255
background: var(--vaadin-grid-cell-background, var(--vaadin-background-color));
@@ -394,7 +441,6 @@ export const gridStyles = css`
394441
inset: 0;
395442
flex: 1;
396443
overflow: hidden;
397-
/* margin-top: calc(var(--_row-border-width) * -1); */
398444
}
399445
400446
#emptystaterow {
@@ -407,7 +453,6 @@ export const gridStyles = css`
407453
flex: 1;
408454
overflow: auto;
409455
padding: var(--vaadin-grid-cell-padding, var(--vaadin-padding-container));
410-
border-top: var(--_row-border-width) solid transparent;
411456
outline: none;
412457
}
413458
@@ -550,6 +595,10 @@ export const gridStyles = css`
550595
inset-inline-end: 0;
551596
} */
552597
598+
/* #header [part~='row'] {
599+
600+
} */
601+
553602
/* #header [part~='row']:first-child::after,
554603
[part~='first-header-row-cell']::after,
555604
[part*='first-row']::after {
@@ -628,7 +677,7 @@ export const gridStyles = css`
628677
}
629678
630679
[part~='row'][dragstart] {
631-
border-block-color: transparent !important;
680+
border-block: var(--_row-border-width) solid transparent !important;
632681
}
633682
634683
[part~='row'][dragstart] [part~='cell'][last-column] {

0 commit comments

Comments
 (0)