Skip to content

Commit 73a4a8b

Browse files
authored
feat(ui5-search): update visual hover and active state of shell search scope (#13256)
1 parent 46007ca commit 73a4a8b

8 files changed

Lines changed: 39 additions & 25 deletions

File tree

packages/fiori/src/themes/SearchField.css

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,29 @@
8585
background-color: var(--_ui5-search-elements-background);
8686
height: var(--_ui5-search-select-height);
8787
--_ui5_select_label_color: var(--sapShell_TextColor);
88+
/* Remove Select's default focus outline without affecting dropdown items */
89+
--_ui5_input_focus_outline_color: transparent;
8890
}
8991

90-
[ui5-select]:hover {
91-
box-shadow: var(--sapField_Hover_Shadow);
92+
[ui5-select]:hover:not(:active):not(:focus-within) {
93+
box-shadow: var(--_ui5-search_input_scope_hover_shadow);
94+
}
95+
96+
[ui5-select]:not(:active):not(:focus-within)::part(icon-wrapper):hover {
97+
box-shadow: var(--_ui5-search_input_scope_hover_shadow);
98+
}
99+
100+
/* Active state for select - only shadow, no background */
101+
[ui5-select]:active,
102+
[ui5-select]:focus-within {
103+
box-shadow: var(--_ui5-search_input_scope_active_shadow);
104+
}
105+
106+
[ui5-select]:active::part(icon-wrapper),
107+
[ui5-select]:focus-within::part(icon-wrapper) {
108+
box-shadow: var(--_ui5-search_input_scope_active_shadow);
109+
background: var(--sapShell_Active_Background);
110+
color: var(--sapShell_Active_TextColor);
92111
}
93112

94113
[ui5-select]::part(icon) {
@@ -158,12 +177,10 @@
158177
padding-inline-start: 0.875rem;
159178
}
160179

161-
[ui5-select]:hover,
162180
.ui5-search-field-inner-input:hover {
163181
background-color: var(--_ui5-search-elements-hover-background);
164182
}
165183

166-
[ui5-select]:focus-within,
167184
.ui5-search-field-inner-input:focus-within {
168185
background-color: var(--_ui5-search-elements-active-background);
169186
}
@@ -273,28 +290,11 @@
273290
--_ui5_input_focus_border_radius: var(--_ui5_search_input_border_radius);
274291
}
275292

276-
.ui5-search-field-select:hover,
277-
.ui5-search-field-select[focused] {
278-
background: var(--_ui5-search-wrapper-hover-background-color);
279-
}
280-
281293
.ui5-search-field-select::part(icon-wrapper) {
282294
border-radius: var(--_ui5_search_input_border_radius);
283295
height: 100%;
284296
}
285297

286-
.ui5-search-field-select[focused]::part(icon-wrapper) {
287-
box-shadow: var(--sapField_Hover_Shadow);
288-
}
289-
290-
:host(:not([collapsed]):hover):has([ui5-select]:hover) {
291-
background: var(--_ui5-search-wrapper-background);
292-
}
293-
294-
:host(:not([collapsed])):has([ui5-select][focused]) {
295-
background: var(--_ui5-search-wrapper-background);
296-
}
297-
298298
.ui5-search-field-inner-input::selection {
299299
background: var(--sapSelectedColor);
300300
color: var(--sapContent_ContrastTextColor);

packages/fiori/src/themes/base/SearchField-parameters.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
--_ui5-search-elements-hover-background: none;
1111
--_ui5-search-elements-active-background: none;
1212
--_ui5_search_input_scope_margin: 0 0.125rem 0 .5rem;
13+
--_ui5-search_input_scope_hover_shadow: inset 0 0 0 var(--sapField_BorderWidth) var(--sapButton_Lite_Hover_BorderColor);
14+
--_ui5-search_input_scope_active_shadow: inset 0 0 0 var(--sapField_BorderWidth) var(--sapButton_Lite_Active_BorderColor);
1315
--_ui5-search-elements-background: inherit;
1416
--_ui5_search_wrapper_outline: var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--sapField_Active_BorderColor);
1517
--_ui5_search_input_outline: none;

packages/fiori/src/themes/sap_fiori_3/SearchField-parameters.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
--_ui5-search-wrapper-hover-background: none;
1010
--_ui5-search-wrapper-hover-background-color: none;
1111
--_ui5_search_input_scope_margin: 0;
12+
--_ui5-search_input_scope_hover_shadow: none;
13+
--_ui5-search_input_scope_active_shadow: none;
1214
--_ui5-search-elements-background: var(--sapShell_InteractiveBackground);
1315
--_ui5-search-elements-hover-background: var(--sapShell_Hover_Background);
1416
--_ui5-search-elements-active-background: var(--sapShell_Active_Background);

packages/fiori/src/themes/sap_fiori_3_dark/SearchField-parameters.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
--_ui5-search-wrapper-hover-background: none;
1010
--_ui5-search-wrapper-hover-background-color: none;
1111
--_ui5_search_input_scope_margin: 0;
12+
--_ui5-search_input_scope_hover_shadow: none;
13+
--_ui5-search_input_scope_active_shadow: none;
1214
--_ui5-search-elements-background: var(--sapShell_InteractiveBackground);
1315
--_ui5-search-elements-hover-background: var(--sapShell_Hover_Background);
1416
--_ui5-search-elements-active-background: var(--sapShell_Active_Background);

packages/fiori/src/themes/sap_fiori_3_hcb/SearchField-parameters.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
--_ui5-search-wrapper-hover-background: none;
1010
--_ui5-search-wrapper-hover-background-color: none;
1111
--_ui5_search_input_scope_margin: 0;
12+
--_ui5-search_input_scope_hover_shadow: none;
13+
--_ui5-search_input_scope_active_shadow: none;
1214
--_ui5-search-elements-background: var(--sapShell_InteractiveBackground);
1315
--_ui5-search-elements-hover-background: var(--sapShell_Hover_Background);
1416
--_ui5-search-elements-active-background: var(--sapShell_Active_Background);

packages/fiori/src/themes/sap_fiori_3_hcw/SearchField-parameters.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
--_ui5-search-wrapper-hover-background: none;
1010
--_ui5-search-wrapper-hover-background-color: none;
1111
--_ui5_search_input_scope_margin: 0;
12+
--_ui5-search_input_scope_hover_shadow: none;
13+
--_ui5-search_input_scope_active_shadow: none;
1214
--_ui5-search-elements-background: var(--sapShell_InteractiveBackground);
1315
--_ui5-search-elements-hover-background: var(--sapShell_Hover_Background);
1416
--_ui5-search-elements-active-background: var(--sapShell_Active_Background);

packages/fiori/src/themes/sap_horizon_hcb/SearchField-parameters.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
--_ui5-search-wrapper-hover-background: none;
1010
--_ui5-search-wrapper-hover-background-color: none;
1111
--_ui5_search_input_scope_margin: 0;
12+
--_ui5-search_input_scope_hover_shadow: none;
13+
--_ui5-search_input_scope_active_shadow: none;
1214
--_ui5-search-elements-background: var(--sapShell_InteractiveBackground);
13-
--_ui5-search-elements-hover-background: var(--sapShell_Hover_Background);
14-
--_ui5-search-elements-active-background: var(--sapShell_Active_Background);
15+
--_ui5-search-elements-hover-background: none;
16+
--_ui5-search-elements-active-background: none;
1517
--_ui5_search_wrapper_outline: none;
1618
--_ui5_search_input_outline: var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--sapField_Active_BorderColor);
1719
--_ui5_search_filter_button_border_radius: 0.375rem;

packages/fiori/src/themes/sap_horizon_hcw/SearchField-parameters.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
--_ui5-search-wrapper-hover-background: none;
1010
--_ui5-search-wrapper-hover-background-color: none;
1111
--_ui5_search_input_scope_margin: 0;
12+
--_ui5-search_input_scope_hover_shadow: none;
13+
--_ui5-search_input_scope_active_shadow: none;
1214
--_ui5-search-elements-background: var(--sapShell_InteractiveBackground);
13-
--_ui5-search-elements-hover-background: var(--sapShell_Hover_Background);
14-
--_ui5-search-elements-active-background: var(--sapShell_Active_Background);
15+
--_ui5-search-elements-hover-background: none;
16+
--_ui5-search-elements-active-background: none;
1517
--_ui5_search_wrapper_outline: none;
1618
--_ui5_search_input_outline: var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--sapField_Active_BorderColor);
1719
--_ui5_search_filter_button_border_radius: 0.375rem;

0 commit comments

Comments
 (0)