1234567891011121314151617181920212223242526272829303132333435363738 |
-
- <template id="card-rule">
- <style>
- :host {
- line-height: 0pt;
- margin-top: 3px;
- margin-bottom: 3px;
- }
- #rule {
- width: 100%;
- height: 4px;
- }
- </style>
-
- <svg id="rule" height="1" width="100" viewBox="0 0 100 1" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg">
- <polyline points="0,0 100,0.5 0,1"></polyline>
- </svg>
-
- </template>
-
- <script>
- (function(window, document) {
- var elemName = 'card-rule';
- var mainDoc = document;
- var importDoc = document.currentScript.ownerDocument;
-
- var proto = Object.create(HTMLElement.prototype);
- proto.createdCallback = function () {
- var template = importDoc.getElementById(elemName);
- var clone = mainDoc.importNode(template.content, true);
- var root = this.createShadowRoot();
- root.appendChild(clone);
- }
-
- mainDoc.registerElement(elemName, { prototype: proto });
-
- })(window, document);
- </script>
|