Repository navigation
Stop the spinner and skeleton loops when motion is reduced - #64
Open
ryoaonetsuki wants to merge 1 commit into
Open
ryoaonetsuki wants to merge 1 commit into
ryoaonetsuki wants to merge 1 commit into
Conversation
Signed-off-by: ryoaonetsuki <ryoaonetsuki@users.noreply.github.com>
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
The stylesheet already stops its own motion under
prefers-reduced-motion: reduce(the dot flash, the status shimmer, the progress sweep, the float/fade-ins), and
#58 stopped the tag's spinner the same way. But the stock components' loops were
missed: the spinner (
animate-spin) and the skeleton (animate-pulse) keeplooping for readers who asked for less motion.
What changes
One rule in the reduced-motion block in
src/solid-glass.cssstopsanimate-spinandanimate-pulse. It is in the stylesheet on purpose: these arestock components, and per CONTRIBUTING a fix for a stock component belongs in
src/solid-glass.css, not insrc/components/ui/. The caret blink is leftalone deliberately: it marks where text goes, it does not decorate.
How it was checked
npm run typecheckandnpm run buildpass;registry.jsonis unchanged.skeleton on
/dev/examples?q=spinner,skeleton: without reduced motion theyanimate (
spin/pulse); withprefers-reduced-motion: reduceemulated bothreport
none; back to no-preference they animate again./dev/examplesreports
0 failedfor those examples.spin/pulseunder reduced motion, so the rule is what stops them.Tailwind's own
.animate-spinutility, so it wins at equal specificity.Limitation, stated honestly: this was checked by computed style, not by looking
at the components in both themes with my own eyes.