diff --git a/src/generators/Generator.ts b/src/generators/Generator.ts index d78bf7bbbb..b53851cec9 100644 --- a/src/generators/Generator.ts +++ b/src/generators/Generator.ts @@ -179,7 +179,7 @@ export default class Generator { } this.walkTemplate(); - this.stylesheet.reify(); + if (!this.customElement) this.stylesheet.reify(); } addSourcemapLocations(node: Node) { diff --git a/src/generators/nodes/Element.ts b/src/generators/nodes/Element.ts index 1b5b49f498..42db165f9d 100644 --- a/src/generators/nodes/Element.ts +++ b/src/generators/nodes/Element.ts @@ -142,8 +142,6 @@ export default class Element extends Node { this.name.replace(/[^a-zA-Z0-9_$]/g, '_') ); - this.generator.stylesheet.apply(this); - if (this.children.length) { if (this.name === 'pre' || this.name === 'textarea') stripWhitespace = false; this.initChildren(block, stripWhitespace, nextSibling); @@ -671,8 +669,6 @@ export default class Element extends Node { } addCssClass() { - if (this._addedCssClass || this.generator.customElement) return; - this._addedCssClass = true; const classAttribute = this.attributes.find(a => a.name === 'class'); if (classAttribute && classAttribute.value !== true) { if (classAttribute.value.length === 1 && classAttribute.value[0].type === 'Text') {