Skip to content

Commit c32ccab

Browse files
authored
refactor(AnalyticalTable): harmonize cell focus for body & header cells (#5973)
related to #5898
1 parent 186638f commit c32ccab

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

packages/main/src/components/AnalyticalTable/AnalyticalTable.module.css

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
.baseCellFocus {
2+
&:focus {
3+
outline: none;
4+
}
5+
&:not([data-empty-row-cell]):focus::after {
6+
content: '';
7+
pointer-events: none;
8+
inset-inline: 1px;
9+
inset-block: 1px;
10+
border: var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--sapContent_FocusColor);
11+
position: absolute;
12+
}
13+
}
14+
115
.table {
216
position: relative;
317
width: 100%;
@@ -80,6 +94,8 @@
8094
}
8195

8296
.th {
97+
composes: baseCellFocus;
98+
8399
height: var(--_ui5wcr-AnalyticalTableHeaderRowHeight);
84100
color: var(--sapList_HeaderTextColor);
85101
background-color: var(--sapList_HeaderBackground);
@@ -112,8 +128,6 @@
112128
&[data-column-id='__ui5wcr__internal_selection_column'] {
113129
border-inline-start: 1px solid transparent;
114130
}
115-
outline-offset: calc(-1 * var(--sapContent_FocusWidth));
116-
outline: var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--sapContent_FocusColor);
117131
}
118132
}
119133

@@ -190,6 +204,8 @@
190204
}
191205

192206
.tableCell {
207+
composes: baseCellFocus;
208+
193209
position: relative;
194210
height: 100%;
195211
box-sizing: border-box;
@@ -209,17 +225,6 @@
209225
border-inline-end: var(--_ui5wcr-AnalyticalTable-OuterCellBorder);
210226
}
211227

212-
&:focus {
213-
outline: none;
214-
}
215-
&:not([data-empty-row-cell]):focus::after {
216-
content: '';
217-
pointer-events: none;
218-
inset-inline: 1px;
219-
inset-block: 1px;
220-
border: var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--sapContent_FocusColor);
221-
position: absolute;
222-
}
223228
&[aria-selected='true']:not([data-empty-row-cell]):focus::after {
224229
inset-block-end: 2px;
225230
}

0 commit comments

Comments
 (0)