crobi il y a 10 ans
Parent
révision
4c32296d3d
2 fichiers modifiés avec 36 ajouts et 0 suppressions
  1. 1
    0
      generator/components-test.html
  2. 35
    0
      generator/components/card-subtitle.html

+ 1
- 0
generator/components-test.html Voir le fichier

@@ -13,6 +13,7 @@
13 13
     <link rel="import" href="components/card-icon.html">
14 14
     <link rel="import" href="components/card-contents.html">
15 15
     <link rel="import" href="components/card-rule.html">
16
+    <link rel="import" href="components/card-subtitle.html">
16 17
 </head>
17 18
 <body class="page-background">
18 19
     <card-front class="card-size-25x35" color="maroon">

+ 35
- 0
generator/components/card-subtitle.html Voir le fichier

@@ -0,0 +1,35 @@
1
+
2
+<template id="card-subtitle">
3
+    <style>
4
+        :host {
5
+            height: 18px;
6
+            margin: 0;
7
+            font-family: inherit;
8
+            font-size: 10pt;
9
+            font-style: italic;
10
+        }
11
+    </style>
12
+
13
+    <content>
14
+    </content>
15
+
16
+</template>
17
+
18
+<script>
19
+    (function(window, document) {
20
+        var elemName = 'card-subtitle';
21
+        var mainDoc = document;
22
+        var importDoc = document.currentScript.ownerDocument;
23
+
24
+        var proto = Object.create(HTMLElement.prototype);
25
+        proto.createdCallback = function () {
26
+            var template = importDoc.getElementById(elemName);
27
+            var clone = mainDoc.importNode(template.content, true);
28
+            var root = this.createShadowRoot();
29
+            root.appendChild(clone);
30
+        }
31
+
32
+        mainDoc.registerElement(elemName, { prototype: proto });
33
+
34
+    })(window, document);
35
+</script>

Loading…
Annuler
Enregistrer