-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
custom-style
supports module
property that accepts a dom-module
…
… containing style data. `don-module` style data may be specified inside `<template>` elements and style elements also support module attribute for referencing additional modules containing style data.
- Loading branch information
Steven Orvell
committed
Jul 28, 2015
1 parent
051e1bf
commit 3734c4d
Showing
5 changed files
with
124 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
|
||
<title></title> | ||
|
||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
<script src="../../../../webcomponentsjs/webcomponents-lite.js"></script> | ||
<link rel="import" href="../../../polymer.html"> | ||
<link rel="import" href="shared-styles.html"> | ||
<link rel="import" href="x-foo.html"> | ||
</head> | ||
<body unresolved> | ||
|
||
<style is="custom-style" module="shared-styles"></style> | ||
|
||
<style is="custom-style"> | ||
.zot { | ||
background-color: var(--zot); | ||
} | ||
</style> | ||
|
||
<div class="bar">.bar from custom-style with module shared-styles</div> | ||
<div class="foo">.foo should not be colored</div> | ||
<div class="zot">.zot from custom-style using var in custom-style with module shared-styles</div> | ||
|
||
<hr> | ||
|
||
<x-foo></x-foo> | ||
|
||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<dom-module id="shared-styles"> | ||
<style type="polymer"> | ||
.bar { | ||
background-color: steelblue; | ||
} | ||
|
||
:root { | ||
--zot: seagreen; | ||
} | ||
</style> | ||
</dom-module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<link rel="import" href="shared-styles.html"> | ||
|
||
<dom-module id="x-foo"> | ||
<template> | ||
<style module="shared-styles"></style> | ||
<style> | ||
.foo { | ||
background-color: tomato; | ||
} | ||
|
||
:host { | ||
display: block; | ||
border: 1px dashed orange; | ||
padding: 4px; | ||
} | ||
|
||
.zot { | ||
background-color: var(--zot); | ||
} | ||
</style> | ||
<h4>x-foo</h4> | ||
<div class="bar">.bar from shared-styles.html</div> | ||
<div class="foo">.foo from local stylesheet</div> | ||
<div class="zot">.zot from var in shared-styles.html</div> | ||
</template> | ||
<script> | ||
Polymer({ | ||
|
||
}); | ||
</script> | ||
</dom-module> |