Skip to content

Instantly share code, notes, and snippets.

@frankiefu
Created October 10, 2016 20:31
Show Gist options
  • Save frankiefu/8d1a06bbfeb4a1142adfdee1b0190099 to your computer and use it in GitHub Desktop.
Save frankiefu/8d1a06bbfeb4a1142adfdee1b0190099 to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<script src="webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="polymer/polymer.html">
</head>
<body>
<dom-module id="x-foo">
<template>
<style>
:host {
display: block;
}
:host([red]) > .label {
color: red;
}
</style>
<div class="label">This should be red.</div>
</template>
<script>
HTMLImports.whenReady(function() {
Polymer({
is: 'x-foo'
});
});
</script>
</dom-module>
<x-foo red></x-foo>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment