Skip to content

ion-spinner style #7087

@Hufschmidt

Description

@Hufschmidt

Issue

According to the ion-spinner api-doc you should be able to change the spinner color by changing stroke style via

ion-spinner svg {
  stroke: #444;
  fill: #222;
}

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

ion-spinner svg * {
  stroke: #00f !important;
}

Overwriting all spinner- classes, which requires to have internal knowledge about ionic-angular

.spinner-ios line,
[...]
.spinner-crescent circle {
  stroke: #00f;
}

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions