From f4ac2a0612f0b9d7800245273fcc6da11ec85d44 Mon Sep 17 00:00:00 2001 From: Zdenek Kedaj Date: Sat, 1 Apr 2023 02:01:38 +0200 Subject: [PATCH] CSS refactor - Extracted generic.css from screen.css Co-Authored-By: Ferdinand Thiessen <1855448+susnux@users.noreply.github.com> --- .github/workflows/ci.yml | 1 + .gitignore | 3 +- assets/css/_index.scss | 11 + assets/css/colors.scss | 28 + assets/css/content.scss | 291 ++++++ assets/css/generic.css | 43 + assets/css/responsiveness.scss | 195 ++++ assets/css/screen.css | 1057 ---------------------- assets/css/theme.scss | 333 +++++++ assets/js/css-vars-ponyfill.min.js | 9 + exampleSite/content/homepage/about-me.md | 4 +- layouts/_default/baseof.html | 6 +- layouts/partials/head.html | 8 +- 13 files changed, 926 insertions(+), 1063 deletions(-) create mode 100644 assets/css/_index.scss create mode 100644 assets/css/colors.scss create mode 100644 assets/css/content.scss create mode 100644 assets/css/generic.css create mode 100644 assets/css/responsiveness.scss delete mode 100644 assets/css/screen.css create mode 100644 assets/css/theme.scss create mode 100644 assets/js/css-vars-ponyfill.min.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef61d45..a5f1d8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,7 @@ jobs: uses: peaceiris/actions-hugo@v2.6.0 with: hugo-version: latest + extended: true - name: Build local ./exampleSite run: hugo --minify --gc --destination ../public --source ./exampleSite --themesDir ../.. --baseURL https://zjedi.github.io/hugo-scroll/ diff --git a/.gitignore b/.gitignore index 643ea68..eeba886 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ public exampleSite/public +exampleSite/resources node_modules -*.lock +*.lock \ No newline at end of file diff --git a/assets/css/_index.scss b/assets/css/_index.scss new file mode 100644 index 0000000..2372ca0 --- /dev/null +++ b/assets/css/_index.scss @@ -0,0 +1,11 @@ +// Color variables +@import "./colors.scss"; + +// Theme layout and base styling +@import "./theme.scss"; + +// Content-related styles +@import "./content.scss"; + +// Media queries for responsiveness +@import "./responsiveness.scss" \ No newline at end of file diff --git a/assets/css/colors.scss b/assets/css/colors.scss new file mode 100644 index 0000000..d4a887b --- /dev/null +++ b/assets/css/colors.scss @@ -0,0 +1,28 @@ +:root { + /** Main text color */ + --color-text-main: #3a4145; + --color-text-lighter: #576161; + /** Text color on the cover image */ + --color-text-cover: #37501a; + /** Text color on odd sections */ + --color-text-alt: white; + + /** Main background color */ + --color-background-main: #f2efe8; + /** color-background : #f2efe8 defined elsewhere,why?*/ + --color-background-darker: #e0ded7; + /** Background color on odd sections*/ + --color-background-alt: #b80135; + + /* Used for Landing screen menu buttons */ + --color-glow: #86c440; + --color-glow-contrast: #37501a; + --color-glow-dark: #37501a; + --color-glow-dark-contrast: white; + + /** Primary color, e.g. for the main buttons */ + --color-primary: #9fd067; + + /** Color to be used for text on primary elements */ + --color-primary-text: black; +} \ No newline at end of file diff --git a/assets/css/content.scss b/assets/css/content.scss new file mode 100644 index 0000000..0a945e1 --- /dev/null +++ b/assets/css/content.scss @@ -0,0 +1,291 @@ +html { + height: 100%; + max-height: 100%; + font-size: 62.5%; + overflow-x: hidden; +} + +body { + height: 100%; + max-height: 100%; + font-family: "Roboto Slab", serif; + font-size: 2rem; + line-height: 1.6em; + color: #3a4145; +} + +::-moz-selection { + color: #222; + background: #d6edff; + text-shadow: none; +} + +::selection { + color: #222; + background: #d6edff; + text-shadow: none; +} + +/** =========== Headings =========== */ +h1,h2,h3,h4,h5,h6 { + text-rendering: optimizeLegibility; + line-height: 1; + margin-top: 0; + margin-bottom: 10px; + font-family: "Open Sans", sans-serif; +} +h3,h4,h5,h6 { + text-rendering: optimizeLegibility; + line-height: 120%; + margin-top: 0; + font-family: "Open Sans", sans-serif; + margin-bottom: 0%; +} + +h1 { + font-size: 5rem; + line-height: 1.2em; + letter-spacing: -2px; + text-indent: -3px; +} + +h2 { + font-size: 4rem; + line-height: 1.2em; + letter-spacing: -1px; + text-indent: -2px; +} + +h3 { + font-size: 3.5rem; +} + +h4 { + font-size: 3rem; +} + +h5 { + font-size: 2.5rem; +} + +h6 { + font-size: 2rem; +} + +p,{ + margin: 1em 0; +} + +/** ======== Links ========= */ +a { + color: inherit; + transition: all ease 0.3s; + -webkit-transition: all ease 0.3s; + -moz-transition: all ease 0.3s; + + &:hover { + color: var(--color-primary); + } + + // Fix font awesome icons + &.fa { + text-decoration: none; + } +} + +/** ======== Lists ====================== */ +dl { + margin: 1.6em 0; + + dt { + float: left; + width: 180px; + overflow: hidden; + clear: left; + text-align: right; + text-overflow: ellipsis; + white-space: nowrap; + font-weight: bold; + margin-bottom: 1em; + } + + dd { + margin-left: 200px; + margin-bottom: 1em; + } +} + +ul, ol { + margin: 1em 0; + + // Second level of lists + ol, ul { + margin: 0.4em 0; + } +} + +li { + margin-left: 30px; +} + +/** ======== Content semantics ============= */ +hr { + display: block; + height: 1px; + border: 0; + border-top: 1px solid var(--color-text); + margin: 1.5em 0; + padding: 0; +} + +/** Helper to be inserted by JS before quotations +//TODO is this used anywhere?*/ +.quo { + margin-right: 10px; + margin-left: 10px; + font-size: 20px; +} + +blockquote { + -moz-box-sizing: border-box; + box-sizing: border-box; + margin: 1em 0 1em -2.2em; + padding: 0 0 0 1em; + font-weight: lighter; + + p { + margin: 0.8em 0; + } + + small { + display: inline-block; + margin: 0.8em 0 0.8em 1.5em; + font-size: 0.9em; + color: #ccc; + + &:before { + content: "\2014 \00A0"; + } + } + + cite { + font-weight: bold; + + a { + font-weight: normal; + } + } +} + +mark { + background-color: var(--color-primary); + filter: brightness(125%); +} + +code, tt { + color: var(--color-text-lighter); + background-color: var(--color-background-darker); + border-radius: 3px; + font-family: Inconsolata, monospace, sans-serif; + font-size: 0.75em; + padding: 3px 5px; +} + +code { + color: var(--color-text-lighter); + background-color: var(--color-background-darker); + border-radius: 3px; + font-family: Inconsolata, monospace, sans-serif; + font-size: 0.75em; + padding: 3px 5px; +} + +pre { + background: #3a4145; + color: #e2e2e2; + border: 1px solid #343434; + border-radius: 3px; + box-sizing: border-box; + -moz-box-sizing: border-box; + font-family: Inconsolata, monospace, sans-serif; + font-size: 0.9em; + margin: 1.6em 0; + padding: 10px; + white-space: pre; + overflow-x: scroll; + width: 100%; + + code, tt { + color: inherit; + background: transparent; + font-size: inherit; + white-space: -moz-pre-wrap; + white-space: pre-wrap; + border: none; + padding: 0; + } +} + +kbd { + color: var(--color-text-main); + background: var(--color-background-darker); + border: var(--color-text-lighter) 1px solid; + border-radius: 4px; + display: inline-block; + font-size: 0.9em; + font-weight: bold; + margin-bottom: 0.4em; + padding: 1px 8px; + text-shadow: #fff 0 1px 0; + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 1px 0 0 #fff inset; +} + +/** ======== Tables ========= */ +table { + -moz-box-sizing: border-box; + box-sizing: border-box; + border-spacing: 0; + margin: 1.6em 0; + width: 100%; + max-width: 100%; + background-color: transparent; + + th, + td { + padding: 8px; + line-height: 20px; + text-align: left; + vertical-align: top; + } + + thead { + th, + td { + border-bottom: 1px solid var(--color-text); + } + } + + tbody>tr:nth-child(even) { + background-color: #fff5; + background-blend-mode: lighten; + } + + &.plain tbody>tr:nth-child(odd)>td, + &.plain tbody>tr:nth-child(odd)>th { + background: transparent; + } +} + +/** ======== Github integration ========= */ +.gist { + table { + margin: 0; + font-size: 1.4rem; + } + + .line-number { + min-width: 25px; + font-size: 1.1rem; + } +} + diff --git a/assets/css/generic.css b/assets/css/generic.css new file mode 100644 index 0000000..9b13e04 --- /dev/null +++ b/assets/css/generic.css @@ -0,0 +1,43 @@ +/* Utilities - These things get used a lot */ + +/** + Hides stuff + */ +.hidden { + text-indent: -9999px; + visibility: hidden; + display: none; +} + +/** + Creates a responsive wrapper that makes our content scale nicely + */ +.inner { + position: relative; + width: 80%; + max-width: 800px; + margin: 0 auto; +} + +/** + Centres vertically yo. (IE8+) + */ +.vertical { + display: table-cell; + vertical-align: middle; +} + +/** + Floating tools + */ +.left { + float: left; +} + +.right { + float: right; +} + +.clear { + clear: both; +} \ No newline at end of file diff --git a/assets/css/responsiveness.scss b/assets/css/responsiveness.scss new file mode 100644 index 0000000..e764272 --- /dev/null +++ b/assets/css/responsiveness.scss @@ -0,0 +1,195 @@ + +/* ========================================================================== + 8. Media Queries - Smaller than 1130px + ========================================================================== */ + +@media only screen and (max-width: 1130px) { + .fixed-nav { + opacity: 1; + position: fixed; + top: 0px; + left: 0px; + z-index: 99999; + background: var(--color-background); + width: 100%; + text-align: center; + padding: 4px; + } + + a.fn-item { + display: inline; + margin-left: 10px; + } + + blockquote { + margin-left: 0; + } + + .post-holder { + padding-top: 20px; + } + + #site-head { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + min-height: 240px; + padding: 15% 0; + height: 100%; + margin-bottom: 0rem; + } + + .blog-title { + font-size: 4rem; + letter-spacing: -1px; + } + + .blog-description { + font-size: 2.2rem; + line-height: 1.5em; + } + + .post { + font-size: 0.9em; + line-height: 1.6em; + } + + .post-template .post { + padding-bottom: 1rem; + } + + .post-template .post-header { + padding: 40px 0; + } + + h1 { + font-size: 4.8rem; + text-indent: -2px; + } + + h2 { + font-size: 3.8rem; + } + + h3 { + font-size: 3.3rem; + } + + h4 { + font-size: 2.8rem; + } +} + +/* ========================================================================== + 9. Media Queries - Smaller than 500px + ========================================================================== */ + +@media only screen and (max-width: 500px) { + .fixed-nav { + display: none; + } + .post-holder { + padding-top: 20px; + } + + #blog-logo img{ + max-height: 80px; + } + + .inner, + .pagination { + width: auto; + margin-left: 16px; + margin-right: 16px; + } + + .post { + width: auto; + margin-left: 16px; + margin-right: 16px; + font-size: 0.8em; + line-height: 1.6em; + } + + #site-head { + padding: 10% 0; + height: 65%; + } + + #header-arrow { + display: none; + } + + a.btn { + margin-top: 10px; + } + + .blog-title { + font-size: 3rem; + } + + .blog-description { + font-size: 2.2rem; + } + + h1, + h2 { + font-size: 3rem; + line-height: 1.1em; + letter-spacing: -1px; + } + + h3 { + font-size: 2.8rem; + } + + h4 { + font-size: 2.3rem; + } + + .post-template .post { + padding-bottom: 0; + } + + .post-template .post-header { + padding: 30px 0; + } +/* + .post-meta { + font-size: 1.3rem; + } + + .post-footer { + padding: 4rem 0; + text-align: center; + } + + .post-footer .author { + margin: 0 0 2rem 0; + padding: 0 0 1.6rem 0; + border-bottom: #ebf2f6 1px dashed; + } + + .post-footer .share { + position: static; + width: auto; + } + + .post-footer .share a { + margin: 1.4rem 0.8rem 0 0.8rem; + } + + .older-posts, + .newer-posts { + position: static; + margin: 10px 0; + } + + .page-number { + display: block; + } +*/ + .site-footer { + font-size: 1.1rem; + } +} \ No newline at end of file diff --git a/assets/css/screen.css b/assets/css/screen.css deleted file mode 100644 index f3a3b4b..0000000 --- a/assets/css/screen.css +++ /dev/null @@ -1,1057 +0,0 @@ -/* ========================================================================== - Table of Contents - ========================================================================== */ - -/* - - 0. Includes - 1. General - 2. Utilities - 3. General - 4. Single Post - 5. Third Party Elements - 6. Pagination - 7. Footer - 8. Media Queries (Tablet) - 9. Media Queries (Mobile) - - */ - -/* ========================================================================== - 0. Includes - Ground zero - ========================================================================== */ - -@import url(normalize.css); - -/* ========================================================================== - 1. General - Setting up some base styles - ========================================================================== */ - -html { - height: 100%; - max-height: 100%; - font-size: 62.5%; - overflow-x: hidden; -} - -body { - height: 100%; - max-height: 100%; - /*font-family: 'Droid Serif', serif;*/ - font-family: "Roboto Slab", serif; - font-size: 2rem; - line-height: 1.6em; - color: #3a4145; -} -a.fa { - text-decoration: none; -} -::-moz-selection { - color: #222; - background: #d6edff; - text-shadow: none; -} - -::selection { - color: #222; - background: #d6edff; - text-shadow: none; -} -.left { - float: left; -} -.right { - float: right; -} -.clear { - clear: both; -} -h1, -h2, -h3, -h4, -h5, -h6 { - text-rendering: optimizeLegibility; - line-height: 1; - margin-top: 0; - margin-bottom: 10px; - font-family: "Open Sans", sans-serif; -} -h3, -h4, -h5, -h6 { - text-rendering: optimizeLegibility; - line-height: 120%; - margin-top: 0; - font-family: "Open Sans", sans-serif; - margin-bottom: 0%; -} - -h1 { - font-size: 5rem; - line-height: 1.2em; - letter-spacing: -2px; - text-indent: -3px; -} - -h2 { - font-size: 4rem; - line-height: 1.2em; - letter-spacing: -1px; - text-indent: -2px; -} - -h3 { - font-size: 3.5rem; -} - -h4 { - font-size: 3rem; -} - -h5 { - font-size: 2.5rem; -} - -h6 { - font-size: 2rem; -} - -a { - color: inherit; - transition: all ease 0.3s; - -webkit-transition: all ease 0.3s; - -moz-transition: all ease 0.3s; -} - -a:hover { - color: #86c440; -} - -a.btn { - text-decoration: none; - background-color: #86c440; - border-radius: 6px; - -webkit-border-radius: 6px; - color: white; - display: inline-block; - font-size: 16px; - letter-spacing: 1px; - margin: 0; - overflow: visible; - padding: 10px 20px 10px 20px; - position: relative; - margin-top: 2rem; - cursor: pointer; - font-family: "Oswald", sans-serif; - text-transform: uppercase; - font-weight: lighter; -} - -a.btn:hover { - background: #37501a; -} - -#header-arrow { - font-size: 140px; - margin: -10px auto; - text-align: center; - position: absolute; - width: 100%; - left: 0; - bottom: -120px; - cursor: pointer; - opacity: 0.6; - transition: all ease 0.3s; - -webkit-transition: all ease 0.3s; - -moz-transition: all ease 0.3s; -} -#header-arrow:hover { - opacity: 0.9; -} - -h1 a, -h2 a, -h3 a, -h4 a, -h5 a, -h6 a { - /*color: #50585D;*/ -} - -p, -ul, -ol { - margin: 1em 0; -} - -ol ol, -ul ul, -ul ol, -ol ul { - margin: 0.4em 0; -} - -hr { - display: block; - height: 1px; - border: 0; - border-top: 1px solid #efefef; - margin: 3.2em 0; - padding: 0; -} - -blockquote { - -moz-box-sizing: border-box; - box-sizing: border-box; - margin: 1em 0 1em -2.2em; - padding: 0 0 0 1em; - /*border-left: #4a4a4a 0.4em solid;*/ - font-weight: lighter; -} - -blockquote p { - margin: 0.8em 0; -} -.quo { - /*float: left;*/ - margin-right: 10px; - margin-left: 10px; - font-size: 20px; -} - -blockquote small { - display: inline-block; - margin: 0.8em 0 0.8em 1.5em; - font-size: 0.9em; - color: #ccc; -} - -blockquote small:before { - content: "\2014 \00A0"; -} - -blockquote cite { - font-weight: bold; -} - -blockquote cite a { - font-weight: normal; -} - -dl { - margin: 1.6em 0; -} - -dl dt { - float: left; - width: 180px; - overflow: hidden; - clear: left; - text-align: right; - text-overflow: ellipsis; - white-space: nowrap; - font-weight: bold; - margin-bottom: 1em; -} - -dl dd { - margin-left: 200px; - margin-bottom: 1em; -} - -mark { - background-color: #ffc336; -} - -code, -tt { - padding: 3px 5px; - font-family: Inconsolata, monospace, sans-serif; - font-size: 0.75em; - /*white-space: pre;*/ - border: 1px solid #e3edf3; - background: #f7fafb; - border-radius: 2px; - color: #3a4145; -} - -pre { - -moz-box-sizing: border-box; - box-sizing: border-box; - margin: 1.6em 0; - border: 1px solid #e3edf3; - width: 100%; - padding: 10px; - font-family: Inconsolata, monospace, sans-serif; - font-size: 0.9em; - white-space: pre; - overflow: auto; - background: #f7fafb; - border-radius: 3px; -} - -pre code, -tt { - font-size: inherit; - white-space: -moz-pre-wrap; - white-space: pre-wrap; - background: transparent; - border: none; - padding: 0; -} - -kbd { - display: inline-block; - margin-bottom: 0.4em; - padding: 1px 8px; - border: #ccc 1px solid; - color: #666; - text-shadow: #fff 0 1px 0; - font-size: 0.9em; - font-weight: bold; - background: #f4f4f4; - border-radius: 4px; - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 1px 0 0 #fff inset; -} - -table { - -moz-box-sizing: border-box; - box-sizing: border-box; - margin: 1.6em 0; - width: 100%; - max-width: 100%; - background-color: transparent; -} - -table th, -table td { - padding: 8px; - line-height: 20px; - text-align: left; - vertical-align: top; - border-top: 1px solid #efefef; -} - -table th { - color: #000; -} - -table caption + thead tr:first-child th, -table caption + thead tr:first-child td, -table colgroup + thead tr:first-child th, -table colgroup + thead tr:first-child td, -table thead:first-child tr:first-child th, -table thead:first-child tr:first-child td { - border-top: 0; -} - -table tbody + tbody { - border-top: 2px solid #efefef; -} - -table table table { - background-color: #fff; -} - -table tbody > tr:nth-child(odd) > td, -table tbody > tr:nth-child(odd) > th { - background-color: #f6f6f6; -} - -table.plain tbody > tr:nth-child(odd) > td, -table.plain tbody > tr:nth-child(odd) > th { - background: transparent; -} - -li { - margin-left: 30px; -} - -/* ========================================================================== - 2. Utilities - These things get used a lot - ========================================================================== */ - -/* Hides shit */ -.hidden { - text-indent: -9999px; - visibility: hidden; - display: none; -} - -/* Creates a responsive wrapper that makes our content scale nicely */ -.inner { - position: relative; - width: 80%; - max-width: 700px; - margin: 0 auto; -} - -/* Centres vertically yo. (IE8+) */ -.vertical { - display: table-cell; - vertical-align: middle; -} - -/* ========================================================================== - 3. General - The main styles for the the theme - ========================================================================== */ - -/* Big cover image on the home page */ -#site-head { - position: relative; - display: table; - width: 100%; - height: 100%; - margin-bottom: 0rem; - text-align: center; - color: #fff; - background: #b80135 no-repeat center center; - background-size: cover; -} - -#site-head:after { -} - -/* Yo-logo. Yolo-go. Upload one in ghost/settings/ */ -#blog-logo { - display: block; - max-height: 100px; - width: auto; - margin: 0 auto; - line-height: 0; -} - -#back { - color: rgba(0, 0, 0, 0.2); - position: fixed; - top: 8px; - left: 8px; - padding: 6px; - font-size: 16px; -} - -.title-and-description-guard { - margin: auto; - padding: 0.5em; - background-color: rgb(255 255 255 / 60%); - border-radius: 25px; - width: fit-content; -} - -.blog-title { - color: #37501a; - margin: 10px 0 10px 0; - font-size: 5rem; - letter-spacing: -1px; - text-shadow: white 0px 0px 7px; -} - -.blog-description { - color: #37501a; - margin: 0; - font-size: 2.5rem; - line-height: 1.5em; - font-weight: 400; - font-family: "Roboto Slab", serif; - letter-spacing: 0; - text-shadow: white 0px 0px 7px; -} - -.post-holder { - width: 100%; - height: 100%; - background: #f2efe8; - position: relative; -} -.post-holder.dark { - background: #b80135; - color: white; -} - -/* Every post, on every page, gets this style on its
tag */ -.post { - position: relative; - width: 80%; - max-width: 700px; - margin: 0rem auto; - padding-bottom: 4rem; - padding-top: 4rem; - height: 70%; - word-break: break-word; - hyphens: auto; -} - -/* Add a little circle in the middle of the border-bottom on our .post - just for the lolz and stylepoints. */ - -.fixed-nav { - display: none; - opacity: 1; - position: fixed; - top: 40px; - left: 2%; - z-index: 99999; - font-family: "Open Sans Condensed", sans-serif; - text-transform: uppercase; - font-size: 1.5rem; - line-height: 130%; - font-weight: bold; -} -a.fn-item { - display: block; - cursor: pointer; - opacity: 0.7; -} -.white { - color: white; -} -a.fn-item:hover { - color: #9fd067; -} -a.fn-item.active { - color: #86c440; - opacity: 1; -} - -.post-after { - position: absolute; - bottom: -40px; - right: 6%; - z-index: 1; - width: 0; - height: 0; - border-left: 60px solid transparent; - border-right: 60px solid transparent; - border-top: 50px solid #f2efe8; - border-radius: 25px; -} -.post-after.light { - left: 6%; -} - -.post-title { - margin: 0; -} - -.post-title a { - text-decoration: none; -} - -.post-excerpt p { - margin: 1.6rem 0 0 0; - font-size: 0.9em; - line-height: 1.6em; -} - -.post-meta { - display: inline-block; - margin: 0 0 5px 0; - font-family: "Open Sans", sans-serif; - font-size: 1.5rem; - color: #9eabb3; -} - -.post-meta a { - color: #9eabb3; - text-decoration: none; -} - -.post-meta a:hover { - text-decoration: underline; -} - -.user-meta { - position: relative; - padding: 0.3rem 40px 0 100px; - min-height: 77px; -} - -.user-image { - position: absolute; - top: 0; - left: 0; -} - -.user-name { - display: block; - font-weight: bold; -} - -.user-bio { - display: block; - max-width: 440px; - font-size: 1.4rem; - line-height: 1.5em; -} - -.publish-meta { - position: absolute; - top: 0; - right: 0; - padding: 4.3rem 0 4rem 0; - text-align: right; -} - -.publish-heading { - display: block; - font-weight: bold; -} - -.publish-date { - display: block; - font-size: 1.4rem; - line-height: 1.5em; -} - -/* ========================================================================== - 4. Single Post - When you click on an individual post - ========================================================================== */ - -/* Tweak the .post wrapper style */ -.post-template .post { - margin-top: 0; - border-bottom: none; - padding-bottom: 0; -} - -/* Kill that stylish little circle that was on the border, too */ -.post-template .post:after { - display: none; -} - -/* Insert some mad padding up in the header for better spacing */ -.post-template .post-header { - padding: 60px 0; -} - -/* Keep large images within the bounds of the post-width */ -.post-content img { - display: block; - max-width: 100%; - margin: 0 auto; -} - -/* The author credit area after the post */ -.post-footer { - position: relative; - margin: 4rem 0 0 0; - padding: 4rem 0 0 0; - border-top: #ebf2f6 1px solid; -} - -.post-footer h4 { - font-size: 1.8rem; - margin: 0; -} - -.post-footer p { - margin: 1rem 0; - font-size: 1.4rem; - line-height: 1.6em; -} - -/* Create some space to the right for the share links */ -.post-footer .author { - margin-right: 180px; -} - -/* Drop the share links in the space to the right. - Doing it like this means it's easier for the author bio - to be flexible at smaller screen sizes while the share - links remain at a fixed width the whole time */ -.post-footer .share { - position: absolute; - top: 4rem; - right: 0; - width: 140px; -} - -.post-footer .share a { - font-size: 1.8rem; - display: inline-block; - margin: 1.4rem 1.6rem 1.6rem 0; - color: #bbc7cc; -} - -.post-footer .share a:hover { - color: #50585d; -} - -/* ========================================================================== - 5. Third Party Elements - Embeds from other services - ========================================================================== */ - -/* Github */ - -.gist table { - margin: 0; - font-size: 1.4rem; -} - -.gist .line-number { - min-width: 25px; - font-size: 1.1rem; -} - -/* ========================================================================== - 6. Pagination - Tools to let you flick between pages - ========================================================================== */ - -/* The main wrapper for our pagination links */ -.pagination { - position: relative; - width: 80%; - max-width: 700px; - margin: 4rem auto; - font-family: "Open Sans", sans-serif; - font-size: 1.3rem; - color: #9eabb3; - text-align: center; -} - -.pagination a { - color: #9eabb3; -} - -/* Push the previous/next links out to the left/right */ -.older-posts, -.newer-posts { - position: absolute; - display: inline-block; - padding: 0 15px; - border: #ebf2f6 2px solid; - text-decoration: none; - border-radius: 30px; - transition: border ease 0.3s; -} - -.older-posts { - right: 0; -} - -.page-number { - display: inline-block; - padding: 2px 0; -} - -.newer-posts { - left: 0; -} - -.older-posts:hover, -.newer-posts:hover { - border-color: #9eabb3; -} - -/* ========================================================================== - 7. Footer - The bottom of every page - ========================================================================== */ - -.site-footer { - position: relative; - margin: 0rem 0 0 0; - padding: 1rem 0; - font-family: "Open Sans", sans-serif; - font-size: 1.3rem; - line-height: 1.5em; - color: #bbc7cc; - text-align: center; - background: #22343a; -} - -.site-footer a { - color: #bbc7cc; - text-decoration: underline; -} - -.site-footer a:hover { - color: #50585d; -} - -.poweredby .i-ghost { - font-weight: 700; - text-decoration: none; -} - -.poweredby .i-ghost:hover { - text-decoration: none; -} - -.poweredby .i-ghost:before { - font-size: 1rem; - margin-right: 0.2em; -} - -/* The subscribe icon on the footer */ -.subscribe { - width: 28px; - height: 28px; - position: absolute; - top: -14px; - left: 50%; - margin-left: -15px; - border: #ebf2f6 1px solid; - text-align: center; - line-height: 2.4rem; - border-radius: 50px; - background: #fff; - transition: box-shadow 0.5s; -} - -/* The RSS icon, inserted via icon font */ -.subscribe:before { - color: #d2dee3; - font-size: 10px; - position: absolute; - top: 2px; - left: 9px; - font-weight: bold; - transition: color 0.5s ease; -} - -/* Add a box shadow to on hover */ -.subscribe:hover { - box-shadow: rgba(0, 0, 0, 0.05) 0 0 0 3px; - transition: box-shadow 0.25s; -} - -.subscribe:hover:before { - color: #50585d; -} - -/* CSS tooltip saying "Subscribe!" - initially hidden */ -.tooltip { - opacity: 0; - display: inline-block; - padding: 4px 8px 5px 8px; - position: absolute; - top: -23px; - left: -23px; - color: rgba(255, 255, 255, 0.9); - font-size: 1.1rem; - font-weight: bold; - line-height: 1em; - text-align: center; - background: #50585d; - border-radius: 20px; - box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); - transition: opacity 0.3s ease, top 0.3s ease; -} - -/* The little chiclet arrow under the tooltip, pointing down */ -.tooltip:after { - content: ""; - border-width: 5px 5px 0 5px; - border-style: solid; - border-color: #50585d transparent; - display: block; - position: absolute; - bottom: -4px; - left: 50%; - margin-left: -5px; - z-index: 220; - width: 0; -} - -/* On hover, show the tooltip! */ -.subscribe:hover .tooltip { - opacity: 1; - top: -33px; -} - -/* ========================================================================== - 8. Media Queries - Smaller than 1130px - ========================================================================== */ - -@media only screen and (max-width: 1130px) { - .fixed-nav { - opacity: 1; - position: fixed; - top: 0px; - left: 0px; - z-index: 99999; - background: #f2efe8; - width: 100%; - text-align: center; - padding: 4px; - } - a.fn-item { - display: inline; - margin-left: 10px; - } - blockquote { - margin-left: 0; - } - .post-holder { - padding-top: 20px; - } - #site-head { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - min-height: 240px; - padding: 15% 0; - height: 100%; - margin-bottom: 0rem; - } - - .blog-title { - font-size: 4rem; - letter-spacing: -1px; - } - - .blog-description { - font-size: 2.2rem; - line-height: 1.5em; - } - - .post { - font-size: 0.9em; - line-height: 1.6em; - } - - .post-template .post { - padding-bottom: 1rem; - } - - .post-template .post-header { - padding: 40px 0; - } - - h1 { - font-size: 4.8rem; - text-indent: -2px; - } - - h2 { - font-size: 3.8rem; - } - - h3 { - font-size: 3.3rem; - } - - h4 { - font-size: 2.8rem; - } -} - -/* ========================================================================== - 9. Media Queries - Smaller than 500px - ========================================================================== */ - -@media only screen and (max-width: 500px) { - .fixed-nav { - display: none; - } - .post-holder { - padding-top: 20px; - } - #blog-logo { - max-height: 80px; - } - - .inner, - .pagination { - width: auto; - margin-left: 16px; - margin-right: 16px; - } - - .post { - width: auto; - margin-left: 16px; - margin-right: 16px; - font-size: 0.8em; - line-height: 1.6em; - } - - #site-head { - padding: 10% 0; - height: 65%; - } - #header-arrow { - display: none; - } - a.btn { - margin-top: 10px; - } - - .blog-title { - font-size: 3rem; - } - - .blog-description { - font-size: 2.2rem; - } - - h1, - h2 { - font-size: 3rem; - line-height: 1.1em; - letter-spacing: -1px; - } - - h3 { - font-size: 2.8rem; - } - - h4 { - font-size: 2.3rem; - } - - .post-template .post { - padding-bottom: 0; - } - - .post-template .post-header { - padding: 30px 0; - } - - .post-meta { - font-size: 1.3rem; - } - - .post-footer { - padding: 4rem 0; - text-align: center; - } - - .post-footer .author { - margin: 0 0 2rem 0; - padding: 0 0 1.6rem 0; - border-bottom: #ebf2f6 1px dashed; - } - - .post-footer .share { - position: static; - width: auto; - } - - .post-footer .share a { - margin: 1.4rem 0.8rem 0 0.8rem; - } - - .older-posts, - .newer-posts { - position: static; - margin: 10px 0; - } - - .page-number { - display: block; - } - - .site-footer { - /*margin-top: 0.8rem;*/ - font-size: 1.1rem; - } -} - -/* ========================================================================== - End of file. Media queries should be the last thing here. Do not add stuff - below this point, or it will probably fuck everything up. - ========================================================================== */ diff --git a/assets/css/theme.scss b/assets/css/theme.scss new file mode 100644 index 0000000..d38b7b2 --- /dev/null +++ b/assets/css/theme.scss @@ -0,0 +1,333 @@ +body { + --color-text: var(--color-text-main); + --color-background: var(--color-background-main); +} + +.post-holder { + width: 100%; + height: 100%; + background-color: var(--color-background); + color: var(--color-text); + position: relative; + + &.dark { + // override variables for alternative style + --color-text: var(--color-text-alt); + --color-background: var(--color-background-alt); + + background-color: var(--color-background-alt); + color: var(--color-text-alt); + + // Fix
color + hr { + border-color: var(--color-text-alt); + } + + // On alt posts move the triangle to the right and match the background the color + .post-after { + left: unset; + right: 6%; + border-top-color: var(--color-background-alt); + } + } + + /** + The tri-angular parts between posts + */ + .post-after { + position: absolute; + bottom: -40px; + z-index: 1; + left: 6%; + width: 0; + height: 0; + border-left: 60px solid transparent; + border-right: 60px solid transparent; + border-top: 50px solid var(--color-background); + border-radius: 25px; + } +} + +#blog-logo { + display: block; + max-height: 100px; + width: auto; + margin: 0 auto; + line-height: 0; +} + +/* Big cover image on the home page */ +#site-head { + position: relative; + display: table; + width: 100%; + height: 100%; + margin-bottom: 0rem; + text-align: center; + color: var(--color-text-cover); + background: var(--color-background-alt) no-repeat center center; + background-size: cover; + + .title-and-description-guard { + margin: auto; + padding: 0.6em; + background-color: rgba(255, 255, 255, 0.6); + border-radius: 25px; + width: fit-content; + } + + .blog-title { + margin: 10px 0 10px 0; + font-size: 5rem; + letter-spacing: -1px; + text-shadow: white 0px 0px 7px; + } + + .blog-description { + margin: 0; + font-size: 2.5rem; + line-height: 1.5em; + font-weight: 400; + font-family: "Roboto Slab", serif; + letter-spacing: 0; + text-shadow: white 0px 0px 7px; + } + + // Landing screen menu + a.btn { + text-decoration: none; + background-color: var(--color-glow); + color: var(--color-glow-contrast); + border-radius: 6px; + -webkit-border-radius: 6px; + display: inline-block; + font-size: 16px; + letter-spacing: 1px; + margin: 0; + overflow: visible; + padding: 10px 20px 10px 20px; + position: relative; + margin-top: 2rem; + cursor: pointer; + font-family: "Oswald", sans-serif; + text-transform: uppercase; + font-weight: lighter; + + &:hover { + color: var(--color-glow-dark-contrast);; + background-color: var(--color-glow-dark); + } + } + + /** The arrow button to scroll to content */ + #header-arrow { + font-size: 140px; + margin: -10px auto; + text-align: center; + position: absolute; + width: 100%; + left: 0; + bottom: -120px; + cursor: pointer; + opacity: 0.6; + transition: all ease 0.3s; + -webkit-transition: all ease 0.3s; + -moz-transition: all ease 0.3s; + + &:hover { + opacity: 0.9; + } + } +} + +/** For single pages and 404 error page the "back" button */ +#back { + color: rgba(0, 0, 0, 0.2); + position: fixed; + top: 8px; + left: 8px; + padding: 6px; + font-size: 16px; +} + +/** ========== Site footer ============ */ +.site-footer { + /*TODO extract footer colors to variables*/ + background: #22343a; + color: #bbc7cc; + font-family: "Open Sans", sans-serif; + font-size: 1.3rem; + position: relative; + margin: 0rem 0 0 0; + padding: 1rem 0; + + line-height: 1.5em; + text-align: center; +} + +.site-footer a { + color: #bbc7cc; + text-decoration: underline; +} + +.site-footer a:hover { + color: var(--color-primary); +} + +/** + Every post, on every page, gets this style on its
tag + Not inside the post holder as this also applies for single pages +*/ +.post { + position: relative; + width: 80%; + max-width: 700px; + margin: 0rem auto; + padding-bottom: 4rem; + padding-top: 4rem; + height: 70%; + word-break: break-word; + hyphens: auto; +} + +.fixed-nav { + display: none; + opacity: 1; + position: fixed; + top: 40px; + left: 2%; + z-index: 99999; + font-family: "Open Sans Condensed", sans-serif; + text-transform: uppercase; + font-size: 1.5rem; + line-height: 130%; + font-weight: bold; +} + +// Navigation items +a.fn-item { + display: block; + cursor: pointer; + opacity: 0.7; + text-decoration: none; + + &:hover, + &.active { + color: var(--color-primary); + } + + &.active { + opacity: 1; + } +} + +.post-title { + margin: 0; + + a { + text-decoration: none; + } +} + +/* UNUSED STYLES +.post-after { + position: absolute; + bottom: -40px; + right: 6%; + z-index: 1; + width: 0; + height: 0; + border-left: 60px solid transparent; + border-right: 60px solid transparent; + border-top: 50px solid #f2efe8; + border-radius: 25px; +} +.post-after.light { + left: 6%; +} + +.post-excerpt p { + margin: 1.6rem 0 0 0; + font-size: 0.9em; + line-height: 1.6em; +} + +.post-meta { + display: inline-block; + margin: 0 0 5px 0; + font-family: "Open Sans", sans-serif; + font-size: 1.5rem; + color: #9eabb3; +} + +.post-meta a { + color: #9eabb3; + text-decoration: none; +} + +.post-meta a:hover { + text-decoration: underline; +} +*/ + +/* ======= Single pages =========== */ +.post-template { + + // Tweak the .post wrapper style + .post { + margin-top: 0; + border-bottom: none; + padding-bottom: 0; + } + + // Kill that stylish little circle that was on the border + .post:after { + display: none; + } + + // Insert some mad padding up in the header for better spacing + .post-header { + padding: 60px 0; + } +} + +// Keep large images within the bounds of the post-width +.post-content img { + display: block; + max-width: 100%; + margin: 0 auto; +} + +/* CSS tooltip saying "Subscribe!" - initially hidden */ +.tooltip { + opacity: 0; + display: inline-block; + padding: 4px 8px 5px 8px; + position: absolute; + top: -23px; + left: -23px; + color: rgba(255, 255, 255, 0.9); + font-size: 1.1rem; + font-weight: bold; + line-height: 1em; + text-align: center; + background: #50585d; + border-radius: 20px; + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); + transition: opacity 0.3s ease, top 0.3s ease; +} + +/* The little chiclet arrow under the tooltip, pointing down */ +.tooltip:after { + content: ""; + border-width: 5px 5px 0 5px; + border-style: solid; + border-color: #50585d transparent; + display: block; + position: absolute; + bottom: -4px; + left: 50%; + margin-left: -5px; + z-index: 220; + width: 0; +} \ No newline at end of file diff --git a/assets/js/css-vars-ponyfill.min.js b/assets/js/css-vars-ponyfill.min.js new file mode 100644 index 0000000..17740e3 --- /dev/null +++ b/assets/js/css-vars-ponyfill.min.js @@ -0,0 +1,9 @@ +/*! + * css-vars-ponyfill + * v2.4.8 + * https://jhildenbiddle.github.io/css-vars-ponyfill/ + * (c) 2018-2022 John Hildenbiddle + * MIT license + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).cssVars=t()}(this,(function(){"use strict";function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},r={mimeType:t.mimeType||null,onBeforeSend:t.onBeforeSend||Function.prototype,onSuccess:t.onSuccess||Function.prototype,onError:t.onError||Function.prototype,onComplete:t.onComplete||Function.prototype},n=Array.isArray(e)?e:[e],o=Array.apply(null,Array(n.length)).map((function(e){return null}));function s(e){var t="string"==typeof e,r=t&&"<"===e.trim().charAt(0);return t&&!r}function a(e,t){r.onError(e,n[t],t)}function c(e,t){var s=r.onSuccess(e,n[t],t);e=!1===s?"":s||e,o[t]=e,-1===o.indexOf(null)&&r.onComplete(o)}var i=document.createElement("a");n.forEach((function(e,t){if(i.setAttribute("href",e),i.href=String(i.href),Boolean(document.all&&!window.atob)&&i.host.split(":")[0]!==location.host.split(":")[0]){if(i.protocol===location.protocol){var n=new XDomainRequest;n.open("GET",e),n.timeout=0,n.onprogress=Function.prototype,n.ontimeout=Function.prototype,n.onload=function(){var e=n.responseText;s(e)?c(e,t):a(n,t)},n.onerror=function(e){a(n,t)},setTimeout((function(){n.send()}),0)}else console.warn("Internet Explorer 9 Cross-Origin (CORS) requests must use the same protocol (".concat(e,")")),a(null,t)}else{var o=new XMLHttpRequest;o.open("GET",e),r.mimeType&&o.overrideMimeType&&o.overrideMimeType(r.mimeType),r.onBeforeSend(o,e,t),o.onreadystatechange=function(){if(4===o.readyState){var e=o.responseText;o.status<400&&s(e)||0===o.status&&s(e)?c(e,t):a(o,t)}},o.send()}}))}function r(e){var r=/\/\*[\s\S]+?\*\//g,o=/(?:@import\s*)(?:url\(\s*)?(?:['"])([^'"]*)(?:['"])(?:\s*\))?(?:[^;]*;)/g,s={rootElement:e.rootElement||document,include:e.include||'style,link[rel="stylesheet"]',exclude:e.exclude||null,filter:e.filter||null,skipDisabled:!1!==e.skipDisabled,useCSSOM:e.useCSSOM||!1,onBeforeSend:e.onBeforeSend||Function.prototype,onSuccess:e.onSuccess||Function.prototype,onError:e.onError||Function.prototype,onComplete:e.onComplete||Function.prototype},a=Array.apply(null,s.rootElement.querySelectorAll(s.include)).filter((function(e){return t=e,r=s.exclude,!(t.matches||t.matchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector).call(t,r);var t,r})),c=Array.apply(null,Array(a.length)).map((function(e){return null}));function i(){if(-1===c.indexOf(null)){c.reduce((function(e,t,r){return""===t&&e.push(r),e}),[]).reverse().forEach((function(e){return[a,c].forEach((function(t){return t.splice(e,1)}))}));var e=c.join("");s.onComplete(e,c,a)}}function u(e,t,r,n){var o=s.onSuccess(e,r,n);f(e=void 0!==o&&!1===Boolean(o)?"":o||e,r,n,(function(e,n){null===c[t]&&(n.forEach((function(e){return s.onError(e.xhr,r,e.url)})),!s.filter||s.filter.test(e)?c[t]=e:c[t]="",i())}))}function l(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a={};return a.rules=(e.replace(r,"").match(o)||[]).filter((function(e){return-1===s.indexOf(e)})),a.urls=a.rules.map((function(e){return e.replace(o,"$1")})),a.absoluteUrls=a.urls.map((function(e){return n(e,t)})),a.absoluteRules=a.rules.map((function(e,r){var o=a.urls[r],s=n(a.absoluteUrls[r],t);return e.replace(o,s)})),a}function f(e,r,n,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],i=l(e,n,c);i.rules.length?t(i.absoluteUrls,{onBeforeSend:function(e,t,n){s.onBeforeSend(e,r,t)},onSuccess:function(e,t,n){var o=s.onSuccess(e,r,t),a=l(e=!1===o?"":o||e,t,c);return a.rules.forEach((function(t,r){e=e.replace(t,a.absoluteRules[r])})),e},onError:function(t,s,u){a.push({xhr:t,url:s}),c.push(i.rules[u]),f(e,r,n,o,a,c)},onComplete:function(t){t.forEach((function(t,r){e=e.replace(i.rules[r],t)})),f(e,r,n,o,a,c)}}):o(e,a)}a.length?a.forEach((function(e,r){var o=e.getAttribute("href"),a=e.getAttribute("rel"),l="link"===e.nodeName.toLowerCase()&&o&&a&&-1!==a.toLowerCase().indexOf("stylesheet"),f=!1!==s.skipDisabled&&e.disabled,d="style"===e.nodeName.toLowerCase();if(l&&!f)if(-1!==o.indexOf("data:text/css")){var p=decodeURIComponent(o.substring(o.indexOf(",")+1));s.useCSSOM&&(p=Array.apply(null,e.sheet.cssRules).map((function(e){return e.cssText})).join("")),u(p,r,e,location.href)}else t(o,{mimeType:"text/css",onBeforeSend:function(t,r,n){s.onBeforeSend(t,e,r)},onSuccess:function(t,s,a){var c=n(o);u(t,r,e,c)},onError:function(t,n,o){c[r]="",s.onError(t,e,n),i()}});else if(d&&!f){var m=e.textContent;s.useCSSOM&&(m=Array.apply(null,e.sheet.cssRules).map((function(e){return e.cssText})).join("")),u(m,r,e,location.href)}else c[r]="",i()})):s.onComplete("",[])}function n(e,t){var r=document.implementation.createHTMLDocument(""),n=r.createElement("base"),o=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(o),n.href=t||document.baseURI||(document.querySelector("base")||{}).href||location.href,o.href=e,o.href}var o=s;function s(e,t,r){e instanceof RegExp&&(e=a(e,r)),t instanceof RegExp&&(t=a(t,r));var n=c(e,t,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+e.length,n[1]),post:r.slice(n[1]+t.length)}}function a(e,t){var r=t.match(e);return r?r[0]:null}function c(e,t,r){var n,o,s,a,c,i=r.indexOf(e),u=r.indexOf(t,i+1),l=i;if(i>=0&&u>0){if(e===t)return[i,u];for(n=[],s=r.length;l>=0&&!c;)l==i?(n.push(l),i=r.indexOf(e,l+1)):1==n.length?c=[n.pop(),u]:((o=n.pop())=0?i:u;n.length&&(c=[s,a])}return c}function i(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={preserveStatic:!0,removeComments:!1},s=e({},n,r),a=[];function c(e){throw new Error("CSS parse error: ".concat(e))}function i(e){var r=e.exec(t);if(r)return t=t.slice(r[0].length),r}function u(){return i(/^{\s*/)}function l(){return i(/^}/)}function f(){i(/^\s*/)}function d(){if(f(),"/"===t[0]&&"*"===t[1]){for(var e=2;t[e]&&("*"!==t[e]||"/"!==t[e+1]);)e++;if(!t[e])return c("end of comment is missing");var r=t.slice(2,e);return t=t.slice(e+2),{type:"comment",comment:r}}}function p(){for(var e,t=[];e=d();)t.push(e);return s.removeComments?[]:t}function m(){for(f();"}"===t[0];)c("extra closing bracket");var e=i(/^(("(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^{])+)/);if(e){var r,n=e[0].trim();/\/\*/.test(n)&&(n=n.replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,""));var o=/["']\w*,\w*["']/.test(n);return o&&(n=n.replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")}))),r=/,/.test(n)?n.split(/\s*(?![^(]*\)),\s*/):[n],o&&(r=r.map((function(e){return e.replace(/\u200C/g,",")}))),r}}function v(){if("@"===t[0])return _();i(/^([;\s]*)+/);var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=i(/^(\*?[-#/*\\\w.]+(\[[0-9a-z_-]+\])?)\s*/);if(r){if(r=r[0].trim(),!i(/^:\s*/))return c("property missing ':'");var n=i(/^((?:\/\*.*?\*\/|'(?:\\'|.)*?'|"(?:\\"|.)*?"|\((\s*'(?:\\'|.)*?'|"(?:\\"|.)*?"|[^)]*?)\s*\)|[^};])+)/),o={type:"declaration",property:r.replace(e,""),value:n?n[0].replace(e,"").trim():""};return i(/^[;\s]*/),o}}function h(){if(!u())return c("missing '{'");for(var e,t=p();e=v();)t.push(e),t=t.concat(p());return l()?t:c("missing '}'")}function y(){f();for(var e,t=[];e=i(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),i(/^,\s*/);if(t.length)return{type:"keyframe",values:t,declarations:h()}}function g(){var e=i(/^@([-\w]+)?keyframes\s*/);if(e){var t=e[1];if(!(e=i(/^([-\w]+)\s*/)))return c("@keyframes missing name");var r,n=e[1];if(!u())return c("@keyframes missing '{'");for(var o=p();r=y();)o.push(r),o=o.concat(p());return l()?{type:"keyframes",name:n,vendor:t,keyframes:o}:c("@keyframes missing '}'")}}function b(){if(i(/^@page */))return{type:"page",selectors:m()||[],declarations:h()}}function S(){var e=i(/@(top|bottom|left|right)-(left|center|right|top|middle|bottom)-?(corner)?\s*/);if(e)return{type:"page-margin-box",name:"".concat(e[1],"-").concat(e[2])+(e[3]?"-".concat(e[3]):""),declarations:h()}}function E(){if(i(/^@font-face\s*/))return{type:"font-face",declarations:h()}}function w(){var e=i(/^@supports *([^{]+)/);if(e)return{type:"supports",supports:e[1].trim(),rules:M()}}function C(){if(i(/^@host\s*/))return{type:"host",rules:M()}}function x(){var e=i(/^@media([^{]+)*/);if(e)return{type:"media",media:(e[1]||"").trim(),rules:M()}}function O(){var e=i(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(e)return{type:"custom-media",name:e[1].trim(),media:e[2].trim()}}function A(){var e=i(/^@([-\w]+)?document *([^{]+)/);if(e)return{type:"document",document:e[2].trim(),vendor:e[1]?e[1].trim():null,rules:M()}}function k(){var e=i(/^@(import|charset|namespace)\s*([^;]+);/);if(e)return{type:e[1],name:e[2].trim()}}function _(){if(f(),"@"===t[0]){var e=k()||E()||x()||g()||w()||A()||O()||C()||b()||S();if(e&&!s.preserveStatic){var r=!1;if(e.declarations)r=e.declarations.some((function(e){return/var\(/.test(e.value)}));else r=(e.keyframes||e.rules||[]).some((function(e){return(e.declarations||[]).some((function(e){return/var\(/.test(e.value)}))}));return r?e:{}}return e}}function j(){if(!s.preserveStatic){var e=o("{","}",t);if(e){var r=/:(?:root|host)(?![.:#(])/.test(e.pre)&&/--\S*\s*:/.test(e.body),n=/var\(/.test(e.body);if(!r&&!n)return t=t.slice(e.end+1),{}}}var a=m()||[],i=s.preserveStatic?h():h().filter((function(e){var t=a.some((function(e){return/:(?:root|host)(?![.:#(])/.test(e)}))&&/^--\S/.test(e.property),r=/var\(/.test(e.value);return t||r}));return a.length||c("selector missing"),{type:"rule",selectors:a,declarations:i}}function M(e){if(!e&&!u())return c("missing '{'");for(var r,n=p();t.length&&(e||"}"!==t[0])&&(r=_()||j());)r.type&&n.push(r),n=n.concat(p());return e||l()?n:c("missing '}'")}return{type:"stylesheet",stylesheet:{rules:M(!0),errors:a}}}function u(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={parseHost:!1,store:{},onWarning:function(){}},o=e({},n,r),s=new RegExp(":".concat(o.parseHost?"host":"root","$"));return"string"==typeof t&&(t=i(t,o)),t.stylesheet.rules.forEach((function(e){"rule"===e.type&&e.selectors.some((function(e){return s.test(e)}))&&e.declarations.forEach((function(e,t){var r=e.property,n=e.value;r&&0===r.indexOf("--")&&(o.store[r]=n)}))})),o.store}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0,n={charset:function(e){return"@charset "+e.name+";"},comment:function(e){return 0===e.comment.indexOf("__CSSVARSPONYFILL")?"/*"+e.comment+"*/":""},"custom-media":function(e){return"@custom-media "+e.name+" "+e.media+";"},declaration:function(e){return e.property+":"+e.value+";"},document:function(e){return"@"+(e.vendor||"")+"document "+e.document+"{"+o(e.rules)+"}"},"font-face":function(e){return"@font-face{"+o(e.declarations)+"}"},host:function(e){return"@host{"+o(e.rules)+"}"},import:function(e){return"@import "+e.name+";"},keyframe:function(e){return e.values.join(",")+"{"+o(e.declarations)+"}"},keyframes:function(e){return"@"+(e.vendor||"")+"keyframes "+e.name+"{"+o(e.keyframes)+"}"},media:function(e){return"@media "+e.media+"{"+o(e.rules)+"}"},namespace:function(e){return"@namespace "+e.name+";"},page:function(e){return"@page "+(e.selectors.length?e.selectors.join(", "):"")+"{"+o(e.declarations)+"}"},"page-margin-box":function(e){return"@"+e.name+"{"+o(e.declarations)+"}"},rule:function(e){var t=e.declarations;if(t.length)return e.selectors.join(",")+"{"+o(t)+"}"},supports:function(e){return"@supports "+e.supports+"{"+o(e.rules)+"}"}};function o(e){for(var o="",s=0;s1&&void 0!==arguments[1]?arguments[1]:{},n={preserveStatic:!0,preserveVars:!1,variables:{},onWarning:function(){}},o=e({},n,r);return"string"==typeof t&&(t=i(t,o)),f(t.stylesheet,(function(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(-1===e.indexOf("var("))return e;var n=o("(",")",e);function s(e){var n=e.split(",")[0].replace(/[\s\n\t]/g,""),o=(e.match(/(?:\s*,\s*){1}(.*)?/)||[])[1],s=Object.prototype.hasOwnProperty.call(t.variables,n)?String(t.variables[n]):void 0,a=s||(o?String(o):void 0),c=r||e;return s||t.onWarning('variable "'.concat(n,'" is undefined')),a&&"undefined"!==a&&a.length>0?m(a,t,c):"var(".concat(c,")")}if(n){if("var"===n.pre.slice(-3)){var a=0===n.body.trim().length;return a?(t.onWarning("var() must contain a non-whitespace string"),e):n.pre.slice(0,-3)+s(n.body)+m(n.post,t)}return n.pre+"(".concat(m(n.body,t),")")+m(n.post,t)}return-1!==e.indexOf("var(")&&t.onWarning('missing closing ")" in the value "'.concat(e,'"')),e}var v="undefined"!=typeof window,h=v&&window.CSS&&window.CSS.supports&&window.CSS.supports("(--a: 0)"),y={group:0,job:0},g={rootElement:v?document:null,shadowDOM:!1,include:"style,link[rel=stylesheet]",exclude:"",variables:{},onlyLegacy:!0,preserveStatic:!0,preserveVars:!1,silent:!1,updateDOM:!0,updateURLs:!0,watch:null,onBeforeSend:function(){},onError:function(){},onWarning:function(){},onSuccess:function(){},onComplete:function(){},onFinally:function(){}},b={cssComments:/\/\*[\s\S]+?\*\//g,cssKeyframes:/@(?:-\w*-)?keyframes/,cssMediaQueries:/@media[^{]+\{([\s\S]+?})\s*}/g,cssUrls:/url\((?!['"]?(?:data|http|\/\/):)['"]?([^'")]*)['"]?\)/g,cssVarDeclRules:/(?::(?:root|host)(?![.:#(])[\s,]*[^{]*{\s*[^}]*})/g,cssVarDecls:/(?:[\s;]*)(-{2}\w[\w-]*)(?:\s*:\s*)([^;]*);/g,cssVarFunc:/var\(\s*--[\w-]/,cssVars:/(?:(?::(?:root|host)(?![.:#(])[\s,]*[^{]*{\s*[^;]*;*\s*)|(?:var\(\s*))(--[^:)]+)(?:\s*[:)])/},S={dom:{},job:{},user:{}},E=!1,w=null,C=0,x=null,O=!1;function A(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n="cssVars(): ",o=e({},g,t);function s(e,t,r,s){!o.silent&&window.console&&console.error("".concat(n).concat(e,"\n"),t),o.onError(e,t,r,s)}function a(e){!o.silent&&window.console&&console.warn("".concat(n).concat(e)),o.onWarning(e)}function c(e){o.onFinally(Boolean(e),h,R()-o.__benchmark)}if(v){if(o.watch)return o.watch=g.watch,k(o),void A(o);if(!1===o.watch&&w&&(w.disconnect(),w=null),!o.__benchmark){if(E===o.rootElement)return void _(t);var f=[].slice.call(o.rootElement.querySelectorAll('[data-cssvars]:not([data-cssvars="out"])'));if(o.__benchmark=R(),o.exclude=[w?'[data-cssvars]:not([data-cssvars=""])':'[data-cssvars="out"]',"link[disabled]:not([data-cssvars])",o.exclude].filter((function(e){return e})).join(","),o.variables=V(o.variables),f.forEach((function(e){var t="style"===e.nodeName.toLowerCase()&&e.__cssVars.text,r=t&&e.textContent!==e.__cssVars.text;t&&r&&(e.sheet&&(e.sheet.disabled=!1),e.setAttribute("data-cssvars",""))})),!w){var p=[].slice.call(o.rootElement.querySelectorAll('[data-cssvars="out"]'));p.forEach((function(e){var t=e.getAttribute("data-cssvars-group");(t?o.rootElement.querySelector('[data-cssvars="src"][data-cssvars-group="'.concat(t,'"]')):null)||e.parentNode.removeChild(e)})),C&&f.length2&&void 0!==arguments[2]?arguments[2]:[],f=e({},S.dom,S.user);if(S.job={},n.forEach((function(e,t){var n=r[t];if(e.__cssVars=e.__cssVars||{},e.__cssVars.text=n,b.cssVars.test(n))try{var c=i(n,{preserveStatic:o.preserveStatic,removeComments:!0});u(c,{parseHost:Boolean(o.rootElement.host),store:S.dom,onWarning:a}),e.__cssVars.tree=c}catch(t){s(t.message,e)}})),e(S.job,S.dom),o.updateDOM?(e(S.user,o.variables),e(S.job,S.user)):(e(S.job,S.user,o.variables),e(f,o.variables)),y.job>0&&Boolean(Object.keys(S.job).length>Object.keys(f).length||Boolean(Object.keys(f).length&&Object.keys(S.job).some((function(e){return S.job[e]!==f[e]})))))T(o.rootElement),A(o);else{var p=[],m=[],v=!1;if(o.updateDOM&&y.job++,n.forEach((function(t,n){var c=!t.__cssVars.tree;if(t.__cssVars.tree)try{d(t.__cssVars.tree,e({},o,{variables:S.job,onWarning:a}));var i=l(t.__cssVars.tree);if(o.updateDOM){var u=r[n],f=b.cssVarFunc.test(u);if(t.getAttribute("data-cssvars")||t.setAttribute("data-cssvars","src"),i.length&&f){var h=t.getAttribute("data-cssvars-group")||++y.group,g=i.replace(/\s/g,""),E=o.rootElement.querySelector('[data-cssvars="out"][data-cssvars-group="'.concat(h,'"]'))||document.createElement("style");v=v||b.cssKeyframes.test(i),o.preserveStatic&&t.sheet&&(t.sheet.disabled=!0),E.hasAttribute("data-cssvars")||E.setAttribute("data-cssvars","out"),g===t.textContent.replace(/\s/g,"")?(c=!0,E&&E.parentNode&&(t.removeAttribute("data-cssvars-group"),E.parentNode.removeChild(E))):g!==E.textContent.replace(/\s/g,"")&&([t,E].forEach((function(e){e.setAttribute("data-cssvars-job",y.job),e.setAttribute("data-cssvars-group",h)})),E.textContent=i,p.push(i),m.push(E),E.parentNode||t.parentNode.insertBefore(E,t.nextSibling))}}else t.textContent.replace(/\s/g,"")!==i&&p.push(i)}catch(e){s(e.message,t)}c&&t.setAttribute("data-cssvars","skip"),t.hasAttribute("data-cssvars-job")||t.setAttribute("data-cssvars-job",y.job)})),C=o.rootElement.querySelectorAll('[data-cssvars]:not([data-cssvars="out"])').length,o.shadowDOM)for(var h,g=[].concat(o.rootElement).concat([].slice.call(o.rootElement.querySelectorAll("*"))),w=0;h=g[w];++w)if(h.shadowRoot&&h.shadowRoot.querySelector("style")){var x=e({},o,{rootElement:h.shadowRoot});A(x)}o.updateDOM&&v&&j(o.rootElement),E=!1,o.onComplete(p.join(""),m,JSON.parse(JSON.stringify(S.job)),R()-o.__benchmark),c(m.length)}}}));else document.addEventListener("DOMContentLoaded",(function e(r){A(t),document.removeEventListener("DOMContentLoaded",e)}))}}function k(e){function t(e){var t=r(e)&&e.hasAttribute("disabled"),n=(e.sheet||{}).disabled;return t||n}function r(e){return"link"===e.nodeName.toLowerCase()&&-1!==(e.getAttribute("rel")||"").indexOf("stylesheet")}function n(e){return"style"===e.nodeName.toLowerCase()}window.MutationObserver&&(w&&(w.disconnect(),w=null),(w=new MutationObserver((function(o){o.some((function(o){return function(n){var o=!1;if("attributes"===n.type&&r(n.target)&&!t(n.target)){var s="disabled"===n.attributeName,a="href"===n.attributeName,c="skip"===n.target.getAttribute("data-cssvars"),i="src"===n.target.getAttribute("data-cssvars");s?o=!c&&!i:a&&(c?n.target.setAttribute("data-cssvars",""):i&&T(e.rootElement,!0),o=!0)}return o}(o)||function(e){var t=!1;if("childList"===e.type){var r=n(e.target),o="out"===e.target.getAttribute("data-cssvars");t=r&&!o}return t}(o)||function(e){var o=!1;return"childList"===e.type&&(o=[].slice.call(e.addedNodes).some((function(e){var o=1===e.nodeType&&e.hasAttribute("data-cssvars"),s=n(e)&&b.cssVars.test(e.textContent);return!o&&(r(e)||s)&&!t(e)}))),o}(o)||function(t){var r=!1;return"childList"===t.type&&(r=[].slice.call(t.removedNodes).some((function(t){var r=1===t.nodeType,n=r&&"out"===t.getAttribute("data-cssvars"),o=r&&"src"===t.getAttribute("data-cssvars"),s=o;if(o||n){var a=t.getAttribute("data-cssvars-group"),c=e.rootElement.querySelector('[data-cssvars-group="'.concat(a,'"]'));o&&T(e.rootElement,!0),c&&c.parentNode.removeChild(c)}return s}))),r}(o)}))&&A(e)}))).observe(document.documentElement,{attributes:!0,attributeFilter:["disabled","href"],childList:!0,subtree:!0}))}function _(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;clearTimeout(x),x=setTimeout((function(){e.__benchmark=null,A(e)}),t)}function j(e){var t=["animation-name","-moz-animation-name","-webkit-animation-name"].filter((function(e){return getComputedStyle(document.body)[e]}))[0];if(t){for(var r=[].slice.call(e.querySelectorAll("*")),n=[],o="__CSSVARSPONYFILL-KEYFRAMES__",s=0,a=r.length;s0&&void 0!==arguments[0]?arguments[0]:{},t=/^-{2}/;return Object.keys(e).reduce((function(r,n){return r[t.test(n)?n:"--".concat(n.replace(/^-+/,""))]=e[n],r}),{})}function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location.href,r=document.implementation.createHTMLDocument(""),n=r.createElement("base"),o=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(o),n.href=t,o.href=e,o.href}function R(){return v&&(window.performance||{}).now?window.performance.now():(new Date).getTime()}function T(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=[].slice.call(e.querySelectorAll('[data-cssvars="skip"],[data-cssvars="src"]'));r.forEach((function(e){return e.setAttribute("data-cssvars","")})),t&&(S.dom={})}return A.reset=function(){for(var e in y.job=0,y.group=0,E=!1,w&&(w.disconnect(),w=null),C=0,x=null,O=!1,S)S[e]={}},A})); +//# sourceMappingURL=css-vars-ponyfill.min.js.map \ No newline at end of file diff --git a/exampleSite/content/homepage/about-me.md b/exampleSite/content/homepage/about-me.md index b80d068..52ac825 100644 --- a/exampleSite/content/homepage/about-me.md +++ b/exampleSite/content/homepage/about-me.md @@ -6,8 +6,10 @@ header_menu: true ![Jane Doe](images/happy-ethnic-woman-sitting-at-table-with-laptop-3769021.jpg) -##### Professionel Experience +##### Professional Experience A lot, but let us get into the details with some lorem ipsum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat lectus et magna placerat tincidunt. Nullam sit amet lectus vitae elit mollis rhoncus non eget lorem. Ut tempor sed dui quis volutpat. +---- + In ultrices, est at lobortis pretium, magna quam mollis neque, id viverra odio est sit amet lorem. Mauris efficitur nunc vel lectus porttitor, sit amet sodales quam eleifend. Duis et felis ut mauris dignissim efficitur. Aliquam non sem eros. Integer elit ante, bibendum id hendrerit vitae, vestibulum eget risus. Nunc efficitur nisl in iaculis vestibulum. diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index d1f62cc..18aad25 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -13,10 +13,14 @@ {{ $scriptIcons := resources.Get "js/icons.js" }} {{ $scriptIndex := resources.Get "js/index.js" }} - {{ $js := slice $scriptJquery $scriptIcons $scriptIndex | resources.Concat "js/script.js" | resources.Minify | resources.Fingerprint }} + {{ $scriptPolyfill := resources.Get "js/css-vars-ponyfill.min.js" }} + {{ $js := slice $scriptJquery $scriptIcons $scriptIndex $scriptPolyfill | resources.Concat "js/script.js" | resources.Minify | resources.Fingerprint }} + + + diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 8dfd6bc..c8da16c 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -19,12 +19,14 @@ -{{ $stylesheetFA := resources.Get "css/fork-awesome.css" }} {{ $stylesheetNormalize := resources.Get "css/normalize.css" }} +{{ $stylesheetFA := resources.Get "css/fork-awesome.css" }} {{ $stylesheetFonts := resources.Get "css/fonts.css" }} -{{ $stylesheetScreen := resources.Get "css/screen.css" }} -{{ $stylesheet := slice $stylesheetNormalize $stylesheetFA $stylesheetFonts $stylesheetScreen | resources.Concat "css/style.css" | resources.Minify | resources.Fingerprint }} +{{ $stylesheetGeneric := resources.Get "css/generic.css" }} +{{ $stylesheetScreen := ( resources.Get "css/_index.scss" | resources.ToCSS ) }} + +{{ $stylesheet := slice $stylesheetNormalize $stylesheetFA $stylesheetFonts $stylesheetGeneric $stylesheetScreen | resources.Concat "css/style.css" | resources.Minify | resources.Fingerprint }} {{ template "_internal/opengraph.html" . }}