When customizing <ion-toggle>
within Ionic, I encounter an issue with toggle selection in CSS. Even though I have successfully customized two <ion-toggle>
elements using CSS, I struggle to give them different customizations separately.
In addition to the default classes assigned to <ion-toggle>
, I would like to style them further using CSS.
// .toggle : global sensitive toggle area
// .handle : circle above the toggle area
// .toggle input : .handle moving area
// .toggle input+.track : .handle moving area when .handle at left
// .toggle input:checked+.track : .handle moving area when .handle at right
Even if I try to assign a specific class to <ion-toggle>
like <ion-toggle class"xxx">
, I am unable to target it individually in CSS using pseudo-class selectors like .toggle.xxx{border:......}
or .xxx{.....}
.
If anyone knows how to differentiate between multiple <ion-toggle>
elements for customization purposes, your help would be greatly appreciated.