暫無描述
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-property.html 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template id="card-property">
  2. <style>
  3. :host {
  4. /* Indenting everything EXCEPT the first line. */
  5. text-indent: -1em;
  6. margin-left: 1em;
  7. font-size: inherit;
  8. }
  9. ::content > * {
  10. display: inline;
  11. font-size: inherit;
  12. color: black;
  13. }
  14. ::content > h4 {
  15. font-weight: bold;
  16. }
  17. ::content > h4 + p {
  18. margin-left: 0.4em;
  19. }
  20. </style>
  21. <content></content>
  22. </template>
  23. <script>
  24. (function (window, document) {
  25. var elemName = 'card-property';
  26. var mainDoc = document;
  27. var importDoc = document.currentScript.ownerDocument;
  28. var proto = Object.create(HTMLElement.prototype);
  29. proto.createdCallback = function () {
  30. var template = importDoc.getElementById(elemName);
  31. var clone = mainDoc.importNode(template.content, true);
  32. var root = this.createShadowRoot();
  33. root.appendChild(clone);
  34. }
  35. mainDoc.registerElement(elemName, { prototype: proto });
  36. })(window, document);
  37. </script>