fix(toggle): set switch icon color correctly (#28812)
Issue number: None --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> Similar to #28809, in my work for FW-5822, I found that I had unexpected screenshot diffs. `--ion-color-dark` was not defined in our test infrastructure, and this toggle icon was therefore displaying in the wrong color in the tests. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Toggle has the correct icon color even when the --ion-color-dark token is not defined ## Does this introduce a breaking change? - [ ] Yes - [x] No Introduces style changes if the token is undefined, but it should always be defined in real-world uses. <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> --------- Co-authored-by: ionitron <hi@ionicframework.com>
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
@ -87,7 +87,7 @@
|
|||||||
.toggle-switch-icon {
|
.toggle-switch-icon {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
||||||
color: var(--ion-color-dark);
|
color: #{ion-color(dark, base)};
|
||||||
}
|
}
|
||||||
|
|
||||||
:host(.toggle-ltr) .toggle-switch-icon {
|
:host(.toggle-ltr) .toggle-switch-icon {
|
||||||
|