How to override default-theme on the new paper-styles

506 views
Skip to first unread message

Pedro García

unread,
Apr 30, 2015, 6:18:18 AM4/30/15
to polym...@googlegroups.com
Hi,

I'm working on an web app with polymer 0.8 and i know that the new CSS features are experimental but i found that all new paper elements are using the new paper-styles component for theming.

I think it's a very cool idea, but how do I override the default-theme.html within my app using an external file, I tried many ways and nothing seems to work. 

Regards

Eric Eslinger

unread,
Apr 30, 2015, 12:53:31 PM4/30/15
to Pedro García, polym...@googlegroups.com
I'd love to hear more about this- We're still using 0.5 in our app (not production, just internal stuff for now), and it seems like there's a lot of places where one has to use !important or other tricks to deal with inline styling of shadow dom elements. Having an all-in-one way to theme things centrally would be pretty rad.

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 polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/a1995da0-9c20-4cd6-b9c6-b7aa811a7049%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yvonne Yip

unread,
Apr 30, 2015, 7:52:32 PM4/30/15
to Eric Eslinger, Pedro García, polymer-dev
Hi,

You can define variables from the theme in the main document in a <style is="x-style"> block. For example:

<style is="x-style">

  * {
    --default-primary-color: fuchsia;
  }

</style>


Note that the name "x-style" will likely change before Polymer hits 1.0.

Pedro García

unread,
May 4, 2015, 5:04:12 AM5/4/15
to polym...@googlegroups.com, eric.e...@gmail.com, pdg...@gmail.com
That works, thanks! :)
Reply all
Reply to author
Forward
0 new messages