-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ion-spinner style #7087
Comments
Additional notes:The problem with the desired solution seems similar to the following issues #6275 (main), #6279 (dupe) and #6277 (dupe), so the same fix might apply here (and maybe on other ion components as well?). Edit: Looking at the source-code of ion-spinner it pretty much looks like the same problem/fix applies... |
Hello, thanks for opening an issue with us! Would you be able to provide a plunker that demonstrates this issue? Thanks for using Ionic! |
Added plunkr: Important code is in home.html (ion-spinner with class attribute) and the generated output (ion-spinner without custom class attribute, replaced by ionics spinner-*** class. PS: You can remove PPS: Also happens with ionic2 beta 10 |
I've gone through the source-code and ion-spinner seems like the only component left with this issue (after ion-slide was fixed), which seems to be caused by having a 132d8e9 fixed this for ion-slides by using |
@brandyscarney I agree with @Hufschmidt , last time I tried to give a spinner my own style, it was complicated. Not sure about a solution though :) |
Thanks for the issue! This will be fixed in the |
I would suggest you to update the online documentation at https://ionicframework.com/docs/api/components/spinner/Spinner/, because as per today it still reports that to change the spin color the |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Issue
According to the ion-spinner api-doc you should be able to change the spinner color by changing stroke style via
But this does not work, since stroke (and fill) is defined on classes of the form spinner-* (eg
.spinner-ios
,.spinner-dots
, etc.) which take precedence over the above type selector.Sidenote: The main use-case touched by this issue is changing the style/color of a single ion-spinner, not globally. Although spinners currently seem to use fixed color values in scss instead of variables, which would be another nice addition...
Tested with ionic2 beta9
Working solutions:
Using !important, which should be avoided as much as possible
Overwriting all spinner- classes, which requires to have internal knowledge about ionic-angular
Desired solution:
Overwrite by attaching custom class to ion-spinner.
This does currently not seem to work, because
<ion-spinner class="my-custom-blue"></ion-spinner>
for example gets transformed into<ion-spinner _ngcontent-ykj-1="" class="spinner-crescent"></ion-spinner>
, so any custom class gets dropped...This seems like a severe bug to me. O_O
The text was updated successfully, but these errors were encountered: