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

Remove unneeded z-index #21

Closed
wants to merge 2 commits into from
Closed

Remove unneeded z-index #21

wants to merge 2 commits into from

Conversation

caillou
Copy link

@caillou caillou commented Nov 30, 2015

The .split-pane-component, .split-pane-divider-inner and .split-pane-divider have a z-index of 1 or 2. These values can interfere with the CSS of a project in which this plugin is used, in my case a modal with a z-index: 1;.

In my opinion these values are not needed for this plugin to function. It looks like they are there for legacy reasons and are not needed anymore.

@shagstrom would it makes sense to remove them? Or are they needed for a functioning split-pane?

@shagstrom
Copy link
Owner

It's not unneeded. divider-inner overlaps component, so that it's easier to grab the divider.

Can you please show me the code that is not working for you?

z-index only applies to siblings. See https://jsfiddle.net/73o03k42/2/ d2 is on top of d3 even though d3 has higher z-index.

You should not add extra sibling to divider and components.

@shagstrom shagstrom closed this Nov 30, 2015
@caillou
Copy link
Author

caillou commented Nov 30, 2015

@shagstrom The problem is the following: https://jsfiddle.net/73o03k42/3/ The modal has a z-index: 1; but your elements cover it up. And no, z-index does not only apply to siblings.

Also, you don't need z-index to have one element cover the other. The order of the DOM elements is enough, e.g. https://jsbin.com/fijifufuta/edit?html,css,output

@shagstrom
Copy link
Owner

I, see. Well I need z-index in the split-pane when the order is <div class="split-pane-component”>, <div class="split-pane-divider”>, <div class="split-pane-component”>. With the order <div class="split-pane-component”>, <div class="split-pane-component”>, <div class="split-pane-divider”> it might work without z-index, but I don’t want to force people to change the order now, that it has been established.

In your case I guess you’ll have to add z-index: 0 to .split-pane.

On 2015-11-30, at 14:45, Pierre Spring notifications@github.com wrote:

@shagstrom https://github.com/shagstrom The problem is the following: https://jsfiddle.net/73o03k42/3/ https://jsfiddle.net/73o03k42/3/ The modal has a z-index: 1; but your elements cover it up. And no, z-index does not apply only to siblings.

Also, you don't need z-index to have one element cover the other. The order of the DOM elements is enough, e.g. https://jsbin.com/fijifufuta/edit?html,css,output https://jsbin.com/fijifufuta/edit?html,css,output

Reply to this email directly or view it on GitHub #21 (comment).

@caillou
Copy link
Author

caillou commented Nov 30, 2015

That is right, I can give the parent a z-index: 0;. Thanks for your time.

@caillou
Copy link
Author

caillou commented Nov 30, 2015

@shagstrom would you consider adding a z-index: 0; to the .split-pane in order to give it a "sane" default?

@shagstrom
Copy link
Owner

I have added z-index: 0 to .split-pane.

@caillou
Copy link
Author

caillou commented May 26, 2016

👍

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.

None yet

2 participants