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

<span> > <style> wrapping in elm-css 17 has unexpected side effect inside grid container #557

Closed
ymtszw opened this issue Dec 6, 2021 · 3 comments · Fixed by #559
Closed

Comments

@ymtszw
Copy link

ymtszw commented Dec 6, 2021

In elm-css 17.0.1, <style> is wrapped in <span> to guard against some browser extension mess-ups.
The intention is good but it has unexpected side effect inside grid container.

SSCCE: https://ellie-app.com/g3z4zCTShLfa1

This example uses following style on container div:

._5c4fac34 {
    position:fixed;
    top:0px;
    right:0px;
    bottom:0px;
    left:0px;
    width:100%;
    height:100%;
    display:grid;
    align-items:center;
    justify-items:center;
}

This is a convenient "just stay center!" container style, which can horizontally/vertically center its direct child via align/justify-items: center.

We were using this for creating "backdrop" area of modal dialogs and working pretty well.

However with elm-css 17.0.1, such container now hosts an additional child which is <span> containing style node, and that <span> now takes up a portion of the grid container since it is (at a glance from grid container) an ordinary element!

Screenshot from SSCCE:

image

A quick workaround is to put display: none; to wrapping <span>s. At least it works for this particular example, tested from dev console:

image

@ymtszw
Copy link
Author

ymtszw commented Dec 6, 2021

I could send a PR but the proposed workaround might or might not work to solve the situation originally raised in #542

It would be great if you can catch this @bcardiff cc @rtfeldman

@rtfeldman
Copy link
Owner

@ymtszw Thanks for reporting this, and for finding a workaround!

Here are some next steps that make sense to me:

If so, sounds like we have a straightforward fix for this!

@ymtszw
Copy link
Author

ymtszw commented Dec 6, 2021 via email

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 a pull request may close this issue.

2 participants