Created
April 21, 2015 21:48
-
-
Save morethanreal/da583f571d9931d03f99 to your computer and use it in GitHub Desktop.
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
<script src="../webcomponentsjs/webcomponents-lite.js"></script> | |
<link rel="import" href="../polymer/polymer.html"> | |
<link rel="import" href="my-element.html"> | |
<link rel="import" href="other-element.html"> | |
<body> | |
<h1>with hostAttributes</h1> | |
<my-element> | |
<p>some stuff</p> | |
<other-element></other-element> | |
</my-element> | |
<h1>inline class</h1> | |
<my-element> | |
<p>some stuff</p> | |
<other-element class="foo"></other-element> | |
</my-element> | |
</body> |
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
<dom-module id="my-element"> | |
<style> | |
:host { | |
display: block; | |
border: 1px solid black; | |
} | |
</style> | |
<template> | |
some content with .foo | |
<content select=".foo"></content> | |
<br> | |
rest of the content | |
<content></content> | |
</template> | |
</dom-module> | |
<script> | |
(function() { | |
Polymer({ | |
is: 'my-element' | |
}); | |
})(); | |
</script> |
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
<dom-module id="other-element"> | |
<style> | |
:host { | |
display: block; | |
color: red; | |
} | |
</style> | |
<template> | |
I should appear first | |
</template> | |
</dom-module> | |
<script> | |
(function() { | |
Polymer({ | |
is: 'other-element', | |
hostAttributes: { | |
class: 'foo' | |
} | |
}); | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment