Binding style attributes to component properties in polymer-1.0

Issue

Given the following .html

.html

<!-- shared-styles.html -->
<dom-module id="shared-styles">
  <template>
    <style>
      .red { color: red; }
    </style> 
  </template>
</dom-module>

and the .dart src

.dart

@property
String redColor = ...

How can I bind the redColor property to the color attribute in the element of the .html declaration?

Thanks

Solution

This is not supported.

I would use the Polymer API to change CSS variables like shown in polymer 1.0 – how to change font size programmatically? as work-around.

Answered By – Günter Zöchbauer

Answer Checked By – Timothy Miller (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *