Skip to content

Commit 935c420

Browse files
committed
loading-spinner: Set spinner theme to light for certain buttons
Most spinners are either outside the button or inside a button whose background changes accordingly with the color mode. However, there are some buttons whose background color doesn't change with the color mode. For those buttons that don't follow the color mode, we add a light theme for them.
1 parent 08c3588 commit 935c420

File tree

5 files changed

+8
-3
lines changed

5 files changed

+8
-3
lines changed

app/components/follow-button.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{{on "click" (perform this.toggleFollowTask)}}
1212
>
1313
{{#if (or this.followStateTask.isRunning this.toggleFollowTask.isRunning)}}
14-
<LoadingSpinner data-test-spinner />
14+
<LoadingSpinner @theme="light" data-test-spinner />
1515
{{else}}
1616
{{#if this.following}}
1717
Unfollow

app/components/loading-spinner.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<div
2+
class="{{if (eq @theme 'light') 'light'}}"
23
local-class="spinner"
34
...attributes
45
>

app/components/loading-spinner.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
height: var(--spinner-size);
88
width: var(--spinner-size);
99

10+
&:global(.light) {
11+
--spinner-bg-color: rgba(0, 0, 0, .2);
12+
}
13+
1014
&:after {
1115
content: " ";
1216
display: block;

app/templates/index.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
>
5252
Try Again
5353
{{#if this.dataTask.isRunning}}
54-
<LoadingSpinner local-class="spinner" data-test-spinner />
54+
<LoadingSpinner @theme="light" local-class="spinner" data-test-spinner />
5555
{{/if}}
5656
</button>
5757
{{else}}

app/templates/settings/tokens/new.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
Generate Token
183183

184184
{{#if this.saveTokenTask.isRunning}}
185-
<LoadingSpinner local-class="spinner" data-test-spinner />
185+
<LoadingSpinner @theme="light" local-class="spinner" data-test-spinner />
186186
{{/if}}
187187
</button>
188188

0 commit comments

Comments
 (0)