Search code examples
htmlcsspolymerpolymer-1.0paper-elements

Polymer 1.0: Referencing a path for an imported style sheet using a custom-style


I'm trying to understand this example.

Code
<link rel="import" href="../../styles/app-theme.html"> <!--Line 22-->
...
<style is="custom-style" include="app-theme"></style> <!--Line 32-->

Question

In line 32, does the app-theme value for the include attribute refer to the app-theme.html import in line 22? If so, how does the compiler discover the path of the app-theme.html import if it's not included somewhere in the <style> tag's set of attributes?


Solution

  • It really just references the id of the dom-module with the style you want to use.

    <dom-module id="app-theme">
      <template>
        <style>
         .red { color: red; }
        </style> 
      </template>
    </dom-module>