polymer icon indicating copy to clipboard operation
polymer copied to clipboard

Shady DOM scoping of selectors

Open tschwartz opened this issue 11 years ago • 0 comments

When you have content that is coming from a CMS (WYSIWYG) and injected into a component, you don't always have the ability to add classes and sometimes need to target those elements in CSS like so:

.elem__copy p:first-child {
    margin-top: 0;
}

Unfortunately Polymer changes that selector to the following and it is never applied to the element:

.elem__copy.component p.component:first-child {
    margin-top:0;
}

tschwartz avatar Nov 13 '15 16:11 tschwartz