Commit 14330bb5 authored by Andi Staub's avatar Andi Staub
Browse files

Scope changing of css classes only to the ones existing in the style tag

parent 2cab29d1
Pipeline #10773 passed with stage
in 21 seconds
......@@ -13,6 +13,7 @@ export default class StatelessWebComponent extends HTMLElement {
render() {
const cssClassPrefix = this.constructor.name;
const element = document.createElement('div');
element.innerHTML = this.template();
......@@ -28,7 +29,7 @@ export default class StatelessWebComponent extends HTMLElement {
styleTag.textContent = css;
Array.from(element.querySelectorAll('[class]')).forEach((node) => {
Array.from(element.querySelectorAll(cssSelectors.join(','))).forEach((node) => {
const classNames = Array.from(node.classList);
classNames.forEach((className) => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment