-
Notifications
You must be signed in to change notification settings - Fork 32
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
fix!: CSS based loading spinner #1532
Merged
bmingles
merged 20 commits into
deephaven:main
from
bmingles:1531-loading-spinner-stutter
Sep 28, 2023
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
e082aef
CSS based loading spinner
bmingles 0c8ac73
Semantic spinner colors
bmingles b6189d1
Fixed invalid css variable
bmingles 299b38f
Disabled stylelint rule
bmingles 814d658
syncAnimationStartTime tests
bmingles 7596430
Adjusted loading overlay styles
bmingles 611d28d
Added style comment
bmingles e37aacf
Fixed failing unit tests
bmingles 536fca7
Small spinner vertical align
bmingles 9e81d0c
Gap between loading spinner
bmingles ee0a93c
Fixed spinner alignment
bmingles a9c0f51
Default animation startTime + comments
bmingles 79461e4
Renamed CSS class
bmingles 9e1a8d6
Vertical align inline spinners
bmingles 7ff5220
Vertical align spinners
bmingles 017911f
Moved loading spinner CSS class
bmingles 4cf22b0
Updated snapshots
bmingles 7d42374
Ran prettier on scss files
bmingles fdd34ee
Added aria + role attribute. Fixed tests
bmingles 77480a8
Fixed spinner tests
bmingles File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,56 @@ | ||
/* stylelint-disable alpha-value-notation */ | ||
.loading-spinner { | ||
--primary-color: var( | ||
--dh-loading-spinner-primary-color, | ||
var(--dh-accent-color, #4c7dee) | ||
); | ||
--secondary-color: var( | ||
--dh-loading-spinner-secondary-color, | ||
rgba(240, 240, 240, 0.5) | ||
); | ||
--border-width: 1px; | ||
--size: 14px; | ||
|
||
box-sizing: border-box; | ||
display: inline-block; | ||
margin: 0 auto; | ||
width: var(--size); | ||
height: var(--size); | ||
} | ||
|
||
.loading-spinner-large { | ||
font-size: 64px; | ||
.svg-inline--fa { | ||
font-size: inherit; | ||
--border-width: 4px; | ||
--size: 56px; | ||
} | ||
|
||
.loading-spinner-vertical-align { | ||
// The original LoadingSpinner used `.fa-layers` to create the spinner icon. | ||
// This includes a vertical aligment adjustment to center the spinner along | ||
// side of other inline content. Copying this value from the `.fa-layers` | ||
// class to avoid breaking alignment of the new spinner. | ||
vertical-align: -0.125em; | ||
} | ||
|
||
// Spinning circle with colored border and transparent center. Half of the | ||
// circle is the primary color. The other half is the secondary color. | ||
.loading-spinner::after { | ||
animation: loading-spinner-rotate 2s linear infinite; | ||
border: var(--border-width) solid; | ||
border-color: var(--primary-color) var(--primary-color) var(--secondary-color) | ||
var(--secondary-color); | ||
border-radius: 50%; | ||
box-sizing: border-box; | ||
content: ''; | ||
display: inline-block; | ||
width: var(--size); | ||
height: var(--size); | ||
} | ||
|
||
@keyframes loading-spinner-rotate { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(359deg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I set height + line height explicitly to avoid a layout shift after font load. The previous height was 96px based on 1.5 line-height from body. Converting to flexbox with a gap of 20px seems to match the layout as before but without the layout shift