Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Polymer 1.0 app-theme only affecting index.html and not on custom elements

Tags:

css

polymer

I'm using the Polymer Starter Kit, and I wanted to move the scaffold into it's own element <main-scaffold>. There are styles in app-theme.html that applied to it before I moved it into from index.html into it's own element, but now none of the styles apply. This is the case for any set of elements I've put into my own custom elements. The custom styles applied to <paper-material> from app-theme.html are not applied inside my <home-page> element. I want certain elements to have themes applied to them globally. The only style inside app-theme.html that apply anywhere else are the CSS Custom Properties such as --dark-primary-color.

Is there any way I can create themes that apply to the entire project? I've tried specifically importing app-theme.html into my elements, and it doesn't make a difference. Thanks in advance.

like image 626
Nick Ewer Avatar asked Jun 17 '15 19:06

Nick Ewer


1 Answers

The themes from polymerthemes.com should apply across your entire project.

Just download one of the pre-made themes (or create your own using the Polymer Theme Builder) and link to it like this in your <head>:

<style is="custom-style">
    @import url("path/to/theme.css");
</style>

Alternatively, have a look to see how styles are applied on that site.

Disclaimer: I'm one of the creators of polymerthemes.com.

like image 87
daskalou Avatar answered Oct 13 '22 21:10

daskalou