diff --git a/src/modules/init/content.ts b/src/modules/init/content.ts index 04d143f1..bf5f2dd8 100644 --- a/src/modules/init/content.ts +++ b/src/modules/init/content.ts @@ -44,7 +44,8 @@ const initPredefinedContent = (content: Node, elName: string, attrs: any): void const el: HTMLElement = document.createElement(elName); const elClass = `${CONTENT}__${elName}`; - el.classList.add(elClass); + const list = elClass.split(' '); + el.classList.add(...list); // Set things like "placeholder": for (let key in attrs) { diff --git a/src/modules/init/modal.ts b/src/modules/init/modal.ts index a7f7edb7..64e1ca86 100644 --- a/src/modules/init/modal.ts +++ b/src/modules/init/modal.ts @@ -38,7 +38,8 @@ const customizeModalElement = (modal: Element, opts: SwalOptions): void => { const { className } = opts; if (className) { - modal.classList.add(className); + const list = className.split(' '); + modal.classList.add(...list); } };