Ingen beskrivning
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

card-rule.html 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template id="card-rule">
  2. <style>
  3. :host {
  4. line-height: 0pt;
  5. margin-top: 3px;
  6. margin-bottom: 3px;
  7. }
  8. #rule {
  9. width: 100%;
  10. height: 4px;
  11. }
  12. </style>
  13. <svg id="rule" height="1" width="100" viewBox="0 0 100 1" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg">
  14. <polyline points="0,0 100,0.5 0,1"></polyline>
  15. </svg>
  16. </template>
  17. <script>
  18. (function(window, document) {
  19. var elemName = 'card-rule';
  20. var mainDoc = document;
  21. var importDoc = document.currentScript.ownerDocument;
  22. var proto = Object.create(HTMLElement.prototype);
  23. proto.createdCallback = function () {
  24. var template = importDoc.getElementById(elemName);
  25. var clone = mainDoc.importNode(template.content, true);
  26. var root = this.createShadowRoot();
  27. root.appendChild(clone);
  28. }
  29. mainDoc.registerElement(elemName, { prototype: proto });
  30. })(window, document);
  31. </script>