css-modal icon indicating copy to clipboard operation
css-modal copied to clipboard

Option / plugin to place modal vertically centered

Open drublic opened this issue 10 years ago • 2 comments

This is a suggestion from issue #164.

drublic avatar Nov 02 '14 22:11 drublic

I'd also like to see this

jgadbois avatar Mar 26 '15 13:03 jgadbois

With transforms2D this can easily be achieved. We make the top and left 50% and then bring it back with transform: translate(-50%, -50%). We don't even care what the width or height of the modal is, it will be perfectly centered.

The issue it raises is the placement of the close button, but that could be solved by having the close button separate from modal background, they could both be links with the same behaviour. The close button would inside the header or wherever users want to place it.

jolidog avatar Jul 08 '16 16:07 jolidog