« get me outta code hell

prefer consistent layout HTML over hacky CSS - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <towerofnix@gmail.com>2021-06-03 11:37:05 -0300
committer(quasar) nebula <towerofnix@gmail.com>2021-06-03 11:37:45 -0300
commit73e2f31b6d8eccb938b65a7337ed856d882d822a (patch)
tree9ed4d69690bbe4618b447945d8a884bef416d677
parentf4fe294d709add9164c57cf76cdd741c99d47855 (diff)
prefer consistent layout HTML over hacky CSS
-rw-r--r--src/static/site.css13
-rwxr-xr-xsrc/upd8.js14
2 files changed, 9 insertions, 18 deletions
diff --git a/src/static/site.css b/src/static/site.css
index cc2e926..4ccbdc1 100644
--- a/src/static/site.css
+++ b/src/static/site.css
@@ -40,9 +40,8 @@ body::before {
 }
 
 #page-container > * {
-    --margin: 15px; /* necessary for size calculations due to CSS suckery */
-    margin-left: var(--margin);
-    margin-right: var(--margin);
+    margin-left: 15px;
+    margin-right: 15px;
 }
 
 #banner {
@@ -908,14 +907,6 @@ li > ul {
         columns: 1;
     }
 
-    #content {
-        width: 100%;
-    }
-
-    #page-container > #content {
-        width: calc(100% - calc(var(--margin) * 2));
-    }
-
     #cover-art-container {
         float: none;
         margin: 0 10px 10px 10px;
diff --git a/src/upd8.js b/src/upd8.js
index b37dabd..a2262d6 100755
--- a/src/upd8.js
+++ b/src/upd8.js
@@ -1978,13 +1978,13 @@ writePage.html = (pageFn, {
     const layoutHTML = [
         navHTML,
         banner.position === 'top' && bannerHTML,
-        (sidebarLeftHTML || sidebarRightHTML) ? fixWS`
-            <div ${classes('layout-columns', !collapseSidebars && 'vertical-when-thin')}>
-                ${sidebarLeftHTML}
-                ${mainHTML}
-                ${sidebarRightHTML}
-            </div>
-        ` : mainHTML,
+        html.tag('div',
+            {class: ['layout-columns', !collapseSidebars && 'vertical-when-thin']},
+            [
+                sidebarLeftHTML,
+                mainHTML,
+                sidebarRightHTML
+            ]),
         banner.position === 'bottom' && bannerHTML,
         footerHTML
     ].filter(Boolean).join('\n');