Skip to content

Instantly share code, notes, and snippets.

@ztl8702
Created July 19, 2016 12:18
Show Gist options
  • Save ztl8702/da74e26a3c3254c09862f697cb7390fb to your computer and use it in GitHub Desktop.
Save ztl8702/da74e26a3c3254c09862f697cb7390fb to your computer and use it in GitHub Desktop.
Extending native element
<link rel="import" href="../polymer/polymer.html">
<dom-module id="mm-button-styles">
<template>
<style>
:host {
display: block;
border: 2px solid red;
}
</style>
</template>
</dom-module>
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="mm-button-styles.html">
<dom-module id="mm-button">
<template>
 <style include="mm-button-styles"></style>
<content></content>
</template>
<script>
Polymer({
is: 'mm-button',
extends: 'input'
});
</script>
</dom-module>
...
<input type="submit" id="edit-submit" value="Search" class="button js-form-submit form-submit" is="mm-button" />
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment