Skip to content

Commit 5a867df

Browse files
authored
fix(switch): style component using sass theme (#16491)
* fix(switch): style component using sass theme * fix(switch): indigo border-radius * fix(switch): hover shadow
1 parent 1a51cd0 commit 5a867df

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

projects/igniteui-angular/src/lib/switch/themes/_base.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ $_theme: $material;
8484
}
8585

8686
@include e(thumb) {
87-
background: var-get($_theme, 'border-hover-color');
87+
background: var-get($_theme, 'thumb-off-hover-color');
8888
}
8989

9090
@include e(label) {

projects/igniteui-angular/src/lib/switch/themes/shared/bootstrap.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ $_theme: $bootstrap;
4949
@include e(thumb) {
5050
background: var-get($_theme, 'thumb-on-color');
5151
}
52+
53+
&:hover {
54+
@include e(composite) {
55+
border-color: var-get($_theme, 'border-on-hover-color');
56+
}
57+
}
5258
}
5359

5460
@include mx(disabled, checked) {

projects/igniteui-angular/src/lib/switch/themes/shared/indigo.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ $_theme: $indigo;
2626

2727
@include m(focused) {
2828
@include e(composite) {
29-
border-radius: var-get($_theme, 'border-radius-thumb');
3029
box-shadow: 0 0 0 rem(3px) var-get($_theme, 'focus-outline-color');
3130
}
3231
}

projects/igniteui-angular/src/lib/switch/themes/shared/material.scss

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $_theme: $material;
1212
--switch-height: #{rem(14px)};
1313
--switch-thumb-size: #{rem(20px)};
1414
--switch-on-offset: #{rem(1px)};
15-
--switch-off-offset: 0;
15+
--switch-off-offset: #{rem(-1px)};
1616
--label-margin: #{rem(12px)};
1717

1818
@include e(label) {
@@ -21,22 +21,15 @@ $_theme: $material;
2121
}
2222
}
2323

24-
@include e(composite) {
25-
border-width: 0;
26-
}
27-
2824
@include e(ripple) {
2925
display: block;
3026
}
3127

3228
@include e(thumb) {
3329
box-shadow: var-get($_theme, 'resting-elevation');
34-
}
3530

36-
&:hover {
37-
@include e(thumb) {
38-
background: var-get($_theme, 'thumb-off-color');
39-
box-shadow: var-get($_theme, 'resting-elevation');
31+
&:hover {
32+
box-shadow: var-get($_theme, 'hover-elevation');
4033
}
4134
}
4235

0 commit comments

Comments
 (0)