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-property.html 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template id="card-property">
  2. <style>
  3. div {
  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. <div>
  22. <content></content>
  23. </div>
  24. </template>
  25. <script>
  26. (function (window, document) {
  27. var elemName = 'card-property';
  28. var mainDoc = document;
  29. var importDoc = document.currentScript.ownerDocument;
  30. var proto = Object.create(HTMLElement.prototype);
  31. proto.createdCallback = function () {
  32. var template = importDoc.getElementById(elemName);
  33. var clone = mainDoc.importNode(template.content, true);
  34. var root = this.createShadowRoot();
  35. root.appendChild(clone);
  36. }
  37. mainDoc.registerElement(elemName, { prototype: proto });
  38. })(window, document);
  39. </script>