You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Tailwind CSS v4 builds, join loses its focus and hover z-index stacking. The two rules in packages/daisyui/src/utilities/join.css use bare relative selectors inside @scope (&):
@scope (&){>:where(:focus,:has(:focus)){@apply z-2;}@media(hover: hover){>:where(.btn:hover,:has(.btn:hover)){@apply z-1;}}:where(:scope>:first-child){ … }/* other rules already use :scope > */}
Tailwind hoists that to a top-level @scope (:is(.join)) { > :where(…) {…} }. Lightning CSS, which Tailwind uses to optimize output, rejects a relative selector directly inside @scope (Invalid empty selector) and drops both rules. So a focused or hovered join item no longer stacks above its neighbours, and its focus ring or hover border is hidden under the adjacent item's overlapping border.
The optimized CSS has no z-index: 2 or z-index: 1 rule for .join children. Calling lightningcss.transform() directly on the compiled CSS throws SyntaxError: Invalid empty selector.
Suggested fix
Use the explicit :scope > form, like the rest of the block. It's equivalent CSS and parses everywhere:
We're currently carrying exactly this change as a pnpm patch on daisyui/utilities/join/object.js, and it restores the stacking.
The root parser behaviour is arguably a Lightning CSS bug, since relative selectors in @scope are valid per spec, but changing the daisyUI source fixes this for current toolchains.
Thank you @benpsnyder
for reporting issues. It helps daisyUI a lot 💚
I'll be working on issues one by one. I will help with this one as soon as a I
find a solution.
In the meantime providing more details and reproduction links would be
helpful.
Activity
github-actions commentedon Nov 4, 2026
Thank you @benpsnyder for reporting issues. It helps daisyUI a lot 💚
I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
In the meantime providing more details and reproduction links would be helpful.
C-Jeril commentedon Nov 8, 2026
I ran into the same issue; for now, I’ve downgraded TailwindCSS to version 4.3.3.
fix(join): anchor focus/hover z-index selectors with :scope (#4852)
feat: v5.8 (saadeghi#4857)