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:not(:root) specificity is very high #718

Closed
Jessidhia opened this issue Dec 19, 2017 · 1 comment
Closed

svg:not(:root) specificity is very high #718

Jessidhia opened this issue Dec 19, 2017 · 1 comment

Comments

@Jessidhia
Copy link

Jessidhia commented Dec 19, 2017

When a document uses normalize.css and inline svg, it's not possible to set an svg element's overflow via CSS through a simple class selector. The overflow value is always overridden by the svg:not(:root) override, unless !important or other means of artificially raising the specificity of the selector are used.

Maybe this override could be accomplished by doing, instead:

svg {
  overflow: hidden;
}

svg:root {
  overflow: visible;
}

This would still require that the user artificially increases the specificity of a selector if they really do mean to override the overflow of an svg root in css, but I suspect that is a much more unlikely use case.

@garrettw
Copy link

Seems like a smart suggestion. I'll implement it in Vitals.

@necolas necolas closed this as completed in 004d58b Feb 8, 2018
ysds added a commit to ysds/bootstrap that referenced this issue Jul 20, 2018
* `svg:not(:root)` specificity is very high (necolas/normalize.css#718)
* Bootstrap do not support SVG documents (See twbs#26878)
mdo pushed a commit to twbs/bootstrap that referenced this issue Jul 20, 2018
* `svg:not(:root)` specificity is very high (necolas/normalize.css#718)
* Bootstrap do not support SVG documents (See #26878)
rolyp added a commit to wrattler/wrattler that referenced this issue Jan 30, 2020
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