Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Add shared styles
Browse files Browse the repository at this point in the history
Add the new Polymer 1.1.0 share styles approach.

Remove commented css
  • Loading branch information
chuckh committed Aug 24, 2015
1 parent d439e7d commit 1d99963
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
1 change: 1 addition & 0 deletions app/elements/elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@

<!-- Add your elements here -->
<link rel="import" href="../styles/app-theme.html">
<link rel="import" href="../styles/shared-styles.html">
<link rel="import" href="my-greeting/my-greeting.html">
<link rel="import" href="my-list/my-list.html">
12 changes: 2 additions & 10 deletions app/elements/my-greeting/my-greeting.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,14 @@
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->

<link rel="import" href="../../styles/shared-styles.html">
<dom-module id="my-greeting">
<template>
<style include="shared-styles"></style>
<style>
:host {
display: block;
}

.page-title {
@apply(--paper-font-display2);
}

@media (max-width: 600px) {
.page-title {
font-size: 24px!important;
}
}
</style>
<h2 class="page-title"><span>{{greeting}}</span></h2>
<span class="paper-font-body2">Update text to change the greeting.</span>
Expand Down
4 changes: 4 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
<!-- will be replaced with elements/elements.vulcanized.html -->
<link rel="import" href="elements/elements.html">
<!-- endreplace-->

<!-- For shared styles, shared-styles.html import in elements.html -->
<style is="custom-style" include="shared-styles"></style>

</head>

<body unresolved class="fullbleed layout vertical">
Expand Down
8 changes: 0 additions & 8 deletions app/styles/app-theme.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@
height: 900px;
}

.page-title {
@apply(--paper-font-display2);
}

/* Breakpoints */

/* Small */
Expand Down Expand Up @@ -160,10 +156,6 @@
background: white;
}

.page-title {
font-size: 24px;
}

}

/* Tablet+ */
Expand Down
16 changes: 16 additions & 0 deletions app/styles/shared-styles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- shared-styles.html -->
<dom-module id="shared-styles">
<template>
<style>
.page-title {
@apply(--paper-font-display2);
}

@media (max-width: 600px) {
.page-title {
font-size: 24px!important;
}
}
</style>
</template>
</dom-module>

0 comments on commit 1d99963

Please sign in to comment.