Skip to content

Commit 78e477b

Browse files
fix(segment): apply hover properly for segment with color (#18549)
1 parent 832306c commit 78e477b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

core/src/components/segment/segment.ios.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
:host(.ion-color)::slotted(ion-segment-button) {
2929
--border-color: #{current-color(base)};
30-
--background-hover: #{current-color(base, .04)};
3130

3231
background: transparent;
3332
color: #{current-color(base)};
@@ -52,6 +51,12 @@
5251
color: #{current-color(contrast, $segment-ios-opacity-disabled)};
5352
}
5453

54+
@media (any-hover: hover) {
55+
:host(.ion-color)::slotted(ion-segment-button:hover:not(.segment-button-checked)) {
56+
background: #{current-color(base, .1)};
57+
}
58+
}
59+
5560

5661
// Segment: Default Toolbar
5762
// --------------------------------------------------

core/src/components/segment/segment.md.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
// --------------------------------------------------
2424

2525
:host(.ion-color)::slotted(ion-segment-button) {
26-
--background-hover: #{current-color(base, .04)};
2726
--background-activated: #{current-color(base, .16)};
2827
--ripple-color: #{current-color(base)};
2928

@@ -40,6 +39,11 @@
4039
color: #{current-color(base)};
4140
}
4241

42+
@media (any-hover: hover) {
43+
:host(.ion-color)::slotted(ion-segment-button:hover) {
44+
background: #{current-color(base, .04)};
45+
}
46+
}
4347

4448
// Segment: Default Toolbar
4549
// --------------------------------------------------

0 commit comments

Comments
 (0)