Skip to content

Commit fac5ac1

Browse files
committed
loading-spinner: Set spinner color to dark 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 would like their spinner color to be dark.
1 parent 83c9844 commit fac5ac1

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
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 class="dark" local-class="spinner" data-test-spinner />
1515
{{else}}
1616
{{#if this.following}}
1717
Unfollow

app/components/loading-spinner.module.css

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
.spinner {
2-
--spinner-color: light-dark(black, white);
3-
--spinner-bg-color: light-dark(rgba(0, 0, 0, .2), rgba(255, 255, 255, .2));
2+
--spinner-color: black;
3+
--spinner-bg-color: rgba(0, 0, 0, .2);
44
--spinner-size: 16px;
55

6+
&:not(:global(.dark)) {
7+
--spinner-color: light-dark(black, white);
8+
--spinner-bg-color: light-dark(rgba(0, 0, 0, .2), rgba(255, 255, 255, .2));
9+
}
10+
611
display: inline-block;
712
height: var(--spinner-size);
813
width: var(--spinner-size);

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 class="dark" 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 class="dark" local-class="spinner" data-test-spinner />
186186
{{/if}}
187187
</button>
188188

0 commit comments

Comments
 (0)