暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

card-title.html 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <link href='http://fonts.googleapis.com/css?family=Lora:700' rel='stylesheet' type='text/css'>
  2. <template id="card-title">
  3. <style>
  4. :host {
  5. font-family: Lora, 'Calisto MT', 'Bookman Old Style', Bookman, 'Goudy Old Style', Garamond, 'Hoefler Text', 'Bitstream Charter', Georgia, serif;
  6. font-variant: small-caps;
  7. font-weight: bold;
  8. background-color: inherit;
  9. color: white;
  10. display: flex;
  11. justify-content: space-between;
  12. align-items: center;
  13. height: 30px;
  14. }
  15. ::content > h1 {
  16. flex: 1;
  17. font-size: 13pt;
  18. font-family: inherit;
  19. display: block;
  20. margin: 0;
  21. padding-left: 6px;
  22. }
  23. ::content > h2 {
  24. font-size: 18pt;
  25. font-family: inherit;
  26. display: block;
  27. margin: 0;
  28. }
  29. ::content > card-icon {
  30. height: 100%;
  31. }
  32. </style>
  33. <content></content>
  34. </template>
  35. <script>
  36. (function(window, document) {
  37. var elemName = 'card-title';
  38. var mainDoc = document;
  39. var importDoc = document.currentScript.ownerDocument;
  40. var proto = Object.create(HTMLElement.prototype);
  41. proto.createdCallback = function () {
  42. var template = importDoc.getElementById(elemName);
  43. var clone = mainDoc.importNode(template.content, true);
  44. var root = this.createShadowRoot();
  45. root.appendChild(clone);
  46. }
  47. mainDoc.registerElement(elemName, { prototype: proto });
  48. })(window, document);
  49. </script>