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

Custom style variables for elements added outside of polymer #1781

Closed
alex88 opened this issue Jun 8, 2015 · 1 comment
Closed

Custom style variables for elements added outside of polymer #1781

alex88 opened this issue Jun 8, 2015 · 1 comment

Comments

@alex88
Copy link

alex88 commented Jun 8, 2015

I'm creating an element that wraps an external javascript that creates a graph inside the element.

My problem is trying to apply css using element's css variables to dom manipulated by the external javascript (not written for polymer).

For example:

.td-over {
  background: var(--custom-element-key-color) !important;
}

this creates the following style:

.custom-element-0 .td-over.custom-element {
  background:#fe4365 !important;
}

the problem is that the dom created by the external component doesn't have a .custom-element class so it's not applied.

Is there a way to disable that behaviour? Is it done for not propagating changes to further children?

An example plunkr: http://plnkr.co/edit/v5YSFpDguFhNd6tsGenf

@alex88
Copy link
Author

alex88 commented Jun 8, 2015

Just found the solution, just prepend the css selector with ::content so it doesn't restrict itself within the current element only

@alex88 alex88 closed this as completed Jun 8, 2015
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

1 participant