Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Comments

Reflect icon property to attribute#69

Open
mgiuffrida wants to merge 1 commit intoPolymerElements:masterfrom
mgiuffrida:patch-1
Open

Reflect icon property to attribute#69
mgiuffrida wants to merge 1 commit intoPolymerElements:masterfrom
mgiuffrida:patch-1

Conversation

@mgiuffrida
Copy link

It's nice to style iron-icons based on which icon they show:

iron-icon[icon='done'] {
  --iron-icon-fill-color: var(--google-green-500);
}

However, if the icon property is changed dynamically, the new style rules won't apply (even after updateStyles) because the attribute hasn't changed.

@mgiuffrida
Copy link
Author

/cc @azakus @kevinpschaaf

Would this have performance implications? iron-icon tends to be a high-frequency element, but the icon rarely changes, so it would mostly be an issue at startup.

It's nice to style `iron-icon`s based on which icon they show:

```
iron-icon[icon='done'] {
  --iron-icon-fill-color: var(--google-green-500);
}
```

However, if the `icon` property is changed dynamically, the new style rules won't apply (even after `updateStyles`) because the attribute hasn't changed.
@mgiuffrida
Copy link
Author

rebased

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants