question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: circular, lines-sharp, and lines-sharp-small not getting --spinner-color applied in ion-loading

See original GitHub issue

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

Specifying the --spinner-color has no effect on a ‘circular’ spinner. All other spinner shapes work as expected.

Expected Behavior

Spinner color should respect defined custom color

Steps to Reproduce

In an Angular 13 project add a spinner.

I am running Angular 13.3 but if the issue is due to the naming I mentioned in additional Info below then I expect this issue is not framework specific

const loader = await this.loadingController.create({
          spinner: 'circular',
          cssClass: 'my-spinner'
        });

// CSS
.my-spinner {
  --spinner-color: red;
}

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 6.18.2

Utility:

cordova-res : not installed globally native-run : not installed globally

System:

NodeJS : v16.14.0 npm : 8.3.1 OS : macOS Monterey

Additional Information

Should this line not be named ‘circular’ instead of ‘circle’?

https://github.com/ionic-team/ionic-framework/blob/a6a772a38d15419ad4a60b6afeb66d91f6736934/core/src/components/spinner/spinner.scss#L122

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
liamdebeasicommented, Apr 26, 2022

There are a couple of issues here:

  1. Your --spinner-color variable targets ion-spinner. --spinner-color is a CSS Variable on ion-loading, not ion-spinner. Your selector should be ion-loading instead.

  2. The circular style never gets color set when used inside of ion-loading. See https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/loading/loading.scss#L70-L77.

The circular style was added in https://github.com/ionic-team/ionic-framework/commit/e33cf854a97f2c249a812bdcd55e473fe767eed6, but the author never updated ion-loading to take advantage of this.

It also looks like the lines-sharp and lines-sharp-small spinners are affected by this. We should probably just change the selector to ion-spinner instead of selecting every single variant of the spinner.


Ionic Team note: Whoever works on this should migrate the spinner and loading screenshot tests first.

0reactions
ionitron-bot[bot]commented, Jun 11, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Loading | Application Loading Indicator Overlay | ion-loading
The ion-loading overlay indicates activity while blocking user interaction. The loading indicator appears on top of the app's content, and can be dismissed....
Read more >
ionic-framework - bytemeta
feat: allow IonTabs to be used without a router outlet ... bug: circular, lines-sharp, and lines-sharp-small not getting --spinner-color applied in ion- ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found