File tree 1 file changed +12
-9
lines changed
1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -2,19 +2,22 @@ customElements.define('person-details',
2
2
class extends HTMLElement {
3
3
constructor ( ) {
4
4
super ( ) ;
5
- let template = document . getElementById ( 'person-template' ) ;
6
- let templateContent = template . content ;
5
+
6
+ const template = document . getElementById ( 'person-template' ) ;
7
+ const templateContent = template . content ;
7
8
8
9
const shadowRoot = this . attachShadow ( { mode : 'open' } ) ;
9
10
10
- let style = document . createElement ( 'style' ) ;
11
- style . textContent = 'div { padding: 10px; border: 1px solid gray; width: 200px; margin: 10px; }' +
12
- 'h2 { margin: 0 0 10px; }' +
13
- 'ul { margin: 0; }' +
14
- 'p { margin: 10px 0; }' +
15
- '::slotted(*) { color: gray; font-family: sans-serif; } ' ;
11
+ const style = document . createElement ( 'style' ) ;
12
+ style . textContent = `
13
+ div { padding: 10px; border: 1px solid gray; width: 200px; margin: 10px; }
14
+ h2 { margin: 0 0 10px; }
15
+ ul { margin: 0; }
16
+ p { margin: 10px 0; }
17
+ ::slotted(*) { color: gray; font-family: sans-serif; }
18
+ ` ;
16
19
17
20
shadowRoot . appendChild ( style ) ;
18
21
shadowRoot . appendChild ( templateContent . cloneNode ( true ) ) ;
19
22
}
20
- } )
23
+ } ) ;
You can’t perform that action at this time.
0 commit comments