Skip to content
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

fix(health-index): add CSS custom prop to adjust z-index #1995

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/eighty-windows-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rhds/elements": patch
Copy link
Member

@bennypowers bennypowers Oct 27, 2024

Choose a reason for hiding this comment

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

this is a minor change

Can we fix this without exposing a new css property? in normal use, what would be the user story which would require them to be able to customize this z-index value?

Maybe we can solve this with position: relative on the host element?

Copy link
Member

Choose a reason for hiding this comment

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

  1. this is only a problem in chrome

image

  1. I think we can fix this with position: relative; z-index: 1 on the container element, without requiring a minor release

image

---

Added --rh-health-index-z-index custom prop to allow implementers to patch z-index conflicts
7 changes: 4 additions & 3 deletions elements/rh-health-index/rh-health-index.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
line-height: var(--_box-size);
text-transform: uppercase;

/* sizing */
/* size & positioning */
--_box-size: var(--rh-space-xl, 24px);
--_z-index: var(--rh-health-index-z-index, 10);

/* colors */
--_color-text-active: var(--rh-color-gray-95, #151515);
Expand Down Expand Up @@ -52,7 +53,7 @@

.box.active {
color: var(--_color-text-active);
z-index: 10;
z-index: var(--_z-index);
}

:is(.sm,.md) .box.active {
Expand Down Expand Up @@ -120,7 +121,7 @@
display: block;
content: '';
min-height: var(--rh-length-xs, 4px);
z-index: 10;
z-index: var(--_z-index);
background-color: var(--_color-20);
}

Expand Down
Loading