dartlangfr / game-store-codelab

Learn how to build a webapp with Dart and Polymer
Apache License 2.0
9 stars 5 forks source link

applyAuthorStyles don't work anymore #4

Closed vferries closed 10 years ago

vferries commented 10 years ago

applyAuthorStyles is not supported anymore. There are some distinct solutions, check this one out. I'm not sure it's the best way to correct this.

You could also include the css link in each polymer-element definition, but I don't like this solution neither. Let me know if you got a better solution.

Additional documentation can be found here

ggirou commented 10 years ago

I agree with that. Another solution with less impact could be to use Light DOM instead of Shadow DOM.

<polymer-element name="x-game" lightdom>
  <template>
    ...
  </template>
  <script type="application/dart" src="game.dart"></script>
</polymer-element>

Anyway we have to update this codelab, many changes happened since polymer 0.9.1!

vferries commented 10 years ago

Thanks for this tip. Interesting property, I didn't know about it. Do you want me to provide updates as pull requests?

2014-08-02 13:21 GMT+02:00 Guillaume Girou notifications@github.com:

I agree we that. Another solution with less impact could be to use Light DOM instead of Shadow DOM.

Anyway we have to update this codelab, many changes happened since polymer 0.9.1!

— Reply to this email directly or view it on GitHub https://github.com/dartlangfr/game-store-codelab/issues/4#issuecomment-50960439 .

vferries commented 10 years ago

The lightdom attribute don't seem to work either (I still see a shadow-root node in my DOM).

It's supposed to be gone also: https://code.google.com/p/dart/issues/detail?id=15510

2014-08-02 13:44 GMT+02:00 Vincent Ferries vincent.ferries@gmail.com:

Thanks for this tip. Interesting property, I didn't know about it. Do you want me to provide updates as pull requests?

2014-08-02 13:21 GMT+02:00 Guillaume Girou notifications@github.com:

I agree we that.

Another solution with less impact could be to use Light DOM instead of Shadow DOM.

Anyway we have to update this codelab, many changes happened since polymer 0.9.1!

— Reply to this email directly or view it on GitHub https://github.com/dartlangfr/game-store-codelab/issues/4#issuecomment-50960439 .

ggirou commented 10 years ago

I tried with an old version, polymer 0.9.5, and I was able to apply styles from outside of the component. Indeed, with the last version, it's not working anymore :(

So if we can't use LightDOM for now, I think the best way with the less impact is to include css links in each component. It's what we did in risk-codelab.

I'd like to accept your pull requests if you have time :) Thanks!