Skip to content

fix: use CSS variable for tooltip z-index instead of hardcoded value#117

Open
rohitrath0d wants to merge 2 commits intoknadh:masterfrom
rohitrath0d:fix/tooltip-zindex-variable
Open

fix: use CSS variable for tooltip z-index instead of hardcoded value#117
rohitrath0d wants to merge 2 commits intoknadh:masterfrom
rohitrath0d:fix/tooltip-zindex-variable

Conversation

@rohitrath0d
Copy link
Contributor

The tooltip pseudo-elements used a hardcoded z-index: 1000 while the theme defines CSS variables for layering (--z-dropdown: 50, --z-modal: 200). This adds --z-tooltip to the theme and uses var(--z-tooltip) in tooltip.css, making the tooltip layer configurable and consistent with the design system.

Fixes #116

@knadh
Copy link
Owner

knadh commented Mar 3, 2026

--z-tooltip is unlikely to be reused anywhere except for the tooltip. Instead of defining a new var, we could just calc(--z-modal + 10), ensuring that tooltip is always higher than modal.

…dcoded value

The tooltip pseudo-elements used a hardcoded z-index: 1000, inconsistent with the theme's CSS variable pattern for layering. Instead of adding a new variable, this uses calc(var(--z-modal) + 10) so the tooltip z-index is always relative to the modal layer.
@rohitrath0d rohitrath0d force-pushed the fix/tooltip-zindex-variable branch from 0c7c4d3 to 616103c Compare March 3, 2026 11:33
@rohitrath0d
Copy link
Contributor Author

hi @knadh , i have made the changes for calc(--z-modal + 10) in tooltip.css and removed the prev --z-tooltip variable, and this is more convenient as you suggested.
Thankyou for this suggestion.

@rohitrath0d rohitrath0d closed this Mar 3, 2026
@rohitrath0d rohitrath0d force-pushed the fix/tooltip-zindex-variable branch from 616103c to 094ec48 Compare March 3, 2026 12:03
@rohitrath0d rohitrath0d reopened this Mar 3, 2026
@rohitrath0d
Copy link
Contributor Author

hi @knadh , sorry the pr got little messy from my end, the last commit 616103c is stable and updated diff, safe for reviewing.

--z-modal: 200;
}
}
} No newline at end of file
Copy link
Owner

Choose a reason for hiding this comment

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

Please retain the line break at the end of the file in both files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, I’ve added the missing newline at the end of both 01-theme.css and tooltip.css and pushed the update.
Could you please review and confirm if everything looks good now?

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.

Tooltip z-index is hardcoded instead of using a CSS variable (--z-tooltip)

2 participants