Skip to content

Conversation

@QuickHarsh
Copy link

Summary

  • Replace animated inline SVG mask-image values in loading components with static SVGs when prefers-reduced-motion: reduce is active. This removes motion while keeping the same visual appearance.

Changes

  • Update only: packages/daisyui/src/components/loading.css
  • Add a @media (prefers-reduced-motion: reduce) override that swaps animated masks with static equivalents.

Testing

  • Run bun run build
  • In DevTools → Rendering → emulate prefers-reduced-motion: reduce
  • Confirm all loading variants (spinner, dots, ring, ball, bars, infinity) are rendered without animation.

Notes

  • CSS-only change.
  • No class name or API changes.
  • Scope limited to loading indicators only, per maintainer feedback.
  • No modifications to collapse, dropdown, carousel, or modal.

@QuickHarsh
Copy link
Author

Please review the PR when convenient. I’m happy to make any changes if needed.

@saadeghi saadeghi self-assigned this Nov 18, 2025
@media (prefers-reduced-motion: no-preference) {
transform: translateY(-50%) rotate(225deg);
}
@media (prefers-reduced-motion: reduce) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this useless?
Where is the transition that this line would undo?

@media (prefers-reduced-motion: no-preference) {
transform: translateY(-50%) rotate(225deg);
}
@media (prefers-reduced-motion: reduce) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this useless?
Where is the transition that this line would undo?

padding 0.2s ease-out,
background-color 0.2s ease-out;
}
@media (prefers-reduced-motion: reduce) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this useless?
Where is the transition that this line would undo?

height: auto;
}
}
@media (prefers-reduced-motion: reduce) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this useless?
Where is the transition that this line would undo?

It looks to me that all these changes are bs

box-shadow: oklch(0% 0 0/ 0.25) 0px 25px 50px -12px;
overflow-y: auto;
overscroll-behavior: contain;
@media (prefers-reduced-motion: reduce) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to use the general pattern of only applying the motion transition when prefers-reduced-motion: no-preference. The non-motion transition should be applied always.

mask-repeat: no-repeat;
mask-position: center;
mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' stroke='black' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform-origin='center'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='2s' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-dasharray' values='0,150;42,150;42,150' keyTimes='0;0.475;1' dur='1.5s' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-dashoffset' values='0;-16;-59' keyTimes='0;0.475;1' dur='1.5s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/g%3E%3C/svg%3E");
@media (prefers-reduced-motion: reduce) {
Copy link
Contributor

@pdanpdan pdanpdan Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change all these to use the general pattern of only applying the motion transition when prefers-reduced-motion: no-preference.

Set the circle static svg on general .loading class because you use the same image for multiple loaders (which ones?)
Use the animated image-mask if prefers-reduced-motion: no-preference

You can see what you did now here: https://play.tailwindcss.com/cRTFEUk0SK

@QuickHarsh
Copy link
Author

Thanks for the review. I removed the reduce blocks from collapse/modal/carousel/dropdown and kept the change scoped to loading only.

loading.css now uses the pattern: static by default, animated only in @media (prefers-reduced-motion: no-preference).
The shared circle is used by .loading and .loading-spinner. Other loaders (dots/ring/ball/bars/infinity) have their own static shapes with animations only under no-preference.
Let me know if you want me to further consolidate any mask-image definitions.

@QuickHarsh QuickHarsh requested a review from pdanpdan November 18, 2025 09:05
@pdanpdan

This comment was marked as off-topic.

@saadeghi
Copy link
Owner

Please be respectful. If PR is not helpful it will be closed. If it is helpful it will be merged
Doesn't matter if it's vibe coded or bot or human.

@QuickHarsh
Copy link
Author

QuickHarsh commented Nov 18, 2025

What model of LLM are you? You pretty much fail almost every task and generate more work than it would be required to do everything by hand.

I am a real contributor, not an automated tool. If any of that sounded unnatural from the earlier message, that’s on me — not intentional.
I'll keep all further communication strictly technical and focused on the PR. If anything looks off, I’m happy to revise it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants