Skip to content

Commit

Permalink
fix: apply style after template content so that it overrides user tem…
Browse files Browse the repository at this point in the history
…plate styles such as those imported via link elements
  • Loading branch information
trusktr committed Apr 10, 2024
1 parent e8d6df1 commit e869606
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/LumeElement.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/LumeElement.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/LumeElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,12 @@ class LumeElement extends Effectful(HTMLElement) {
#disposeTemplate?: () => void

connectedCallback() {
this.#setStyle()

const template = this.template

if (template)
this.#disposeTemplate = render(typeof template === 'function' ? template.bind(this) : () => template, this.root)

this.#setStyle()
}

disconnectedCallback() {
Expand Down

0 comments on commit e869606

Please sign in to comment.