Skip to content

Commit ca81343

Browse files
authored
fix(ui5-toggle-button): align active state styling with hover state when pressed (#12486)
Previously the ui5-toggle-button component used the default white active background when a pressed (toggled) button was clicked. With this change the pressed active state uses the hover active background for consistent visual feedback across all design variants.
1 parent 0a71381 commit ca81343

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

packages/main/src/themes/ToggleButton.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@
3838
color: var(--sapButton_Selected_TextColor);
3939
}
4040

41+
:host([pressed][active]:not([disabled])),
42+
:host([design="Default"][pressed][active]:not([disabled])),
43+
:host([design="Transparent"][pressed][active]:not([disabled])),
44+
:host([design="Emphasized"][pressed][active]:not([disabled])) {
45+
background: var(--sapButton_Selected_Hover_Background);
46+
border-color: var(--sapButton_Selected_Hover_BorderColor);
47+
color: var(--sapButton_Selected_TextColor);
48+
}
49+
4150
:host([pressed]:not([active]):not([non-interactive]):not([_is-touch])),
4251
:host([design="Default"][pressed]:not([active]):not([non-interactive]):not([_is-touch])),
4352
:host([design="Transparent"][pressed]:not([active]):not([non-interactive]):not([_is-touch])),
@@ -59,6 +68,12 @@
5968
color: var(--sapButton_Reject_Active_TextColor);
6069
}
6170

71+
:host([design="Negative"][pressed][active]:not([disabled])) {
72+
background: var(--sapButton_Reject_Selected_Hover_Background);
73+
border-color: var(--sapButton_Reject_Selected_Hover_BorderColor);
74+
color: var(--sapButton_Reject_Selected_TextColor);
75+
}
76+
6277
:host([design="Negative"][pressed][active]:hover),
6378
:host([design="Negative"][pressed]:not([active]):not([non-interactive]):not([_is-touch]):hover) {
6479
background: var(--sapButton_Reject_Selected_Hover_Background);
@@ -84,6 +99,12 @@
8499
color: var(--sapButton_Accept_Selected_TextColor);
85100
}
86101

102+
:host([design="Positive"][pressed][active]:not([disabled])) {
103+
background: var(--sapButton_Accept_Selected_Hover_Background);
104+
border-color: var(--sapButton_Accept_Selected_Hover_BorderColor);
105+
color: var(--sapButton_Accept_Selected_TextColor);
106+
}
107+
87108
:host([design="Positive"][pressed][active]:hover),
88109
:host([design="Positive"][pressed]:not([active]):not([non-interactive]):not([_is-touch]):hover) {
89110
background: var(--sapButton_Accept_Selected_Hover_Background);
@@ -109,6 +130,12 @@
109130
color: var(--sapButton_Attention_Active_TextColor);
110131
}
111132

133+
:host([design="Attention"][pressed][active]:not([disabled])) {
134+
background: var(--sapButton_Attention_Selected_Hover_Background);
135+
border-color: var(--sapButton_Attention_Selected_Hover_BorderColor);
136+
color: var(--sapButton_Attention_Selected_TextColor);
137+
}
138+
112139
:host([design="Attention"][pressed][active]:hover),
113140
:host([design="Attention"][pressed]:not([active]):not([non-interactive]):not([_is-touch]):hover) {
114141
background: var(--sapButton_Attention_Selected_Hover_Background);

0 commit comments

Comments
 (0)