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

Hovering z-index of a component sharing the border #25251

Closed
ysds opened this issue Jan 10, 2018 · 2 comments
Closed

Hovering z-index of a component sharing the border #25251

ysds opened this issue Jan 10, 2018 · 2 comments
Labels

Comments

@ysds
Copy link
Member

ysds commented Jan 10, 2018

I have been wondering about the necessity of z-index when hovering for the past few months. I think that the reason why z-index is given is related to display of a border between elements, but I do not understand exactly why it is necessary.

Related components (sharing the border)

Currently, the following components have z-index: 1 when hoverring:

But the following components don't have:

My points:

1. List group item issue

When hovering a list item, the border flickers slightly. It may be correct when items are links or buttons. But it is strange if it is a static list. You can see in the Contextual classes docs

2. Necessity (Clarify the design specifications)

If I may ask, could you clarify the reasons to bring it to the front when hovering? This will also be related to #25165.

Component states should obey a common z-index scale: default (initial), hover (1), active (2), focus (3)

3. Consistency

If the hovering z-index is the correct specification, please consider adding it to pagination and input group as well.

Thanks.

@mdo
Copy link
Member

mdo commented Jan 10, 2018

I've used overlapping borders to prevent us from having to outright remove a border. This creates a more seamless component and (I think?) reduces repaints as you modify the sub-components. By default, sibling elements that follow a particular element will be "above" those on the z-index scale (e.g., the 2nd is above the 1st, and the 3rd is above the second). So, we need to modify those on hover to allow say a darker border or background to come to the forefront. It's largely a visual design necessity, and I agree it needs uniform application.

@mdo
Copy link
Member

mdo commented Apr 1, 2018

Pagination has the z-index on hover, and input group has it in general for buttons and add-ons from the looks of it. Let me know if there are any specific lines that need updating that I missed, though!

@mdo mdo closed this as completed Apr 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants