Execute CSS resource as template

This commit is contained in:
Zachary Betz 2019-02-15 10:57:49 -06:00
parent 9192276af6
commit a4227b559c
7 changed files with 2026 additions and 7 deletions

View File

@ -1,7 +1,7 @@
/* Fonts */ /* Fonts */
@font-face { @font-face {
font-family: 'Miriam Libre'; font-family: 'Miriam Libre';
src: url('fonts/miriamlibre-bold.woff2') format('woff2'), url('fonts/miriamlibre-bold.woff') format('woff'); src: url('{{ "fonts/miriamlibre-bold.woff2" | absURL }}') format('woff2'), url('{{ "fonts/miriamlibre-bold.woff" | absURL }}') format('woff');
font-weight: bold; font-weight: bold;
font-style: normal; font-style: normal;
} }
@ -490,7 +490,7 @@ caption {
} }
.note.warning { .note.warning {
border-left: 0; border-left: 0;
background-image: url(images/stripe.svg); background-image: url({{ "css/images/stripe.svg" | absURL }});
background-size: 0.5rem auto; background-size: 0.5rem auto;
background-repeat: repeat-y; background-repeat: repeat-y;
} }
@ -509,7 +509,7 @@ caption {
width: 1rem; width: 1rem;
height: 1rem; height: 1rem;
margin-right: 0.25rem; margin-right: 0.25rem;
background-image: url(images/icon-tick.svg); background-image: url({{ "css/images/icon-tick.svg" | absURL }});
background-size: 100% auto; background-size: 100% auto;
position: absolute; position: absolute;
left: -1.25rem; left: -1.25rem;

View File

@ -0,0 +1 @@
{"Target":"css/styles.css","MediaType":"text/css","Data":{}}

View File

@ -0,0 +1 @@
{"Target":"styles.css","MediaType":"text/css","Data":{}}

View File

@ -15,7 +15,10 @@
<meta name="theme-color" content="#ffffff"> <meta name="theme-color" content="#ffffff">
<link rel="stylesheet" href="{{ "css/prism.css" | absURL }}" media="none" onload="this.media='all';"> <link rel="stylesheet" href="{{ "css/prism.css" | absURL }}" media="none" onload="this.media='all';">
<link rel="stylesheet" type="text/css" href="{{ "css/styles.css" | absURL }}">
{{ $templateStyles := resources.Get "css/template-styles.css" }}
{{ $styles := $templateStyles | resources.ExecuteAsTemplate "css/styles.css" . }}
<link rel="stylesheet" type="text/css" href="{{ $styles.Permalink }}">
<style id="inverter" media="none"> <style id="inverter" media="none">
html { filter: invert(100%) } html { filter: invert(100%) }

View File

@ -1,4 +1,4 @@
/* expandable sections */ /* Expandable sections */
(function () { (function () {
function toggle (button, target) { function toggle (button, target) {
var expanded = button.getAttribute('aria-expanded') === 'true'; var expanded = button.getAttribute('aria-expanded') === 'true';
@ -17,7 +17,7 @@
}) })
}()); }());
/* menu button */ /* Menu button */
(function () { (function () {
var button = document.getElementById('menu-button'); var button = document.getElementById('menu-button');
if (button) { if (button) {
@ -29,7 +29,7 @@
} }
}()); }());
/* persist navigation scroll point */ /* Persist navigation scroll point */
(function () { (function () {
window.onbeforeunload = function () { window.onbeforeunload = function () {
var patternsNav = document.getElementById('patterns-nav'); var patternsNav = document.getElementById('patterns-nav');