-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix: prevent CSS variable bleeding in nested tabs #4348
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,9 +1,12 @@ | ||||||||||||||
| .tabs { | ||||||||||||||
| @layer daisyui.l1.l2.l3 { | ||||||||||||||
| @apply flex flex-wrap; | ||||||||||||||
| /* Reset inheritable properties to prevent bleeding from parent .tabs */ | ||||||||||||||
| --tabs-height: auto; | ||||||||||||||
| --tabs-direction: row; | ||||||||||||||
| --tab-height: calc(var(--size-field, 0.25rem) * 10); | ||||||||||||||
| --tab-p: 0.75rem; | ||||||||||||||
| --tab-radius-min: calc(0.75rem - var(--border)); | ||||||||||||||
| height: var(--tabs-height); | ||||||||||||||
| flex-direction: var(--tabs-direction); | ||||||||||||||
| } | ||||||||||||||
|
|
@@ -23,10 +26,8 @@ | |||||||||||||
| --tab-radius-min: calc(0.75rem - var(--border)); | ||||||||||||||
| --tab-radius-limit: min(var(--radius-field), var(--tab-radius-min)); | ||||||||||||||
| --tab-radius-grad: | ||||||||||||||
| #0000 calc(69% - var(--border)), | ||||||||||||||
| var(--tab-border-color) calc(69% - var(--border) + 0.25px), | ||||||||||||||
| var(--tab-border-color) 69%, | ||||||||||||||
| var(--tab-bg) calc(69% + 0.25px); | ||||||||||||||
| #0000 calc(69% - var(--border)), var(--tab-border-color) calc(69% - var(--border) + 0.25px), | ||||||||||||||
| var(--tab-border-color) 69%, var(--tab-bg) calc(69% + 0.25px); | ||||||||||||||
|
Comment on lines
+29
to
+30
|
||||||||||||||
| #0000 calc(69% - var(--border)), var(--tab-border-color) calc(69% - var(--border) + 0.25px), | |
| var(--tab-border-color) 69%, var(--tab-bg) calc(69% + 0.25px); | |
| #0000 calc(69% - var(--border)), | |
| var(--tab-border-color) calc(69% - var(--border) + 0.25px), | |
| var(--tab-border-color) 69%, | |
| var(--tab-bg) calc(69% + 0.25px); |
Copilot
AI
Dec 15, 2025
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.
Similar to lines 29-30, this formatting change appears to be unrelated to the nested tabs fix. Consider keeping formatting changes separate from bug fixes for better code review and git history tracking.
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.
These CSS variable declarations duplicate the same values already defined in the
.tabclass (lines 18 and 26). While resetting these variables in.tabsis necessary to prevent inheritance from parent.tabselements, consider whether these specific variables need to be reset here given that:.tabs-xs,.tabs-lg, etc.) set--tab-pand--tab-radius-minon the.tabelement using the child selector& > .tab, not on.tabsitself--tab-heightis actually set directly on.tabsby the size modifiersIf the goal is to prevent nested
.tabelements from inheriting from parent.tabelements, these resets in.tabsmay not achieve that since CSS variables inherit through the DOM tree regardless of selector specificity. The.tabclass already defines these variables, so nested.tabelements would use those values, not values from a parent.tabs.