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

Support nested featherlight (up to 4) #25

Closed
wants to merge 1 commit into from

Conversation

marcandre
Copy link
Collaborator

Easy CSS solution to allow nested dialogs.

@marcandre
Copy link
Collaborator Author

@noelboss This solution is kind of a hack, but it works pretty well. Are you ok with it, or would it be better to do this in JS?

@noelboss
Copy link
Owner

I am not a fan of z-indexes (especial high ones). If the ligthboxes are placed correctly at the bottom (which I think they are not) of the page its generally not necessary to set an index. I would rather not do this this since I want the author to understand the z-index structure of his page and make specific changes if needed. Also, not everyone needs that feature and it can easily be documented in the wiki.

@marcandre
Copy link
Collaborator Author

If the ligthboxes are placed correctly at the bottom (which I think they are not) of the page its generally not necessary to set an index

I don't think that's true.

How about we support 2 levels out of the box, wiki if anyone needs more?

@noelboss
Copy link
Owner

Not true what I said. uses z-index :) sorry

noelboss pushed a commit that referenced this pull request Mar 26, 2014
…screen instead of the top. We could still add a z-index to make it more compatible with pages that have a positioned and z-indexed element as a direkt child from body.
@noelboss
Copy link
Owner

Can you test this with your nested setup?

@marcandre
Copy link
Collaborator Author

Oh, that works, nice. I still have to learn stuff about CSS. In my project I'll still use a z-index to insure that they float above anything else.

To be nicer, only the last .featherlight should have a background. Only CSS way is to use :last-of-type, but that's not supported on IE8- so the black background wouldn't show...

@noelboss Do we have an officially supported browser list?

It would probably be nicer to support IE8-, so a oneliner in jQuery can handle that I guess

@noelboss
Copy link
Owner

@marcandre no list yet. I think it works at least ie8+ (don't have my vm's with me to test right now)
Since the box is now appended, wouldn't a simple :last-child do the trick?

(Edit: Have my IE8 VM... Generally works, but Icons look shitty (close, next, previous – not supported charakters, at least on my machine) and rgba for backgrounds in the gallery doesn't work either.)

@noelboss
Copy link
Owner

BTW, IE8 should work anyways since the background is not transparent there...

@marcandre
Copy link
Collaborator Author

Right, :last-child works (glad you're in charge of the CSS 😄 ). It's still IE9+ though.

What I'm proposing is to remove the background color from the general .featherlight and move it to .featherlight:last-child. So I think IE8 would ignore that rule and not show it, right?

I think there are JS libs to add support for that in IE8, so maybe we could decide they are needed for IE8-?

noelboss pushed a commit that referenced this pull request Mar 26, 2014
@marcandre
Copy link
Collaborator Author

Nice.

@marcandre marcandre closed this Mar 26, 2014
@marcandre marcandre reopened this Mar 27, 2014
@marcandre
Copy link
Collaborator Author

I didn't think of this, but if any JS adds anything in the dom after the dialog has opened, even hidden things, then the background disappears altogether 😦

I have such a case here and can probably work around it, but I was thinking maybe we could bunch all .featherlight inside a .featherlight-layer so last-child would always work?

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.

2 participants