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

svg display attribute ignored #86

Open
ristew opened this issue Dec 21, 2021 · 2 comments
Open

svg display attribute ignored #86

ristew opened this issue Dec 21, 2021 · 2 comments

Comments

@ristew
Copy link

ristew commented Dec 21, 2021

Minimum example:

<svg display="none" width="100" height="100">
  <circle cx="50" cy="50" r="50" />
</svg>

workaround:

svg[display="none"] {
  display: none;
}
@nucliweb
Copy link

Why not use the global attribute hidden?

SVG

<svg hidden width="100" height="100">
  <circle cx="50" cy="50" r="50" />
</svg>

CSS

svg[hidden] {
  display: none;
}

@ristew
Copy link
Author

ristew commented Dec 22, 2021

I made an issue with the library it's coming from: google/blockly#5840. Even display: initial or display: unset triggered the behavior, so I feel it's best to avoid use of the SVG display attribute altogether as it can easily be the victim of undefined behavior.

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

No branches or pull requests

2 participants