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

[0.9] Custom attributes on elements not working (original: iron-icon styling troubles) #1604

Closed
firasdib opened this issue May 24, 2015 · 2 comments

Comments

@firasdib
Copy link

Hello,

I have a template using dom-repeat that produces a bunch of entries depending on values that change from time to time. The generated content contains icons which I color using css, depending on which icon it is. This works fine in Polymer 0.5 using aria-label or even adding a separate class to the element. In 0.9 this is no longer possible.

The code for the icon would be something like <iron-icon icon="[[_getIcon(resource)]]"></iron-icon> which works fine for the actual icon. The css on the other hand would look something like:
iron-icon[icon=menu] { color: red; } which does not work, and all my other attempts have not worked, such as adding a class to the element using _getIcon or the parent etc.

Any ideas how this can be solved? It has to be dynamic.

Thanks in advance.

@firasdib
Copy link
Author

In fact, I believe this issue should be expanded to attributes in general. I am unable to set an attribute on a regular div that looks like this <div data-id="[[foo]]"> but the following works: <div id="[[foo]]">. A very weird limitation imo.

@firasdib firasdib changed the title iron-icon styling troubles Custom attributes on elements not working (original: iron-icon styling troubles) May 25, 2015
@firasdib firasdib changed the title Custom attributes on elements not working (original: iron-icon styling troubles) [0.9] Custom attributes on elements not working (original: iron-icon styling troubles) May 25, 2015
@firasdib
Copy link
Author

My bad, I did not read the documentation well enough, Apparently you're supposed to use the new syntax: data-foo$="...".

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