How to change the color of an polymer_element icon using Dart and polymer 1.0.0-rc1


I have the following files:


<dom-module id = "required-icon">
    <style is="custom-style">
      .big {
        --iron-icon-height: 12px;
        --iron-icon-width: 12px;
        margin-right :3px;
        class = "big"
        id = "z"
        icon = "star"></iron-icon>
        for = "z"
        position = "right"
        animation-delay = "0">


@PolymerRegister( "required-icon" )
class RequiredIcon extends PolymerElement {
  RequiredIcon.created( ) : super.created( );


How can I change the color of the ‘star’ icon in the statement | icon = ‘star’ both using the tag and from the .dart class.



.big {
  color: red;
  fill: red; /* for SVG icons */
$$('iron-icon.big').style..color = 'red'..fill = 'red';

See also

Answered By – Günter Zöchbauer

Answer Checked By – Terry (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.