Hi,

I have a component like this (tiny, short and sweet):

--------------------------------

<link rel="import" href="/bower_components/polymer/polymer.html">

<dom-module id="my-app">
  <template>
    <style include="my-shared-styles">

      :host(.main-ent) {
        --primary-color: var(--paper-blue-600);
      }
      :host(.main-all) {
        --primary-color: var(--paper-purple-700);
      }
    </style>

    <an-element-using-primary-color></an-element-using-primary-color>

  </template>

  <script>
    Polymer({

      is: 'my-app',

      properties: {
        siteInfo: {
          type: Object,
          notify: true,
      },

      attached: function() {

        console.log("SITEINFO (SHORT):", this.siteInfo.short );

        this.classList.add('main-' + this.siteInfo.short);
        //this.async( function() {
          this.updateStyles();
        //});

      },
    });
  </script>
</dom-module>

The problem I am having is that without that `this.async()`, *sometimes* 
(say one time out of 8) this.updateStyles() doesn't seem to work: the 
primary colour stays "wrong".
I am not even 10000% sure the problem is solved with `this.async()`, or 
only mitigated.

So...

* What's the root of the problem?
* Does `this.async()` actually fix it?
* If not, what does?

Merc.


Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/c2a9901a-1215-44c4-8486-8894cefb777c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to