diff --git a/fastn-js/js/dom.js b/fastn-js/js/dom.js index e75dbe2595..cae4c94ce1 100644 --- a/fastn-js/js/dom.js +++ b/fastn-js/js/dom.js @@ -2,6 +2,12 @@ let fastn_dom = {}; fastn_dom.styleClasses = ""; +fastn_dom.InternalClass = { + FT_COLUMN: 'ft_column', + FT_ROW: 'ft_row', + FT_FULL_SIZE: "ft_full_size", +}; + fastn_dom.codeData = { availableThemes: {}, addedCssFile: [] diff --git a/fastn-js/js/utils.js b/fastn-js/js/utils.js index b32e64ee65..a205e63eaa 100644 --- a/fastn-js/js/utils.js +++ b/fastn-js/js/utils.js @@ -4,12 +4,12 @@ let fastn_utils = { let css = []; let attributes = {}; if (kind === fastn_dom.ElementKind.Column) { - css.push("ft_column"); + css.push(fastn_dom.InternalClass.FT_COLUMN); } else if (kind === fastn_dom.ElementKind.Document) { - css.push("ft_column"); - css.push("full"); + css.push(fastn_dom.InternalClass.FT_COLUMN); + css.push(fastn_dom.InternalClass.FT_FULL_SIZE); } else if (kind === fastn_dom.ElementKind.Row) { - css.push("ft_row"); + css.push(fastn_dom.InternalClass.FT_ROW); } else if (kind === fastn_dom.ElementKind.IFrame) { node = "iframe"; // To allow fullscreen support @@ -101,10 +101,12 @@ let fastn_utils = { if (ssr) { iterativeClassList = iterativeClassList.getClasses(); } + const internalClassNames = Object.values(fastn_dom.InternalClass); const classesToRemove = []; for (const className of iterativeClassList) { - if (!className.startsWith('__') && + if (!className.startsWith('__') && + !internalClassNames.includes(className) && className !== extraCodeData?.language && className !== extraCodeData?.theme ) { diff --git a/ftd/ftd-js.css b/ftd/ftd-js.css index 250014eba6..ff39a1d267 100644 --- a/ftd/ftd-js.css +++ b/ftd/ftd-js.css @@ -132,7 +132,7 @@ pre code { justify-content: start } -.full { +.ft_full_size { width: 100%; height: 100%; } diff --git a/ftd/t/js/22-document.html b/ftd/t/js/22-document.html index b64f427435..238bc79bc3 100644 --- a/ftd/t/js/22-document.html +++ b/ftd/t/js/22-document.html @@ -17,7 +17,7 @@ -