🦄 mantine-border-animate 3.0.13 — the border that lost a specificity fight
Hey everyone 👋
mantine-border-animate 3.0.13 is a patch with a CSS story behind it.
What changed. With trigger="inView" the animated ring was supposed to appear once the component scrolled into view. It never did: it stayed at opacity 0. Now the beam, dash and draw rings show while the component is on screen and pause when it leaves. Along the way, nested borders stopped inheriting each other's state, and pauseOnHover now pauses every variant, the comet included.
The why. I found it while building the home page of my three Next.js docs templates, where the rim of a window uses trigger="inView". The rule that hides an idle border weighed (0,4,0); the rule meant to reveal an active one weighed (0,3,0). The lighter rule loses wherever it sits in the file, so the reveal never won. The templates shipped with a !important workaround while I fixed the component.
The takeaway. When two state rules compete, order in the file is not enough: compare their specificity. The release adds tests that read the stylesheet, compute each selector's specificity and check that every reveal beats the rule it overrides. Against the old stylesheet, all of them fail, which is the point.
No API change. If you used the same --border-animate-active: 1 !important workaround, you can drop it.
I'd love to hear from you:
Do you use trigger="inView" or pauseOnHover, and on what kind of element?
Have you ever been bitten by a specificity fight that tests didn't catch?
Which extension of the family should I look at next?
Drop a comment below 🙏
📦 npm: https://www.npmjs.com/package/@gfazioli/mantine-border-animate
📖 Docs: https://gfazioli.github.io/mantine-border-animate
💻 GitHub: https://github.com/gfazioli/mantine-border-animate


p/jot-2-0
p/interview-coach-3
p/runevr
p/google-cloud-platform
p/producthunt
p/findergit
p/lancetta
p/reso
p/many-displays
p/slotify-2
p/kodlo
p/ai-context-flow
p/airuncode
p/dino-kids
p/jev
p/supabase
p/lasso-11
p/aperture-7
p/raycast
Replies
Be the first to reply
Have a question or a thought to share? Add a comment above to start the conversation.