JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
progress on webpacking css
authorJason Woofenden <jason@jasonwoof.com>
Tue, 5 May 2020 22:32:00 +0000 (18:32 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Tue, 5 May 2020 22:32:00 +0000 (18:32 -0400)
.gitignore
Makefile
build [new file with mode: 0755]
css/index.html [new file with mode: 0644]
css/index.js [new file with mode: 0644]
css/style.scss [new file with mode: 0644]
inc/cms.php
package.json [new file with mode: 0644]
template.html
webpack.config.js [new file with mode: 0644]

index 23ca6bc..4d6eeb8 100644 (file)
@@ -3,5 +3,8 @@
 /cms_images
 /files
 /tags
-/css.css
 /.sha1sums.styl
+/css/dist
+/style.css
+/.npm-initialized
+/node_modules
index c7a7078..1b1cce6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,10 @@
-all: css.css
+all: style.css
 
 clean:
-       rm -f css.css
+       rm -f css.css tags
 
-css.css: style.sass
-       ./build production
+style.css: css/style.scss
+       ./build production && cp css/dist/css.css style.css
 
 %.min.svg: %.svg
        svgo $< $@
diff --git a/build b/build
new file mode 100755 (executable)
index 0000000..e639fe2
--- /dev/null
+++ b/build
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+# ENV / defaults
+image="${DOCKER_IMAGE-node:latest}"
+port="${PORT-8080}"
+
+if [ -z "$1" ]; then
+    echo "USAGE: $0 [development|production]" >&2
+    exit 1
+fi
+
+cd "$(dirname "$0")" || exit $?
+
+
+run_in_docker() {
+    path="$(readlink -f "$(dirname "$0")")"
+    docker run -i -t -u "$(id -u):$(id -g)" -p "$port:8080" --rm -v "$path/:$path":rw -w "$path" "$image" "$@"
+}
+
+if [ ! -f .npm-initialized -o package.json -nt .npm-initialized ]; then
+    run_in_docker npm install || exit $?
+    mkdir -p css/dist
+    touch .npm-initialized
+fi
+
+run_in_docker npm run "$@"
diff --git a/css/index.html b/css/index.html
new file mode 100644 (file)
index 0000000..b762ca1
--- /dev/null
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta charset="UTF-8">
+        <meta name="viewport" content="width=device-width, user-scalable=no" />
+        <link rel="icon" href="data:;base64,=">
+        <title></title>
+    </head>
+    <body>
+        <div class="siteOuter siteLayoutFull">
+            <div class="siteLogo" style="background-color: #666;">LOGO<br>LOGO<br>LOGO</div>
+            <div class="siteNav" style="background-color: #abc;">
+                <div class="navItem">Home</div>
+                <div class="navItem">About</div>
+                <div class="navItem">Contact Us</div>
+            </div>
+            <div class="siteContent" style="background-color: #457;">
+                <h1>Content</h1>
+                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
+                do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+                Ut enim ad minim veniam, quis nostrud exercitation ullamco
+                laboris nisi ut aliquip ex ea commodo consequat. Duis aute
+                irure dolor in reprehenderit in voluptate velit esse cillum
+                dolore eu fugiat nulla pariatur. Excepteur sint occaecat
+                cupidatat non proident, sunt in culpa qui officia deserunt
+                mollit anim id est laborum.
+
+                <p>Curabitur pretium tincidunt lacus. Nulla gravida orci a
+                odio. Nullam varius, turpis et commodo pharetra, est eros
+                bibendum elit, nec luctus magna felis sollicitudin mauris.
+                Integer in mauris eu nibh euismod gravida. Duis ac tellus et
+                risus vulputate vehicula. Donec lobortis risus a elit. Etiam
+                tempor. Ut ullamcorper, ligula eu tempor congue, eros est
+                euismod turpis, id tincidunt sapien risus a quam. Maecenas
+                fermentum consequat mi. Donec fermentum. Pellentesque malesuada
+                nulla a mi. Duis sapien sem, aliquet nec, commodo eget,
+                consequat quis, neque. Aliquam faucibus, elit ut dictum
+                aliquet, felis nisl adipiscing sapien, sed malesuada diam lacus
+                eget erat. Cras mollis scelerisque nunc. Nullam arcu. Aliquam
+                consequat. Curabitur augue lorem, dapibus quis, laoreet et,
+                pretium ac, nisi. Aenean magna nisl, mollis quis, molestie eu,
+                feugiat in, orci. In hac habitasse platea dictumst.
+            </div>
+            <div class="siteFooter" style="background-color: #89a">
+                Footer
+            </div>
+        </div>
+    </body>
+</html>
diff --git a/css/index.js b/css/index.js
new file mode 100644 (file)
index 0000000..34c2438
--- /dev/null
@@ -0,0 +1,2 @@
+// tell webpack what css/scss files to include in the bundle
+import './style.scss';
diff --git a/css/style.scss b/css/style.scss
new file mode 100644 (file)
index 0000000..3b46369
--- /dev/null
@@ -0,0 +1,773 @@
+$bodyBg: #fff;
+$textColor: #000;
+$desktopMinWidth: 700px;
+$siteMaxWidth: 1100px;
+
+html, body {
+    margin: 0;
+    padding: 0;
+}
+html {
+    overflow-y: scroll;
+}
+body {
+    background: $bodyBg;
+    color: $textColor;
+}
+
+h1:first-child, h2:first-child, h3:first-child {
+    margin-top: 0;
+}
+
+.siteOuter {
+    box-sizing: border-box;
+    //min-height: 100vh;
+    padding: 2vmin;
+    max-width: $siteMaxWidth;
+    margin: 0 auto;
+}
+
+.siteAdminHeader {
+    padding: 2vmin 2vmin 0 2vmin;
+    max-width: $siteMaxWidth;
+    margin: 0 auto;
+}
+
+.siteOuter.siteLayoutFull {
+    grid-kiss:
+        "+-----------+       +--------------+      "
+        "| .siteLogo |       | .siteContent | 0fr  "
+        "+-----------+       |              |      "
+        "                    |              | 2vmin"
+        "+-----------+       |              |      "
+        "| .siteNav  |       |              | 1fr  "
+        "+-----------+       +--------------+      "
+        "                                     2vmin"
+        "+----------------------------------+      "
+        "|          .siteFooter             | 0fr  "
+        "+----------------------------------+      "
+        "    200px     2vmin       2fr             ";
+}
+.siteOuter.siteLayoutSidebar {
+    grid-kiss:
+        "+-----------+       +--------------+       +--------------+      "
+        "| .siteLogo |       | .siteContent |       | .siteSidebar | 0fr  "
+        "+-----------+       |              |       |              |      "
+        "                    |              |       |              | 2vmin"
+        "+-----------+       |              |       |              |      "
+        "| .siteNav  |       |              |       |              | 1fr  "
+        "+-----------+       +--------------+       +--------------+      "
+        "                                                            2vmin"
+        "+---------------------------------------------------------+      "
+        "|                      .siteFooter                        | 0fr  "
+        "+---------------------------------------------------------+      "
+        "    200px     2vmin       2fr        2vmin       2fr             ";
+}
+
+@media (max-width: $desktopMinWidth) {
+    .siteOuter {
+        grid-kiss:
+            "+--------------+       "
+            "| .siteLogo    |  0fr  "
+            "+--------------+       "
+            "                  2vmin"
+            "+--------------+       "
+            "| .siteContent |  1fr  "
+            "+--------------+       "
+            "                  2vmin"
+            "+--------------+       "
+            "| .siteFooter  |  1fr  "
+            "+--------------+       "
+            "        1fr            ";
+    }
+    .siteNav {
+        display: none;
+    }
+}
+
+
+// from back in the day (the rest of the file from here down)
+.icon {
+    display: inline-block;
+    width: 40%;
+}
+.top_button {
+    display: inline-block;
+    width: 30%;
+}
+html {
+    overflow-y: scroll;
+}
+header,
+hgroup,
+section,
+footer,
+aside,
+nav,
+article,
+figure,
+img {
+    display: block;
+}
+code.html {
+    display: block;
+    font: 12px monospace;
+    border: 1px solid #000;
+    background: #ccc;
+}
+.caption {
+    font-weight: bold;
+}
+* + .caption {
+    margin-top: 15px;
+}
+.field {
+    padding-top: 3px;
+}
+div.field_notes {
+    font-size: 12px;
+    line-height: 16px;
+}
+fieldset {
+    border: 1px dotted #000;
+    padding: 0 15px 15px 15px;
+    margin: 15px 0;
+    position: relative;
+}
+legend {
+    padding: 0 6px;
+    font-weight: bold;
+}
+div.error {
+    border: 2px solid #f00;
+    padding: 13px;
+    margin: 20px;
+    background: #fdd;
+}
+h1 {
+    font-size: 26px;
+    margin: 20px 0 10px;
+}
+h1 + h4.tagline {
+    margin: -10px 0 10px;
+}
+h1 + h2 {
+    margin-top: -6px;
+}
+h2 {
+    font-size: 20px;
+    margin: 16px 0px 8px;
+}
+h2 + h4.tagline {
+    margin: -8px 0 8px;
+}
+h3 {
+    font-size: 18px;
+    margin: 12px 0 5px;
+}
+h3 + h4.tagline {
+    margin: -5px 0 5px;
+}
+h4 {
+    font-size: 14px;
+    margin: 10px 0 3px;
+}
+h4 + h4.tagline {
+    margin: -3px 0 3px;
+}
+h1, h2, h3, h4 {
+    font-weight: bold;
+}
+h4.tagline {
+    font-weight: normal;
+}
+p.quote {
+    font-size: 14px;
+    font-weight: bold;
+    padding-bottom: 1px;
+    margin: 15px 15px 0 15px;
+}
+p.quote:before,
+p.quote:after {
+    font-size: 40px;
+    line-height: 0;
+    color: #777;
+    font-weight: bold;
+    display: inline-block;
+    height: 10px;
+    position: relative;
+}
+p.quote:before {
+    content: '“';
+    top: 10px;
+}
+p.quote:after {
+    content: '”';
+    top: 20px;
+    width: 0;
+}
+p.attrib,
+p.attribution {
+    margin: 0 0 15px 20px;
+    margin-top: 1px;
+    padding-left: 30px;
+    font-size: 12px;
+    font-weight: normal;
+}
+p.attrib:before,
+p.attribution:before {
+    content: "— ";
+}
+body {
+    margin: 0;
+    padding: 0;
+    background: #fff;
+    color: #000;
+    font: 15px Arimo, Arial, sans-serif;
+    line-height: 1.2;
+}
+#admin_pages_body #cke_content {
+    width: 980px;
+    margin-right: -30px;
+}
+#admin_pages_wysiwyg_content_full_main {
+    background: #fff;
+    width: 950px;
+    margin: 0 auto;
+    min-width: 0;
+    width: 950px;
+    margin: 0 auto;
+    border: 5px solid #eee;
+    min-height: 50px;
+}
+#admin_pages_wysiwyg_content_with_sidebar_main {
+    background: #fff;
+    width: 670px;
+    margin: 0 auto;
+    min-width: 0;
+    width: 670px;
+    margin: 0 auto;
+    border: 5px solid #eee;
+    min-height: 50px;
+}
+#admin_pages_body #cke_sidebar_content {
+    width: 980px;
+    margin-right: -30px;
+}
+#admin_pages_wysiwyg_content_with_sidebar_sidebar_plain {
+    background: #fff;
+    width: 250px;
+    margin: 0 auto;
+    min-width: 0;
+    width: 250px;
+    margin: 0 auto;
+    border: 5px solid #eee;
+    min-height: 50px;
+}
+#admin_pages_wysiwyg_content_with_sidebar_sidebar_bordered {
+    background: #fff;
+    width: 218px;
+    margin: 0 auto;
+    min-width: 0;
+    width: 218px;
+    margin: 0 auto;
+    border: 5px solid #eee;
+    min-height: 50px;
+}
+body > .centerer {
+    position: relative;
+}
+#site_header {
+    margin: 0 auto 15px auto;
+    position: relative;
+}
+#site_header:before {
+    display: block;
+    background-size: 100%;
+}
+#site_header:after {
+    display: block;
+    position: absolute;
+    bottom: 0;
+    right: 0;
+    padding: 4px;
+    text-align: right;
+}
+.siteNav {
+    margin-bottom: 15px;
+}
+.siteNav ul {
+    margin: 0;
+    padding: 0;
+    list-style: none;
+    text-align: justify;
+}
+.siteNav ul > * {
+    display: inline-block;
+    position: relative;
+    top: 1.2em;
+}
+.siteNav ul:before {
+    content: '';
+    display: block;
+    width: 100%;
+    margin-bottom: -1.2em;
+}
+.siteNav ul:after {
+    content: '';
+    display: inline-block;
+    width: 100%;
+}
+footer#site_footer {
+    clear: both;
+    padding-top: 40px;
+    font-size: 13px;
+}
+#wfpl_messages {
+    background: #ffd;
+    padding: 5px 12px;
+    margin: 0 0 20px 0;
+    -webkit-box-shadow: 2px 2px 6px rgba(0,0,0,0.4);
+    box-shadow: 2px 2px 6px rgba(0,0,0,0.4);
+    -webkit-border-radius: 4px;
+    border-radius: 4px;
+}
+#wfpl_messages p {
+    font-size: 120%;
+    padding: 5px 0;
+    margin: 0px;
+}
+#wfpl_messages hr {
+    display: block;
+    height: 1px;
+    border: 0;
+    border-top: 1px dotted #ddc;
+    margin: 0;
+    padding: 0;
+}
+#admin_links {
+    font-size: 13px;
+    background: rgba(255,244,244,0.5);
+    border: 1px dotted #000;
+    padding: 3px;
+    text-align: right;
+}
+span.wfpl_ifl {
+    display: block;
+    float: left;
+    clear: left;
+    font-size: 10px;
+    color: #000;
+    text-align: right;
+    background-repeat: no-repeat;
+    background-position: left top;
+    margin: 0 10px 2px 0;
+}
+span.wfpl_ifr {
+    display: block;
+    float: right;
+    clear: right;
+    font-size: 10px;
+    color: #000;
+    font-weight: normal;
+    text-align: right;
+    background-repeat: no-repeat;
+    background-position: left top;
+    margin: 0 0 2px 10px;
+}
+div.wfpl_ic {
+    margin: 15px auto;
+    font-size: 10px;
+    font-weight: normal;
+    text-align: right;
+    background-repeat: no-repeat;
+    background-position: center top;
+}
+td > :first-child,
+th > :first-child,
+legend + *,
+article > :first-child,
+aside > :first-child,
+section > :first-child,
+nav > :first-child,
+div > :first-child,
+.first {
+    margin-top: 0px;
+}
+td > :last-child,
+th > :last-child,
+fieldset > :last-child,
+article > :last-child,
+aside > :last-child,
+section > :last-child,
+nav > :last-child,
+div > :last-child,
+.last {
+    margin-bottom: 0px;
+}
+table.evenodd td,
+table.evenodd th {
+    padding: 6px 12px;
+    text-align: left;
+}
+table.evenodd > thead > tr:nth-child(2n+1) > td,
+table.evenodd > tbody > tr:nth-child(2n+1) > td,
+table.evenodd > tr:nth-child(2n+1) > td,
+table.evenodd > thead > tr:nth-child(2n+1) > th,
+table.evenodd > tbody > tr:nth-child(2n+1) > th,
+table.evenodd > tr:nth-child(2n+1) > th {
+    background: rgba(0,0,0,0.04);
+}
+table.evenodd > thead > tr:nth-child(2n+1):hover > td,
+table.evenodd > tbody > tr:nth-child(2n+1):hover > td,
+table.evenodd > tr:nth-child(2n+1):hover > td,
+table.evenodd > thead > tr:nth-child(2n+1):hover > th,
+table.evenodd > tbody > tr:nth-child(2n+1):hover > th,
+table.evenodd > tr:nth-child(2n+1):hover > th {
+    background: rgba(0,0,0,0.07);
+}
+table.evenodd > thead > tr:nth-child(2n+0) > td,
+table.evenodd > tbody > tr:nth-child(2n+0) > td,
+table.evenodd > tr:nth-child(2n+0) > td,
+table.evenodd > thead > tr:nth-child(2n+0) > th,
+table.evenodd > tbody > tr:nth-child(2n+0) > th,
+table.evenodd > tr:nth-child(2n+0) > th {
+    background: rgba(0,0,0,0.02);
+}
+table.evenodd > thead > tr:nth-child(2n+0):hover > td,
+table.evenodd > tbody > tr:nth-child(2n+0):hover > td,
+table.evenodd > tr:nth-child(2n+0):hover > td,
+table.evenodd > thead > tr:nth-child(2n+0):hover > th,
+table.evenodd > tbody > tr:nth-child(2n+0):hover > th,
+table.evenodd > tr:nth-child(2n+0):hover > th {
+    background: rgba(0,0,0,0.09);
+}
+.field_error input {
+    border: 1px solid #f00;
+}
+.password_suggestion + .password_suggestion {
+    margin-left: 10px;
+}
+.wfpl_li,
+.wfpl_ci,
+.wfpl_ri,
+.wfpl_fi {
+    display: block;
+    margin-bottom: 1%;
+    clear: both;
+    font-size: 80%;
+    text-align: right;
+}
+.wfpl_li .wfpl_i,
+.wfpl_ci .wfpl_i,
+.wfpl_ri .wfpl_i,
+.wfpl_fi .wfpl_i {
+    display: block;
+    width: 100%;
+    background-size: 100% auto;
+    background-repeat: no-repeat;
+    background-position: 50% top;
+    margin-bottom: 3px;
+    height: 0;
+    overflow: hidden;
+}
+.wfpl_li,
+.wfpl_ci,
+.wfpl_ri {
+    width: 38.19660112501052%;
+}
+.wfpl_li {
+    float: left;
+    margin-right: 2%;
+}
+.wfpl_ci,
+.wfpl_fi {
+    margin-left: auto;
+    margin-right: auto;
+}
+.wfpl_ri {
+    float: right;
+    margin-left: 2%;
+}
+.wfpl_thumb {
+    display: inline-block;
+    width: 70px;
+    height: 70px;
+    background-size: contain;
+    background-position: 50% 50%;
+    background-repeat: no-repeat;
+}
+.wfpl_li,
+.wfpl_ci,
+.wfpl_ri,
+.wfpl_fi,
+.wfpl_thumb {
+    max-width: 100%;
+}
+body > .centerer {
+    margin: 15px;
+    width: 950px;
+}
+body > .centerer.with_sidebar > .main {
+    float: left;
+    width: 670px;
+}
+body > .centerer.with_sidebar > .gap {
+    width: 30px;
+}
+body > .centerer.with_sidebar > .gap .wfpl_li,
+body > .centerer.with_sidebar > .gap .wfpl_ri {
+    width: 50%;
+}
+body > .centerer.with_sidebar > .gap .wfpl_ci {
+    width: 70%;
+}
+body > .centerer.with_sidebar > .sidebar.plain {
+    float: right;
+    width: 250px;
+}
+body > .centerer.with_sidebar > .sidebar.plain .wfpl_li,
+body > .centerer.with_sidebar > .sidebar.plain .wfpl_ri {
+    width: 50%;
+}
+body > .centerer.with_sidebar > .sidebar.plain .wfpl_ci {
+    width: 70%;
+}
+body > .centerer.with_sidebar > .sidebar.bordered {
+    border-width: 1px;
+    border-style: solid;
+    border-color: #f00;
+    padding: 15px;
+    float: right;
+    width: 218px;
+}
+body > .centerer.with_sidebar > .sidebar.bordered .wfpl_li,
+body > .centerer.with_sidebar > .sidebar.bordered .wfpl_ri {
+    width: 50%;
+}
+body > .centerer.with_sidebar > .sidebar.bordered .wfpl_ci {
+    width: 70%;
+}
+body > .centerer {
+    margin-left: auto;
+    margin-right: auto;
+}
+@media screen and (max-width: 980px) {
+    body > .centerer {
+        margin: 1.5306%;
+        width: 96.9387%;
+    }
+    body > .centerer.with_sidebar > .main {
+        width: 70.5263%;
+    }
+    body > .centerer.with_sidebar > .gap {
+        width: 3.1578%;
+    }
+    body > .centerer.with_sidebar > .sidebar.plain {
+        width: 26.3157%;
+    }
+    body > .centerer.with_sidebar > .sidebar.bordered {
+        padding: 1.5789%;
+        width: 22.9473%;
+    }
+    body > .centerer {
+        width: auto;
+    }
+    body > .centerer .wfpl_li,
+    body > .centerer .wfpl_ri {
+        width: calc(71.5326673199794px + 30.666846670275838%);
+    }
+    body > .centerer .wfpl_ci {
+        width: 362.86771068759987px;
+    }
+    body > .centerer.full > .main .wfpl_li,
+    body > .centerer.full > .main .wfpl_ri {
+        width: calc(71.5326673199794px + 30.666846670275838%);
+    }
+    body > .centerer.full > .main .wfpl_ci {
+        width: 362.86771068759987px;
+    }
+    body > .centerer.with_sidebar > .main .wfpl_li,
+    body > .centerer.with_sidebar > .main .wfpl_ri {
+        width: calc(97.53541937032978px + 23.63907584585682%);
+    }
+    body > .centerer.with_sidebar > .main .wfpl_ci {
+        width: 255.91722753757045px;
+    }
+}
+body {
+    color: #001;
+    background-position: 980px 670px;
+    background-position: 370px 541.1940298507462px;
+}
+@media screen and (max-width: 541.1940298507462px) {
+    body > .centerer.full > .main {
+        border: none;
+        float: none;
+        width: auto;
+        margin-left: 0;
+        margin-right: 0;
+        padding-left: 0;
+        padding-right: 0;
+        margin-top: 1.5306%;
+    }
+    body > .centerer.full > .main .wfpl_li,
+    body > .centerer.full > .main .wfpl_ri {
+        width: calc(71.5326673199794px + 30.666846670275838%);
+    }
+    body > .centerer.full > .main .wfpl_ci {
+        width: 362.86771068759987px;
+    }
+    body > .centerer.with_sidebar > .main {
+        border: none;
+        float: none;
+        width: auto;
+        margin-left: 0;
+        margin-right: 0;
+        padding-left: 0;
+        padding-right: 0;
+        margin-top: 1.5306%;
+    }
+    body > .centerer.with_sidebar > .main .wfpl_li,
+    body > .centerer.with_sidebar > .main .wfpl_ri {
+        width: calc(71.5326673199794px + 30.666846670275838%);
+    }
+    body > .centerer.with_sidebar > .main .wfpl_ci {
+        width: 362.86771068759987px;
+    }
+    body > .centerer.with_sidebar > .gap {
+        border: none;
+        float: none;
+        width: auto;
+        margin-left: 0;
+        margin-right: 0;
+        padding-left: 0;
+        padding-right: 0;
+        margin-top: 1.5306%;
+    }
+    body > .centerer.with_sidebar > .gap .wfpl_li,
+    body > .centerer.with_sidebar > .gap .wfpl_ri {
+        width: calc(71.5326673199794px + 30.666846670275838%);
+    }
+    body > .centerer.with_sidebar > .gap .wfpl_ci {
+        width: 362.86771068759987px;
+    }
+    body > .centerer.with_sidebar > .sidebar.plain {
+        display: none;
+    }
+    body > .centerer.with_sidebar > .sidebar.bordered {
+        display: none;
+    }
+}
+@media screen and (max-width: 381.68421052631584px) {
+    body > .centerer .wfpl_li,
+    body > .centerer .wfpl_ci,
+    body > .centerer .wfpl_ri {
+        float: none;
+        width: 362.86771068759987px;
+        margin-right: auto;
+        margin-left: auto;
+    }
+}
+@media screen and (max-width: 381.68421052631584px) {
+    body > .centerer.full > .main .wfpl_li,
+    body > .centerer.full > .main .wfpl_ci,
+    body > .centerer.full > .main .wfpl_ri {
+        float: none;
+        width: 362.86771068759987px;
+        margin-right: auto;
+        margin-left: auto;
+    }
+}
+@media screen and (max-width: 381.68421052631584px) {
+    body > .centerer.with_sidebar > .main .wfpl_li,
+    body > .centerer.with_sidebar > .main .wfpl_ci,
+    body > .centerer.with_sidebar > .main .wfpl_ri {
+        float: none;
+        width: 255.91722753757045px;
+        margin-right: auto;
+        margin-left: auto;
+    }
+}
+#mobile_menu_button {
+    display: none;
+}
+#mobile_menu_check {
+    display: none;
+}
+@media screen and (max-width: 600px) {
+    .siteNav > form {
+        margin-top: 0;
+    }
+    #mobile_menu_check:not(:checked) + div {
+        display: none;
+    }
+    #mobile_menu_check:checked + div {
+        display: block;
+        position: relative;
+    }
+    #mobile_menu_check:checked + div > ul {
+        z-index: 1000;
+        background: #fff;
+        background: rgba(255,255,255,0.95);
+        display: block;
+        position: absolute;
+        top: 100%;
+        width: 96%;
+        left: 2%;
+        margin: 0;
+        padding: 0;
+        border-bottom-left-radius: 4px;
+        border-bottom-right-radius: 4px;
+        -webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.1);
+        box-shadow: 0px 3px 3px rgba(0,0,0,0.1);
+    }
+    #mobile_menu_check:checked + div > ul li {
+        padding: 15px;
+        white-space: nowrap;
+    }
+    #mobile_menu_check:checked + div > ul li + li {
+        padding-top: 0;
+    }
+    #mobile_menu_check:checked + div > ul li a {
+        font-size: 18px;
+    }
+    #mobile_menu_check:checked + div > ul:before,
+    #mobile_menu_check:checked + div > ul:after {
+        display: none;
+        content: none;
+        margin: 0;
+        padding: 0;
+    }
+    #mobile_menu_check:checked + div > ul > * {
+        position: static;
+        top: 0;
+    }
+    .siteNav ul > li,
+    #mobile_menu_button {
+        display: block;
+        padding: 0px 10px 0px 17px;
+        font-size: 18px;
+    }
+}
+#admin_images_body .th_toggle_buttons {
+    font-weight: normal;
+    color: #777;
+    text-align: justify;
+}
+#admin_images_body .th_toggle_buttons > * {
+    display: inline-block;
+    position: relative;
+    top: 1.2em;
+}
+#admin_images_body .th_toggle_buttons:before {
+    content: '';
+    display: block;
+    width: 100%;
+    margin-bottom: -1.2em;
+}
+#admin_images_body .th_toggle_buttons:after {
+    content: '';
+    display: inline-block;
+    width: 100%;
+}
index 71b9cab..827880c 100644 (file)
@@ -31,17 +31,18 @@ function cms_display($basename, &$tem) {
     if ($header_image) {
         $hi_css  = "\n<style>\n";
         if ($header_image['width'] != WFPL_SITE_WIDTH) {
-            $hi_css .= "#site_header {\n";
+            $hi_css .= ".siteHeader {\n";
             $hi_css .=   'width: ' . $header_image['width'] . "px;\n";
             $hi_css .= "}\n";
         }
-        $hi_css .= "#site_header:before {\n";
+        $hi_css .= ".siteHeader:before {\n";
         $hi_css .=   "content: \"\";\n";
+        $hi_css .=   "display: block;\n";
         $hi_css .=   'background-image: url(' . $header_image['url'] . ");\n";
         $hi_css .=   'padding-top: ' . ($header_image['height'] / $header_image['width'] * 100) . "%;\n";
         $hi_css .= "}\n";
         if ($header_image['caption']) {
-            $hi_css .= "#site_header:after {\n";
+            $hi_css .= ".siteHeader:after {\n";
             $hi_css .=   "content: \"" . enc_css_str($header_image['caption']) . "\";\n";
             $hi_css .= "}\n";
         }
@@ -80,9 +81,9 @@ function cms_display_content(&$tem, $row) {
         $tem->set('$meta_description', $row['description']);
         $tem->set('$cms_body', $row['content']);
         if ($row['layout'] === '' || $row['layout'] === '0') {
-            $tem->set('$layout_centerer_class', 'full');
+            $tem->set('siteLayoutClass', 'siteLayoutFull');
         } else {
-            $tem->set('$layout_centerer_class', 'with_sidebar');
+            $tem->set('siteLayoutClass', 'siteLayoutSidebar');
             if ($row['layout'] === '1') {
                 $tem->set('$layout_sidebar_class', 'plain');
             } else {
@@ -92,6 +93,6 @@ function cms_display_content(&$tem, $row) {
         }
         return $row['id'];
     } else {
-        $tem->set('$layout_centerer_class', 'full');
+        $tem->set('siteLayoutClass', 'siteLayoutFull');
     }
 }
diff --git a/package.json b/package.json
new file mode 100644 (file)
index 0000000..af0b830
--- /dev/null
@@ -0,0 +1,27 @@
+{
+    "scripts": {
+        "development": "webpack-dev-server --open",
+        "production": "webpack --mode=production"
+    },
+    "devDependencies": {
+        "webpack": "latest",
+        "webpack-cli": "latest",
+        "webpack-dev-server": "latest",
+        "html-webpack-plugin": "latest",
+        "url-loader": "latest",
+        "clean-webpack-plugin": "latest",
+        "css-loader": "latest",
+        "mini-css-extract-plugin": "latest",
+        "postcss": "latest",
+        "postcss-import": "latest",
+        "postcss-loader": "latest",
+        "postcss-grid-kiss": "latest",
+        "postcss-preset-env": "latest",
+        "postcss-env-function": "latest",
+        "autoprefixer": "latest",
+        "file-loader": "latest",
+        "sass": "latest",
+        "sass-loader": "latest",
+        "style-loader": "latest"
+    }
+}
index 9358bb0..7ef2a7b 100644 (file)
@@ -3,7 +3,7 @@
 <head>
     <title>~$title html~~$cms_title html~</title>
     <meta name="viewport" content="width=device-width, user-scalable=no" />
-    <link rel="stylesheet" href="css.css?m=~css.css mtime~" />
+    <link rel="stylesheet" href="style.css?m=~style.css mtime~" />
     <!--~$meta_description nonempty {~--><meta name="description" content="~$meta_description attr~" /><!--~}~-->
     <!--~$meta_keywords nonempty {~--><meta name="keywords" content="~$meta_keywords attr~" /><!--~}~-->
     <!--~$cms_css~-->
 </head>
 
 <body id="~$basename~_body" class="real_body_tag">
-    <div class="centerer ~$layout_centerer_class~">
 
-        <header id="site_header">
-            <!--~$admin_links {~-->
-                <div id="admin_links">You are logged in as an administrator. &nbsp; <a href="admin_pages?~$edit_page_history_id {~edit_history_id=~$edit_page_history_id~~}~~$edit_page_id {~edit_id=~$edit_page_id~~}~~$edit_page_id unset {~~$edit_page_history_id unset {~&amp;new=1&amp;new_filename=~$basename~~}~~}~">Edit this page</a> &mdash; <a href="admin">Control panel</a> &mdash; <a href="logout">Log out</a></div>
-            <!--~}~-->
+    <!--~$admin_links {~-->
+        <div class="siteAdminHeader">
+            <div id="admin_links">You are logged in as an administrator. &nbsp; <a href="admin_pages?~$edit_page_history_id {~edit_history_id=~$edit_page_history_id~~}~~$edit_page_id {~edit_id=~$edit_page_id~~}~~$edit_page_id unset {~~$edit_page_history_id unset {~&amp;new=1&amp;new_filename=~$basename~~}~~}~">Edit this page</a> &mdash; <a href="admin">Control panel</a> &mdash; <a href="logout">Log out</a></div>
+        </div>
+    <!--~}~-->
+
+    <div class="siteOuter ~siteLayoutClass~">
+
+        <header class="siteHeader">
             <!--~$cms_header~-->
         </header>
-        <!--~$navbar_items once_if {~-->
-            <nav class="nav">
-                <form action="#" method="get">
-                    <label for="mobile_menu_check" id="mobile_menu_button">&#9776; Menu</label>
-                    <input type="checkbox" name="mobile_menu_check" id="mobile_menu_check">
-                    <div>
-                        <ul><!--~$navbar_items {~-->
-                            <li><a href="~filename~">~title html~</a></li><!--~}~-->
-                        </ul>
-                    </div>
-                </form>
-            </nav>
-        <!--~}~-->
 
-        <div class="main">
+        <nav class="siteNav">
+            <form action="#" method="get">
+                <label for="mobile_menu_check" id="mobile_menu_button">&#9776; Menu</label>
+                <input type="checkbox" name="mobile_menu_check" id="mobile_menu_check">
+                <div>
+                    <ul><!--~$navbar_items {~-->
+                        <li><a href="~filename~">~title html~</a></li><!--~}~-->
+                    </ul>
+                </div>
+            </form>
+        </nav>
+
+        <div class="siteContent">
             <!--~$messages once_if {~-->
                 <div id="wfpl_messages">
                     <!--~$messages {~-->
         </div>
 
         <!--~$cms_sidebar {~-->
-            <aside class="sidebar ~$layout_sidebar_class~">
+            <aside class="siteSidebar ~$layout_sidebar_class~">
                 <!--~$cms_sidebar~-->
             </aside>
-
-            <div style="clear: both"></div>
         <!--~}~-->
 
-        <footer id="site_footer">
+        <footer id="siteFooter">
             ~$cms_footer~
         </footer>
     </div>
diff --git a/webpack.config.js b/webpack.config.js
new file mode 100644 (file)
index 0000000..192db4a
--- /dev/null
@@ -0,0 +1,56 @@
+const path = require('path');
+const MiniCssExtractPlugin = require('mini-css-extract-plugin');
+const HtmlWebpackPlugin = require('html-webpack-plugin');
+const postcssPresetEnv = require('postcss-preset-env');
+const postcssGridKiss = require('postcss-grid-kiss');
+const autoprefixer = require('autoprefixer');
+
+const cssDir = path.resolve(__dirname, 'css');
+const outDir = path.resolve(cssDir, 'dist');
+
+module.exports = (env, argv) => ({
+    mode: argv.mode,
+    devtool: argv.mode === 'production' ? 'source-map' : 'inline-source-map',
+    devServer: {
+        host: '0.0.0.0', // so we can export it from docker
+        contentBase: outDir,
+    },
+    plugins: [
+        new MiniCssExtractPlugin(),
+        new HtmlWebpackPlugin({
+            template: path.resolve(cssDir, 'index.html'),
+        }),
+    ],
+    entry: {
+        css: path.resolve(cssDir, 'index.js'),
+    },
+    output: {
+        filename: '[name].js',
+        path: outDir,
+    },
+    module: {
+        rules: [
+            {
+                test: /\.(scss|css)$/i,
+                use: [
+                    MiniCssExtractPlugin.loader,
+                    'css-loader',
+                    //'style-loader',
+                    'sass-loader',
+                    { loader: 'postcss-loader', options: { plugins: () => [
+                        postcssGridKiss({fallback: false}),
+                        autoprefixer({grid: "no-autoplace"}),
+                        postcssPresetEnv(),
+                    ] } },
+                ],
+            },
+        ],
+    },
+    stats: {
+        warningsFilter: [
+            'IE does not support justify-content on grid containers',
+            /IE does not support justify-content on grid containers/,
+            (warning) => !/IE does not support justify-content on grid containers/.test(warning),
+        ],
+    }
+});