Skip to content

Commit 4e090eb

Browse files
committed
Set host element to a block its Shadow DOM
1 parent aaac785 commit 4e090eb

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"clean": "rm -rf dist",
1515
"lint": "eslint . --ext .js,.ts && tsc --noEmit",
1616
"prebuild": "npm run clean && npm run lint && mkdir dist",
17-
"build": "tsc && cp src/index.css dist/index.css",
17+
"build": "tsc",
1818
"pretest": "npm run build",
1919
"test": "karma start ./test/karma.config.cjs",
2020
"prepublishOnly": "npm run build",

src/index.css

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,17 @@ export default class IncludeFragmentElement extends HTMLElement {
161161
}
162162
}
163163

164+
constructor() {
165+
super()
166+
this.attachShadow({mode: 'open'}).innerHTML = `
167+
<style>
168+
:host {
169+
display: block;
170+
}
171+
</style>
172+
<slot></slot>`
173+
}
174+
164175
connectedCallback(): void {
165176
if (this.src && this.loading === 'eager') {
166177
handleData(this)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy