Skip to content

Instantly share code, notes, and snippets.

@tomalec
Created April 6, 2017 22:59
Show Gist options
  • Save tomalec/a69081ee79ca492f001c71e4bbe98fdf to your computer and use it in GitHub Desktop.
Save tomalec/a69081ee79ca492f001c71e4bbe98fdf to your computer and use it in GitHub Desktop.
Shadow DOM & CSS glitches in V0 and V1

V0 webcomponents.js polyfill

::content selector is not polyfilled and breaks entire coma-separated list

When you load stylesheet with Shadow DOM selectors dynamically, ::content selector is not polyfilled. It get even worse as it breaks entire definition so for

.foo.bar,
.baz > ::content > .blah{
    color: green;
}

color: green will not get applied even for .foo.bar.

Thant's why you have to duplicate entire rule and polyfill ::content by yourself:

.foo.bar,
.baz > ::content > .blah{
    color: green;
}
.foo.bar,
.baz > .blah{
    color: green;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment