-
Notifications
You must be signed in to change notification settings - Fork 101
Refactor loader to loading, match styles to spec #2150
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
Merged
ttaylor-stack
merged 7 commits into
spark-117-loading-component
from
SPARK-117/loading-2
Jan 28, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
06746ec
Refactor loader to loading, match styles to spec
dancormier 1985be4
Fixes since most recent target branch changes
dancormier 8dbcb2f
Fix minor white space issues
dancormier dbe9e74
Reduce diff noise
dancormier 86485c3
Describe size changes in migration guide
dancormier 5cc8041
rename loading to loader
ttaylor-stack 930bac1
update naming
ttaylor-stack 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 hidden or 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
4 changes: 2 additions & 2 deletions
4
packages/stacks-classic/lib/components/loader/loader.a11y.test.ts
This file contains hidden or 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
119 changes: 68 additions & 51 deletions
119
packages/stacks-classic/lib/components/loader/loader.less
This file contains hidden or 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,61 +1,78 @@ | ||
| .s-loader--block { | ||
| // BASE COMPONENT-SPECIFIC CUSTOM PROPERTIES | ||
| --_ld-size: var(--su-static24); | ||
| --_ld-block-size: calc(var(--su-static8) - var(--su-static1)); | ||
| --_ld-gap: calc(var(--su-static2) + var(--su-static1)); | ||
| --_ld-start-offset: var(--su-static2); | ||
| .s-loader { | ||
| --_ld-color: var(--black-600); | ||
| --_ld-gap: calc(var(--_ld-size) / 2); | ||
| --_ld-size: calc(var(--su4) + var(--su1)); // 5px | ||
| --_ld-offset: calc(calc(var(--_ld-size) / 8) * -5); // -5/8ths of the size | ||
|
|
||
| // MODIFIERS | ||
| &&__sm { | ||
| --_ld-size: var(--su-static16); | ||
| --_ld-gap: var(--su-static2); | ||
| --_ld-start-offset: calc(var(--su-static2) + var(--su-static1)); | ||
| &__sm { | ||
| --_ld-size: calc(calc(var(--su8) - var(--su1)) / 2); // 3.5px | ||
| margin-left: var(--su1); | ||
| margin-right: var(--su1); | ||
| } | ||
| &&__lg { | ||
| --_ld-size: var(--su-static48); | ||
| --_ld-block-size: calc(var(--su-static4) + var(--su-static4)); | ||
| --_ld-start-offset: var(--su-static1); | ||
|
|
||
| &__lg { | ||
| --_ld-size: var(--su8); | ||
| } | ||
|
|
||
| // CHILD ELEMENTS | ||
| & &--block, | ||
| &:before, | ||
| &:after { | ||
| background-color: currentColor; | ||
| content: ""; | ||
| display: block; | ||
| height: var(--_ld-size); | ||
| width: var(--_ld-size); | ||
|
|
||
| animation: loader-animation .8s cubic-bezier(1, 1, 0, 1) infinite; | ||
| } | ||
|
|
||
| & &--block { | ||
| animation-delay: .25s; | ||
| } | ||
|
|
||
| &:after { | ||
| animation-delay: .5s; | ||
| } | ||
|
|
||
| align-items: center; | ||
| display: flex; | ||
| height: var(--_ld-size); | ||
| justify-content: center; | ||
| position: relative; | ||
| width: var(--_ld-size); | ||
|
|
||
| // Style the spot loading SVG to match container size | ||
| .svg-spot { | ||
| height: auto; | ||
| max-height: 100%; | ||
| max-width: 100%; | ||
| width: auto; | ||
|
|
||
| rect { | ||
| height: var(--_ld-block-size); | ||
| width: var(--_ld-block-size); | ||
| } | ||
| gap: var(--_ld-gap); | ||
| margin-top: var(--_ld-gap); | ||
| } | ||
|
|
||
| rect:nth-child(2) { | ||
| x: var(--_ld-start-offset); | ||
| } | ||
|
|
||
| rect:nth-child(3) { | ||
| x: calc(var(--_ld-start-offset) + var(--_ld-block-size) + var(--_ld-gap)); | ||
| } | ||
|
|
||
| rect:nth-child(4) { | ||
| x: calc(var(--_ld-start-offset) + var(--_ld-block-size) * 2 + var(--_ld-gap) * 2); | ||
| @media (prefers-reduced-motion:reduce){ | ||
| .s-loader { | ||
| & &--block, | ||
| &:before, | ||
| &:after { | ||
| animation: loader-animation-reduced-motion 2s ease-in-out infinite; | ||
| } | ||
| } | ||
|
|
||
| // Inherit text color when inside a button | ||
| .s-btn & { | ||
| color: var(--_bu-fc); | ||
| .svg-spot { | ||
| rect { | ||
| fill: var(--_bu-fc) !important; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @keyframes loader-animation { | ||
| 0%,1%,99%,to{ | ||
| opacity: 0.2; | ||
| transform: translateY(0); | ||
| } | ||
| 49%,50%{ | ||
| opacity: 1; | ||
| transform: translateY(var(--_ld-offset)); | ||
| } | ||
| 51%{ | ||
| opacity: 0.2; | ||
| transform: translateY(var(--_ld-offset)); | ||
| } | ||
| } | ||
|
|
||
| @keyframes loader-animation-reduced-motion { | ||
| 0%,to{ | ||
| opacity: 0.3; | ||
| transform: none; | ||
| } | ||
| 50%{ | ||
| opacity: 1; | ||
| transform: none; | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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,19 +1,25 @@ | ||
| { | ||
| "loader": [ | ||
| "classes": [ | ||
| { | ||
| "class": ".s-loader--block", | ||
| "class": ".s-loader", | ||
| "applies": "N/A", | ||
| "description": "Base block loading style that displays three animated squares" | ||
| "description": "Base class for the loader component" | ||
| }, | ||
| { | ||
| "class": ".s-loader--block", | ||
| "applies": ".s-loader", | ||
| "description": "Child necessary to render the center loader block" | ||
| }, | ||
| { | ||
| "class": ".s-loader--block__sm", | ||
| "applies": ".s-loader--block", | ||
| "description": "A small style for compact layouts" | ||
| "class": ".s-loader__sm", | ||
| "applies": ".s-loader", | ||
| "description": "A small variant of the loader component" | ||
| }, | ||
| { | ||
| "class": ".s-loader--block__lg", | ||
| "applies": ".s-loader--block", | ||
| "description": "A large style for the largest layouts" | ||
| "class": ".s-loader__lg", | ||
| "applies": ".s-loader", | ||
| "description": "A large variant of the loader component" | ||
| } | ||
| ] | ||
| ], | ||
| "sizes": ["s-loader__sm", "", "s-loader__lg"] | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 spoke to Caro because the Figma called it Loader but the story said Loading, she confirmed it is Loader. I forgot to update the ticket sorry! I've changed it back to loader