This commit is contained in:
Simon Gardling
2023-10-11 17:38:05 -04:00
commit 032679b34a
242 changed files with 9311 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
function registerHoverEvent(wrapper, button) {
wrapper.addEventListener('mouseenter', function () {
button.classList.remove("hidden");
});
wrapper.addEventListener('mouseleave', function () {
button.classList.add("hidden");
});
}
function registerTouchedEvent(pre, button) {
pre.addEventListener("touchend", function () {
if (button.classList.contains("hidden")) {
button.classList.remove("hidden");
} else {
button.classList.add("hidden");
}
});
}
function registerClipboard(button, code_block) {
button.addEventListener('click', async function () {
try {
await navigator.clipboard.writeText(code_block.innerText);
button.blur();
button.innerText = 'Copied!';
setTimeout(function () {
button.innerText = 'Copy';
}, 2000);
} catch (e) {
button.innerText = 'Error';
}
});
}
window.addEventListener("DOMContentLoaded", function () {
document.querySelectorAll('pre:not(.emgithub-pre) > code').forEach((code_block) => {
var button = document.createElement('span');
button.className = 'copy-code-button hidden';
button.type = 'button';
button.innerText = 'Copy';
var pre = code_block.parentNode;
if (pre.parentNode.classList.contains('highlight')) {
var highlight = pre.parentNode;
highlight.appendChild(button);
registerHoverEvent(highlight, button);
registerTouchedEvent(pre, button);
registerClipboard(button, code_block);
} else if (pre.parentNode.tagName === "TD") {
// check is line no
var td = pre.parentNode;
var tr = td.parentNode;
if (td === tr.firstChild) {
return;
}
// get highlight block
var highlight = pre.parentNode;
while (!highlight.classList.contains('highlight') && highlight.tagName !== 'BODY') {
highlight = highlight.parentNode;
}
if (highlight.tagName !== 'BODY') {
highlight.appendChild(button);
registerHoverEvent(highlight, button);
registerTouchedEvent(pre, button);
registerClipboard(button, code_block);
}
} else {
var wrapper = document.createElement('div');
wrapper.style = "position: relative;"
pre.parentNode.insertBefore(wrapper, pre);
wrapper.appendChild(pre);
wrapper.appendChild(button);
registerHoverEvent(wrapper, button);
registerTouchedEvent(pre, button);
registerClipboard(button, code_block);
}
});
});

View File

@@ -0,0 +1,74 @@
var currentScript = document.currentScript;
function removeMask (container) {
const emgithubPre = container.querySelector(".emgithub-pre");
const emgithubLoading = container.querySelector(".emgithub-loading");
emgithubLoading.classList.add("hide");
emgithubPre.classList.remove("hide");
emgithubPre.classList.remove("loading");
}
function embedTextToEle (codeText, container, lang, lineBegin, lineEnd) {
const emgithubPre = container.querySelector(".emgithub-pre");
const emgithubCode = document.createElement("code");
emgithubPre.appendChild(emgithubCode);
if (lineBegin > 0) {
const codeTextSplit = codeText.split("\n");
codeText = codeTextSplit.slice(lineBegin - 1, lineEnd).join("\n") + '\n';
}
// Dynamically adjust padding of pre to fit in the line numbers
const lineBeginDigit = lineBegin.toString().length;
const lineEndDigit = lineEnd.toString().length;
if (lineBeginDigit >= 4 || lineEndDigit >= 4) {
emgithubPre.style.paddingLeft = "4.5rem";
} else if (lineBeginDigit >= 3 || lineEndDigit >= 3) {
emgithubPre.style.paddingLeft = "4rem";
} else if (lineBeginDigit >= 2 || lineEndDigit >= 2) {
emgithubPre.style.paddingLeft = "3.5rem";
}
emgithubCode.classList.add(`language-${lang}`);
emgithubCode.textContent = codeText;
Prism.highlightAllUnder(container, false, () => {
requestAnimationFrame(() => {
removeMask(container);
})
});
}
function embedErrorToEle (errText, container) {
const emgithubPre = container.querySelector(".emgithub-code .emgithub-pre");
const emgithubCode = document.createElement("code");
emgithubPre.appendChild(emgithubCode);
emgithubPre.classList.remove("line-numbers");
emgithubPre.classList.add("no-line-numbers");
emgithubCode.textContent = errText;
removeMask(container);
}
async function embed () {
const sourceURL = new URL(currentScript.src);
const params = sourceURL.searchParams;
const rawFileURL = new URL(params.get("raw_file_url"));
const lang = params.get("lang");
const id = params.get("id");
const lineBegin = Number(params.get("line_begin"));
const lineEnd = Number(params.get("line_end"));
const emgithubContainer = document.getElementById(id);
const response = await fetch(rawFileURL);
if (response.ok) {
const text = await response.text();
embedTextToEle(text, emgithubContainer, lang, lineBegin, lineEnd);
} else {
embedErrorToEle(`Failed to process ${rawFileURL}\n${response.status}`, emgithubContainer);
}
}
window.addEventListener("DOMContentLoaded", () => {
embed();
});

View File

@@ -0,0 +1,46 @@
function hide_canvas() {
const sidebar_canvas_overlay = document.getElementById("sidebar_canvas_overlay");
sidebar_canvas_overlay.classList.add("hidden");
}
function show_canvas() {
const sidebar_canvas_overlay = document.getElementById("sidebar_canvas_overlay");
sidebar_canvas_overlay.classList.remove("hidden");
}
function hide_sidebar() {
const sidebar = document.getElementById("sidebar");
sidebar.classList.add("close");
}
function show_sidebar() {
const sidebar = document.getElementById("sidebar");
sidebar.classList.remove("close");
}
window.addEventListener("DOMContentLoaded", function() {
const sidebar_btn = document.getElementById("sidebar_btn");
sidebar_btn.addEventListener("click", function() {
show_canvas();
show_sidebar();
});
const sidebar_canvas_overlay = document.getElementById("sidebar_canvas_overlay");
sidebar_canvas_overlay.addEventListener("click", function() {
hide_canvas();
hide_sidebar();
});
const dark_mode_btn = document.getElementById("dark_mode_btn");
const light_mode_btn = document.getElementById("light_mode_btn");
dark_mode_btn.addEventListener('click', function() {
document.documentElement.setAttribute("data-theme", "dark");
localStorage.theme = 'dark';
});
light_mode_btn.addEventListener('click', function() {
document.documentElement.setAttribute("data-theme", "light");
localStorage.theme = 'light';
});
});

View File

@@ -0,0 +1,11 @@
window.MathJax = {
tex: {
inlineMath: [['$', '$']],
displayMath: [['$$', '$$']],
processEscapes: true,
processEnvironments: true
},
options: {
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre']
}
};

View File

@@ -0,0 +1 @@
Prism.plugins.autoloader.languages_path = 'https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/';

View File

@@ -0,0 +1,13 @@
function highlight() {
document.querySelectorAll("pre:not(.emgithub-pre)").forEach(e => {
Prism.highlightAllUnder(e, false, () => {
requestAnimationFrame(() => {
e.classList.remove("hide");
})
});
});
}
window.addEventListener("DOMContentLoaded", () => {
highlight();
})

View File

@@ -0,0 +1,143 @@
import * as params from '@params';
import Fuse from '../lib/js/fuse-v6.6.2.min.js';
async function init() {
const data = fetch(params.index_url);
const search_btn = document.getElementById("search_btn");
const search_menu_wrapper = document.getElementById("search_menu_wrapper");
const search_menu_close_btn = document.getElementById("search_menu_close_btn");
const search_menu_input = document.getElementById("search_menu_input");
const search_menu_results = document.getElementById("search_menu_results");
search_btn.addEventListener("click", function() {
search_menu_wrapper.classList.remove("hidden");
search_menu_input.focus();
});
search_menu_close_btn.addEventListener("click", function() {
search_menu_wrapper.classList.add("hidden");
});
const index_json = await (await data).json();
const options = {
distance: 100,
threshold: 0.3,
ignoreLocation: true,
minMatchCharLength: 2,
keys: [
'title',
'permalink',
'content',
],
includeMatches: true,
};
const fuse = new Fuse(index_json, options);
const createItem = (title, permalink, content) => {
return `<a href="${permalink}">
<div class="search-menu-result-item">
<div class="search-menu-result-item-title">${title}</div>
<div class="search-menu-result-item-content">${content}</div>
</div>
</a>`;
};
const hlItem = (item, matches) => {
const highlightTitle = (text, match) => {
let textHl = "", ptr = 0;
match.forEach(idx => {
if (ptr < idx[0]) {
textHl += text.substring(ptr, idx[0]);
}
textHl += "<mark>" + text.substring(idx[0], idx[1] + 1) + "</mark>";
ptr = idx[1] + 1;
})
textHl += text.substring(ptr, text.length);
return textHl;
};
const highlightContent = (text, match) => {
let textHl = "<mark>" + text.substring(match[0][0], match[0][1] + 1) + "</mark>";
let ptr = match[0][1] + 1;
let length = match[0][1] + 1 - match[0][0];
if (match[0][0] > 0) {
textHl = "..." + textHl;
}
for (let i = 1; i < match.length; i++) {
const idx = match[i];
if (ptr < idx[0] && (length + idx[0] - ptr) >= 100) {
textHl += text.substring(ptr, ptr + (100 - length + 1)) + "...";
length = 100;
break;
}
if (ptr < idx[0]) {
textHl += text.substring(ptr, idx[0]);
length += idx[0] - ptr;
}
textHl += "<mark>" + text.substring(idx[0], idx[1] + 1) + "</mark>";
length += idx[1] + 1 - idx[0];
ptr = idx[1] + 1;
if (length >= 100) {
break;
}
}
if (length < 100) {
textHl += text.substring(ptr, ptr + (100 - length));
}
if (ptr <= text.length) {
textHl += "...";
}
return textHl;
}
let itemHl = {
title: undefined,
permalink: item.permalink,
content: undefined,
};
matches.forEach(match => {
if (match.key == 'title') {
itemHl.title = highlightTitle(item.title, match.indices);
} else if (match.key == 'content') {
itemHl.content = highlightContent(item.content, match.indices);
}
});
if (itemHl.title === undefined) itemHl.title = item.title;
if (itemHl.content === undefined) itemHl.content = item.content;
return itemHl;
}
const buildAllItems = () => {
search_menu_results.innerHTML = index_json.reduce((acc, curr) => {
let content = (curr.content.length > 100) ? curr.content.substring(0, 100) + "..." : curr.content;
return acc + createItem(curr.title, curr.permalink, content);
}, "");
};
const search = (value) => {
const results = fuse.search(value);
if (results.length == 0) {
search_menu_results.innerHTML = '';
} else {
search_menu_results.innerHTML = results.reduce((acc, curr) => {
const item = hlItem(curr.item, curr.matches);
return acc + createItem(item.title, item.permalink, item.content);
}, "")
}
};
search_menu_input.addEventListener("input", function() {
if (this.value === '') {
buildAllItems();
} else {
search(this.value.trim());
}
});
buildAllItems();
}
window.addEventListener("DOMContentLoaded", init);

View File

@@ -0,0 +1,27 @@
import Zooming from '../lib/js/zooming-v2.1.1.min.js';
document.addEventListener('DOMContentLoaded', function () {
let bgColor;
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
bgColor = '#333';
} else {
bgColor = '#fff';
}
zooming = new Zooming({
transitionDuration: 0.2,
bgColor: bgColor,
});
zooming.listen('#content img');
const dark_mode_btn = document.getElementById("dark_mode_btn");
const light_mode_btn = document.getElementById("light_mode_btn");
dark_mode_btn.addEventListener('click', function () {
zooming.config({bgColor: '#333'});
});
light_mode_btn.addEventListener('click', function () {
zooming.config({bgColor: '#fff'});
});
});

View File

@@ -0,0 +1,300 @@
/* PrismJS 1.27.0
https://prismjs.com/download.html#themes=prism-tomorrow */
/**
* prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML
* Based on https://github.com/chriskempson/tomorrow-theme
* @author Rose Pritchard
*/
/* !!! Be aware that this file is modified version for hugo-theme-monochrome */
code[class*="language-"],
pre[class*="language-"] {
color: #ddd;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
/* margin: 0.5em 0; */
overflow: auto;
}
/* :not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #2d2d2d;
} */
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: 0.1em;
border-radius: 0.3em;
white-space: normal;
}
.token.comment,
.token.block-comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: #999;
}
.token.punctuation {
color: #ccc;
}
.token.tag,
.token.attr-name,
.token.namespace,
.token.deleted {
color: #e2777a;
}
.token.function-name {
color: #6196cc;
}
.token.boolean,
.token.number,
.token.function {
color: #f08d49;
}
.token.property,
.token.class-name,
.token.constant,
.token.symbol {
color: #f8c555;
}
.token.selector,
.token.important,
.token.atrule,
.token.keyword,
.token.builtin {
color: #cc99cd;
}
.token.string,
.token.char,
.token.attr-value,
.token.regex,
.token.variable {
color: #7ec699;
}
.token.operator,
.token.entity,
.token.url {
color: #67cdcc;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
.token.inserted {
color: green;
}
/* line-numbers */
pre[class*="language-"].line-numbers {
position: relative;
padding-left: 3.8em;
counter-reset: linenumber;
}
pre[class*="language-"].line-numbers > code {
position: relative;
white-space: inherit;
}
.line-numbers .line-numbers-rows {
position: absolute;
pointer-events: none;
top: 0;
font-size: 100%;
left: -3.8em;
min-width: 3em;
/* width: 3em; /* works for line-numbers below 1000 lines */
letter-spacing: -1px;
border-right: 1px solid #999;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.line-numbers-rows > span {
display: block;
counter-increment: linenumber;
}
.line-numbers-rows > span:before {
content: counter(linenumber);
color: #999;
display: block;
padding-right: 0.8em;
text-align: right;
}
/* toolbar */
div.code-toolbar {
position: relative;
}
div.code-toolbar > .toolbar {
position: absolute;
z-index: 10;
top: 0.3em;
right: 0.2em;
transition: opacity 0.3s ease-in-out;
opacity: 0;
}
div.code-toolbar:hover > .toolbar {
opacity: 1;
}
/* Separate line b/c rules are thrown out if selector is invalid.
IE11 and old Edge versions don't support :focus-within. */
div.code-toolbar:focus-within > .toolbar {
opacity: 1;
}
div.code-toolbar > .toolbar > .toolbar-item {
display: inline-block;
}
div.code-toolbar > .toolbar > .toolbar-item > a {
cursor: pointer;
}
div.code-toolbar > .toolbar > .toolbar-item > button {
background: none;
border: 0;
color: inherit;
font: inherit;
line-height: normal;
overflow: visible;
padding: 0;
-webkit-user-select: none; /* for button */
-moz-user-select: none;
-ms-user-select: none;
}
div.code-toolbar > .toolbar > .toolbar-item > a,
div.code-toolbar > .toolbar > .toolbar-item > button,
div.code-toolbar > .toolbar > .toolbar-item > span {
color: #bbb;
font-size: 0.8em;
padding: 0 0.5em;
background: #f5f2f0;
background: rgba(224, 224, 224, 0.2);
box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.2);
border-radius: 0.5em;
}
div.code-toolbar > .toolbar > .toolbar-item > a:hover,
div.code-toolbar > .toolbar > .toolbar-item > a:focus,
div.code-toolbar > .toolbar > .toolbar-item > button:hover,
div.code-toolbar > .toolbar > .toolbar-item > button:focus,
div.code-toolbar > .toolbar > .toolbar-item > span:hover,
div.code-toolbar > .toolbar > .toolbar-item > span:focus {
color: inherit;
text-decoration: none;
}
/* line highlight */
.line-highlight {
position: absolute;
left: 0;
right: 0;
padding: inherit 0;
margin-top: 1em; /* Same as .prisms padding-top */
background: hsla(50, 100%, 83%, 0.2);
/* background: linear-gradient(to right, hsla(24, 20%, 50%, 0.1) 70%, hsla(24, 20%, 50%, 0)); */
pointer-events: none;
line-height: inherit;
white-space: pre;
}
@media print {
.line-highlight {
/*
* This will prevent browsers from replacing the background color with white.
* It's necessary because the element is layered on top of the displayed code.
*/
-webkit-print-color-adjust: exact;
color-adjust: exact;
}
}
.line-highlight:before,
.line-highlight[data-end]:after {
content: attr(data-start);
position: absolute;
top: 0.4em;
left: 0.6em;
min-width: 1em;
padding: 0 0.5em;
background-color: hsla(24, 20%, 50%, 0.4);
color: hsl(24, 20%, 95%);
font: bold 65%/1.5 sans-serif;
text-align: center;
vertical-align: 0.3em;
border-radius: 999px;
text-shadow: none;
box-shadow: 0 1px white;
}
.line-highlight[data-end]:after {
content: attr(data-end);
top: auto;
bottom: 0.4em;
}
.line-numbers .line-highlight:before,
.line-numbers .line-highlight:after {
content: none;
}
pre[id].linkable-line-numbers span.line-numbers-rows {
pointer-events: all;
}
pre[id].linkable-line-numbers span.line-numbers-rows > span:before {
cursor: pointer;
}
pre[id].linkable-line-numbers span.line-numbers-rows > span:hover:before {
background-color: rgba(128, 128, 128, 0.2);
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 59 KiB

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
!function() { function t(t) { var e = document.createElement("textarea"); e.value = t.getText(), e.style.top = "0", e.style.left = "0", e.style.position = "fixed", document.body.appendChild(e), e.focus(), e.select(); try { var o = document.execCommand("copy"); setTimeout((function() { o ? t.success() : t.error() }), 1) } catch (e) { setTimeout((function() { t.error(e) }), 1) } document.body.removeChild(e) } "undefined" != typeof Prism && "undefined" != typeof document && (Prism.plugins.toolbar ? Prism.plugins.toolbar.registerButton("copy-to-clipboard", (function(e) { var o = e.element, n = function(t) { var e = { copy: "Copy", "copy-error": "Press Ctrl+C to copy", "copy-success": "Copied!", "copy-timeout": 5e3 }; for (var o in e) { for (var n = "data-prismjs-" + o, c = t; c && !c.hasAttribute(n);)c = c.parentElement; c && (e[o] = c.getAttribute(n)) } return e }(o), c = document.createElement("button"); c.className = "copy-to-clipboard-button", c.setAttribute("type", "button"); var r = document.createElement("span"); return c.appendChild(r), u("copy"), function(e, o) { e.addEventListener("click", (function() { !function(e) { navigator.clipboard ? navigator.clipboard.writeText(e.getText()).then(e.success, (function() { t(e) })) : t(e) }(o) })) }(c, { getText: function() { return o.textContent }, success: function() { u("copy-success"), i() }, error: function() { u("copy-error"), setTimeout((function() { !function(t) { window.getSelection().selectAllChildren(t) }(o) }), 1), i() } }), c; function i() { setTimeout((function() { u("copy") }), n["copy-timeout"]) } function u(t) { r.textContent = n[t], c.setAttribute("data-copy-state", t) } })) : console.warn("Copy to Clipboard plugin loaded before Toolbar plugin.")) }();

View File

@@ -0,0 +1,3 @@
/* PrismJS 1.27.0
https://prismjs.com/download.html#themes=prism-tomorrow&plugins=line-numbers */
!function() { if ("undefined" != typeof Prism && "undefined" != typeof document) { var e = "line-numbers", n = /\n(?!$)/g, t = Prism.plugins.lineNumbers = { getLine: function(n, t) { if ("PRE" === n.tagName && n.classList.contains(e)) { var i = n.querySelector(".line-numbers-rows"); if (i) { var r = parseInt(n.getAttribute("data-start"), 10) || 1, s = r + (i.children.length - 1); t < r && (t = r), t > s && (t = s); var l = t - r; return i.children[l] } } }, resize: function(e) { r([e]) }, assumeViewportIndependence: !0 }, i = void 0; window.addEventListener("resize", (function() { t.assumeViewportIndependence && i === window.innerWidth || (i = window.innerWidth, r(Array.prototype.slice.call(document.querySelectorAll("pre.line-numbers")))) })), Prism.hooks.add("complete", (function(t) { if (t.code) { var i = t.element, s = i.parentNode; if (s && /pre/i.test(s.nodeName) && !i.querySelector(".line-numbers-rows") && Prism.util.isActive(i, e)) { i.classList.remove(e), s.classList.add(e); var l, o = t.code.match(n), a = o ? o.length + 1 : 1, u = new Array(a + 1).join("<span></span>"); (l = document.createElement("span")).setAttribute("aria-hidden", "true"), l.className = "line-numbers-rows", l.innerHTML = u, s.hasAttribute("data-start") && (s.style.counterReset = "linenumber " + (parseInt(s.getAttribute("data-start"), 10) - 1)), t.element.appendChild(l), r([s]), Prism.hooks.run("line-numbers", t) } } })), Prism.hooks.add("line-numbers", (function(e) { e.plugins = e.plugins || {}, e.plugins.lineNumbers = !0 })) } function r(e) { if (0 != (e = e.filter((function(e) { var n, t = (n = e, n ? window.getComputedStyle ? getComputedStyle(n) : n.currentStyle || null : null)["white-space"]; return "pre-wrap" === t || "pre-line" === t }))).length) { var t = e.map((function(e) { var t = e.querySelector("code"), i = e.querySelector(".line-numbers-rows"); if (t && i) { var r = e.querySelector(".line-numbers-sizer"), s = t.textContent.split(n); r || ((r = document.createElement("span")).className = "line-numbers-sizer", t.appendChild(r)), r.innerHTML = "0", r.style.display = "block"; var l = r.getBoundingClientRect().height; return r.innerHTML = "", { element: e, lines: s, lineHeights: [], oneLinerHeight: l, sizer: r } } })).filter(Boolean); t.forEach((function(e) { var n = e.sizer, t = e.lines, i = e.lineHeights, r = e.oneLinerHeight; i[t.length - 1] = void 0, t.forEach((function(e, t) { if (e && e.length > 1) { var s = n.appendChild(document.createElement("span")); s.style.display = "block", s.textContent = e } else i[t] = r })) })), t.forEach((function(e) { for (var n = e.sizer, t = e.lineHeights, i = 0, r = 0; r < t.length; r++)void 0 === t[r] && (t[r] = n.children[i++].getBoundingClientRect().height) })), t.forEach((function(e) { var n = e.sizer, t = e.element.querySelector(".line-numbers-rows"); n.style.display = "none", n.innerHTML = "", e.lineHeights.forEach((function(e, n) { t.children[n].style.height = e + "px" })) })) } } }();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,108 @@
html, button, input, select, textarea,
.pure-g [class *= "pure-u"] {
font-family: system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji;
}
code, kbd, pre {
font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,liberation mono,courier new,monospace;
}
main {
margin-left: auto;
margin-right: auto;
padding: 1.5rem;
}
h1, h2, h3, h4, h5, h6 {
@include font-bold;
margin-top: 2rem;
margin-bottom: 1rem;
}
h1 {
@include text-3xl;
}
h2 {
@include text-2xl;
}
h3 {
@include text-xl;
}
h4 {
@include text-lg;
}
h5 {
@include text-base;
}
h6 {
@include text-sm;
}
figure {
margin: 0;
}
img {
max-width: 100%;
}
input {
background-color: var(--color-background);
color: var(--color-text);
border: none;
}
mark {
background-color: var(--color-background-mark);
}
details > summary {
cursor: pointer;
}
details[open] > summary {
cursor: pointer;
}
.content-margin {
@include my-8;
}
.hidden {
display: none;
}
@media screen and (min-width: $sm_min_width) {
main {
width: $sm_main_width;
}
}
@media screen and (min-width: $md_min_width) {
main {
width: $md_main_width;
}
}
@media screen and (min-width: $lg_min_width) {
main {
width: $lg_main_width;
}
}
@media screen and (min-width: $xl_min_width) {
main {
width: $xl_main_width;
}
}
@media screen and (min-width: $xxl_min_width) {
main {
width: $xxl_main_width;
}
}

View File

@@ -0,0 +1,69 @@
$gray-0: #fff;
$gray-50: #f7f7f7;
$gray-100: #f5f5f5;
$gray-150: #ededed;
$gray-200: #e5e5e5;
$gray-250: #dddddd;
$gray-300: #d4d4d4;
$gray-350: #bcbcbc;
$gray-400: #a3a3a3;
$gray-450: #8b8b8b;
$gray-500: #737373;
$gray-550: #636363;
$gray-600: #525252;
$gray-650: #494949;
$gray-700: #404040;
$gray-750: #333333;
$gray-800: #262626;
$gray-850: #1f1f1f;
$gray-900: #171717;
$gray-1000: #000;
html[data-theme="light"] {
--color-text: #{$gray-900};
--color-text-secondary: #{$gray-500};
--color-text-footer: #{$gray-500};
--color-border: #{$gray-300};
--color-border-collapsible-menu: #{$gray-200};
--color-background: #{$gray-0};
--color-background-hover: #{$gray-50};
--color-background-overlay: #{$gray-150};
--color-background-inline-code: #{$gray-100};
--color-background-card: #{$gray-0};
--color-background-mark: #fff1a7;
--color-link: #2563eb;
--color-navbar-item-inactive: #{$gray-400};
--color-navbar-item-active: #{$gray-900};
--color-navbar-item-in-section: #{$gray-600};
}
html[data-theme="dark"] {
--color-text: #{$gray-150};
--color-text-secondary: #{$gray-450};
--color-text-footer: #{$gray-400};
--color-border: #{$gray-500};
--color-border-collapsible-menu: #{$gray-550};
--color-background: #{$gray-750};
--color-background-hover: #{$gray-600};
--color-background-overlay: #{$gray-700};
--color-background-inline-code: #{$gray-600};
--color-background-card: #{$gray-700};
--color-background-mark: #fff1a7;
--color-link: #93c5fd;
--color-navbar-item-inactive: #{$gray-400};
--color-navbar-item-active: #{$gray-100};
--color-navbar-item-in-section: #{$gray-250};
}
// Default color settings
html {
color: var(--color-text);
background: var(--color-background);
font-size: 16px;
}
a {
color: var(--color-link);
text-decoration: none;
}

View File

@@ -0,0 +1,19 @@
.breadcrumbs {
@include font-bold;
list-style-type: none;
padding: 0;
margin: 0;
a {
color: var(--color-text);
border-bottom: 2px solid transparent;
&:hover {
border-bottom-color: var(--color-text-secondary);
}
}
li {
display: inline;
}
}

View File

@@ -0,0 +1,54 @@
#TableOfContents {
line-height: 1.5rem;
ul, li {
list-style: none;
padding-left: 0;
margin: 0;
}
ul ul {
margin-left: .5rem;
}
li {
margin-top: .375rem;
}
a {
color: var(--color-text);
}
}
article#collapsible_menu_changelogs {
line-height: 1.75rem;
display: grid;
gap: .5rem;
grid-template-columns: max-content 1fr;
margin-top: .5rem;
}
.collapsible-menu-wrapper {
@include my-8;
font-size: 0.875rem;
padding: 1rem;
border: 2px solid var(--color-border-collapsible-menu);
border-radius: .25rem;
.collapsible-menu-type {
span {
@include font-bold;
line-height: 1.5rem;
}
}
summary.collapsible-menu-type {
span {
margin-left: .3rem;
}
}
.collapsible-menu {
margin-left: .5rem;
}
}

View File

@@ -0,0 +1,4 @@
.color-block {
border-radius: 0.25rem;
padding: 0.75rem;
}

View File

@@ -0,0 +1,70 @@
.emgithub-container {
@include my-6;
.emgithub-code {
display: flex;
flex-direction: column;
justify-content: center;
.emgithub-loading {
@include mx-auto;
@include my-4;
z-index: 10;
position: absolute;
left: 0;
right: 0;
width: 2rem;
&.hide {
display: none;
}
svg {
width: 2rem;
height: 2rem;
animation: spin 1s linear infinite;
color: white;
fill: #969696;
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
}
}
.emgithub-pre {
@include my-0;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 0px;
&.loading {
min-height: 5rem;
}
code {
tab-size: inherit;
}
}
}
.emgithub-toolbar {
@include text-xs;
display: flex;
flex-direction: row;
justify-content: space-between;
padding: 0.75rem 0.75rem 0.625rem 0.75rem;
border-bottom-right-radius: 0.375rem;
border-bottom-left-radius: 0.375rem;
background-color: $gray-900;
a {
@include font-semibold;
color: white;
border: 0;
}
}
}

View File

@@ -0,0 +1,6 @@
footer {
@include my-4;
@include text-xs;
text-align: center;
color: var(--color-text-footer);
}

View File

@@ -0,0 +1,79 @@
html[data-theme="dark"] {
#dark_mode_btn {
display: none;
}
}
html[data-theme="light"] {
#light_mode_btn {
display: none;
}
}
header {
display: flex;
justify-content: space-between;
align-items: center;
margin: 1rem 0;
.brand {
display: flex;
align-items: center;
a {
@include text-3xl;
@include font-bold;
color: var(--color-text);
}
#sidebar_btn {
display: flex;
margin-right: 0.5rem;
@media screen and (min-width: $md_min_width) {
display: none;
}
}
}
.toolbox {
display: flex;
align-items: center;
column-gap: 0.5rem;
.toolbox-btn {
display: flex;
cursor: pointer;
&:hover {
color: var(--color-text-secondary);
}
}
.dropdown-wrapper {
.dropdown-btn.pure-menu-link {
color: unset;
}
.dropdown-btn {
display: flex;
align-items: center;
padding: 0;
&:hover {
background-color: unset;
}
&::after {
content: "";
padding: 0;
}
.dropdown-desc {
@include text-sm;
margin-left: 0.35rem;
}
}
}
}
}

View File

@@ -0,0 +1,6 @@
.icon-group {
@include my-4;
display: inline-grid;
grid-auto-flow: column;
gap: 0.375rem;
}

View File

@@ -0,0 +1,13 @@
.icon {
display: inline-block;
width: 1.5rem;
height: 1.5rem;
a {
color: var(--color-text);
&:hover {
color: var(--color-text-secondary);
}
}
}

View File

@@ -0,0 +1,202 @@
/*!
Pure v2.1.0
Copyright 2013 Yahoo!
Licensed under the BSD License.
https://github.com/pure-css/pure/blob/master/LICENSE
*/
/*csslint adjoining-classes: false, box-model:false*/
.pure-menu {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.pure-menu-fixed {
position: fixed;
left: 0;
top: 0;
z-index: 3;
}
.pure-menu-list, .pure-menu-item {
position: relative;
}
.pure-menu-list {
list-style: none;
margin: 0;
padding: 0;
}
.pure-menu-item {
padding: 0;
margin: 0;
height: 100%;
@include text-sm;
}
.pure-menu-link, .pure-menu-heading {
display: block;
text-decoration: none;
white-space: nowrap;
}
/* HORIZONTAL MENU */
.pure-menu-horizontal {
width: 100%;
white-space: nowrap;
.pure-menu-list {
display: inline-block;
}
.pure-menu-item, .pure-menu-heading, .pure-menu-separator {
display: inline-block;
vertical-align: middle;
}
}
/* Initial menus should be inline-block so that they are horizontal */
/* Submenus should still be display: block; */
.pure-menu-item .pure-menu-item {
display: block;
}
.pure-menu-children {
display: none;
position: absolute;
left: 100%;
top: 0;
margin: 0;
padding: 0;
z-index: 3;
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.pure-menu-horizontal .pure-menu-children {
left: 0;
top: auto;
width: inherit;
}
.pure-menu-allow-hover:hover > .pure-menu-children, .pure-menu-active > .pure-menu-children {
display: block;
position: absolute;
}
/* Vertical Menus - show the dropdown arrow */
.pure-menu-has-children > .pure-menu-link:after {
padding-left: 0.35rem;
font-family: sans-serif;
content: "";
}
/* Horizontal Menus - show the dropdown arrow */
.pure-menu-horizontal .pure-menu-has-children > .pure-menu-link:after {
font-family: sans-serif;
content: "";
}
/* scrollable menus */
.pure-menu-scrollable {
overflow-y: scroll;
overflow-x: hidden;
.pure-menu-list {
display: block;
}
}
.pure-menu-horizontal.pure-menu-scrollable {
.pure-menu-list {
display: inline-block;
}
white-space: nowrap;
overflow-y: hidden;
overflow-x: auto;
/* a little extra padding for this style to allow for scrollbars */
padding: .5em 0;
}
/* misc default styling */
.pure-menu-separator {
background-color: #ccc;
height: 1px;
margin: .3em 0;
}
.pure-menu-horizontal {
.pure-menu-children .pure-menu-separator {
background-color: #ccc;
height: 1px;
margin: .3em 0;
}
.pure-menu-separator {
width: 1px;
height: 1.3em;
margin: 0 0.3em;
}
.pure-menu-children .pure-menu-separator {
display: block;
width: auto;
}
}
/* Need to reset the separator since submenu is vertical */
.pure-menu-heading {
text-transform: uppercase;
color: var(--color-text);
}
.pure-menu-link {
color: var(--color-text);
@include text-sm;
}
.pure-menu-children {
background-color: var(--color-background);
}
.pure-menu-link, .pure-menu-heading {
padding: .5rem;
}
.pure-menu-disabled {
opacity: .5;
.pure-menu-link:hover {
background-color: transparent;
cursor: default;
}
}
.pure-menu-active > .pure-menu-link {
background-color: var(--color-background-hover);
}
.pure-menu-link {
&:hover, &:focus {
background-color: var(--color-background-hover);
}
}
.pure-menu-selected > .pure-menu-link {
color: var(--color-navbar-item-active);
&:visited {
color: var(--color-navbar-item-active);
}
}

View File

@@ -0,0 +1,62 @@
#navbar {
margin: 1rem 0;
@media screen and (max-width: $md_min_width) {
display: none;
}
> ul.pure-menu-list {
display: flex;
.navbar-dropdown {
> a.pure-menu-link:after {
content: "";
}
> ul.pure-menu-children {
left: 0;
top: 27px;
width: inherit;
}
}
.navbar-item {
margin: 0 .5rem 0 0;
border-bottom: 2px solid transparent;
> a.pure-menu-link {
@include font-medium;
padding: 0 0 .3rem 0;
color: var(--color-navbar-item-inactive);
&:hover {
background-color: transparent;
}
}
&:hover {
border-bottom-color: var(--color-navbar-item-active);
> a {
color: var(--color-navbar-item-active);
}
}
}
.navbar-item.active {
border-bottom-color: var(--color-navbar-item-active);
> a {
color: var(--color-navbar-item-active);
}
}
.navbar-item.insection {
border-bottom-color: var(--color-navbar-item-in-section);
> a {
color: var(--color-navbar-item-in-section);
}
}
}
}

View File

@@ -0,0 +1,37 @@
.pagination {
padding: 0;
margin: 0;
list-style: none;
li {
display: inline;
margin: 0 .1rem;
}
a, span {
color: var(--color-text-secondary);
}
li.active a {
@include font-semibold;
color: var(--color-text);
}
li:not(.disabled) a:hover {
color: var(--color-text);
span {
color: inherit;
}
}
.disabled {
cursor: not-allowed;
}
}
.postcard-layout {
.pagination {
text-align: center;
}
}

View File

@@ -0,0 +1,101 @@
#search_menu_wrapper {
display: flex;
justify-content: center;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 40;
background-color: rgba(0,0,0,.75);
mark {
background-color: unset;
color: unset;
border-bottom: 2px solid var(--color-text);
}
#search_menu {
position: fixed;
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
border-radius: 0;
background-color: var(--color-background);
@media screen and (min-width: $sm_min_width) {
height: auto;
top: 6rem;
bottom: 6rem;
width: 30rem;
z-index: 50;
border-radius: 0.375rem;
}
#search_menu_toolbar {
display: flex;
min-height: 2.5rem;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
#search_menu_input_wrapper {
display: flex;
flex-grow: 1;
input {
@include px-4;
flex-grow: 1;
border-top-left-radius: 0.375rem;
}
input:focus {
outline: 2px solid transparent;
outline-offset: 2px;
}
}
#search_menu_close_btn {
display: flex;
align-items: center;
justify-content: center;
width: 2.5rem;
border-top-right-radius: 0.375rem;
cursor: pointer;
&:hover {
background-color: var(--color-background-overlay);
}
}
}
#search_menu_results {
flex-grow: 1;
overflow-y: auto;
.search-menu-result-item {
@include px-4;
padding-top: 0.875rem;
padding-bottom: 0.875rem;
min-height: 2.5rem;
&:hover {
background-color: var(--color-background-overlay);
}
.search-menu-result-item-title {
@include font-bold;
line-height: 1.7rem;
color: var(--color-text);
}
.search-menu-result-item-content {
@include text-xs;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
color: var(--color-text-secondary);
}
}
}
}
}

View File

@@ -0,0 +1,50 @@
#sidebar_canvas_overlay {
background-color: rgba(0,0,0,.75);
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 10;
}
#sidebar {
position: fixed;
top: 0;
left: 0;
height: 100%;
z-index: 20;
background-color: var(--color-background);
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
transform: translateX(0);
transition: transform 0.2s;
overflow-y: auto;
width: 60%;
@media screen and (min-width: $sm_min_width) {
width: 40%;
}
ul {
list-style: none;
padding-left: 0;
margin: 0;
}
summary span {
margin-left: .2rem;
}
li {
margin: 1.2rem;
}
a {
color: var(--color-text);
}
}
#sidebar.close {
display: block;
transform: translateX(-100%);
}

View File

@@ -0,0 +1,5 @@
.term-item {
@include list-link-item;
margin-right: 0.375rem;
line-height: 1.7rem;
}

View File

@@ -0,0 +1,32 @@
@import 'purecss/base';
@import 'mixins/text';
@import 'mixins/margin';
@import 'mixins/padding';
@import 'mixins/items';
@import 'color';
@import 'vars';
@import 'base';
@import 'layout/article';
@import 'layout/bookcase';
@import 'layout/gallery';
@import 'layout/balloon';
@import 'layout/list';
@import 'layout/postcard';
@import 'layout/term';
@import 'components/header';
@import 'components/footer';
@import 'components/menus';
@import 'components/nav';
@import 'components/collapsible-menu';
@import 'components/emgithub';
@import 'components/terms-cloud';
@import 'components/icon';
@import 'components/breadcrumbs';
@import 'components/color-block';
@import 'components/icon-group';
@import 'components/search-menu';
@import 'components/sidebar';
@import 'components/pagination';

View File

@@ -0,0 +1,197 @@
article {
line-height: 1.7;
> *:first-child {
margin-top: 0;
}
> *:last-child {
margin-bottom: 0;
}
hr {
@include my-8;
}
p {
overflow-wrap: break-word;
}
li {
list-style-type: disc;
@include my-2;
p {
@include my-0;
}
}
ul, ol {
@include my-4;
padding-left: 1.3rem;
}
ol {
li {
list-style-type: decimal;
}
}
ul, ol {
@include my-2;
li:first-child {
margin-top: 0;
}
li:last-child {
margin-bottom: 0;
}
}
blockquote {
@include px-4;
@include my-6;
@include mx-0;
border-left: 2px solid var(--color-border);
p:first-child {
margin-top: 0;
}
p:last-child {
margin-bottom: 0;
}
blockquote {
@include my-0;
}
}
code { /* Inline code style */
border-radius: .25rem;
padding: .2rem .375rem .2rem .375rem;
background-color: var(--color-background-inline-code);
}
pre {
@include my-6;
padding: 1rem;
overflow-x: auto;
border-radius: .5rem;
background-color: $gray-850;
color: $gray-50;
code { /* Disable inline code style */
border-radius: 0;
padding: 0;
background-color: transparent;
}
}
pre.mc-prism.hide code { /* Smooth transition for prism.js */
opacity: 0;
}
pre.mc-prism code { /* Smooth transition for prism.js */
opacity: 1;
transition: opacity 0.1s ease-in;
}
.code-toolbar {
.toolbar-item {
@include mx-1;
}
}
.highlight {
@include my-6;
position: relative;
.code-toolbar {
padding: 0;
pre {
padding: 1rem;
border-radius: 0.375rem;
}
}
> div,
> pre {
padding: 0.75rem;
border-radius: 0.375rem;
overflow-x: auto;
pre {
padding: 0;
margin: 0;
border-radius: 0;
code { /* Disable inline code style */
border-radius: 0;
padding: 0;
background-color: transparent;
}
}
}
}
.copy-code-button {
@include text-xs;
position: absolute;
right: 0;
height: 1.5rem;
top: -1.5rem;
padding-left: 0.375rem;
padding-right: 0.375rem;
border-radius: .25rem;
cursor: pointer;
background-color: transparent;
display: flex;
align-items: center;
&:hover {
background-color: var(--color-background-hover);
}
}
table.mc-table {
@include my-6;
table-layout: auto;
border-collapse: collapse;
display: block;
overflow-x: auto;
td, th {
@include px-3;
@include py-2;
border: 1px solid var(--color-border);
}
}
figure {
@include my-4;
text-align: center;
figcaption {
@include my-2;
}
}
img {
@include mx-auto;
display: block;
}
}
html[data-theme='dark'] {
.twitter-tweet {
color: var(--color-text);
a {
color: var(--color-link);
}
}
}

View File

@@ -0,0 +1,152 @@
%balloon-item-base {
display: flex;
flex-direction: column;
@media screen and (min-width: $md_min_width) {
flex-direction: row;
}
}
%balloon-item-line-base {
width: 7rem;
display: flex;
flex-direction: column;
position: relative;
align-items: center;
@media screen and (max-width: $md_min_width) {
display: none;
}
}
%balloon-item-content-base {
display: flex;
flex: 1 1 0%;
margin-left: -12px;
@media screen and (max-width: $md_min_width) {
margin-left: 0;
}
}
.balloon-layout {
@media screen and (min-width: $md_min_width) {
margin-left: -1.75rem;
}
.balloon-head-item {
@extend %balloon-item-base;
width: 100%;
gap: 20px;
.balloon-head-item-desktop {
@extend %balloon-item-line-base;
}
.balloon-head-item-mobile {
width: 100%;
justify-content: center;
@media screen and (min-width: $md_min_width) {
display: none;
}
}
.balloon-head-item-img-light, .balloon-head-item-img-dark {
display: flex;
justify-content: center;
}
.balloon-head-item-img {
img {
width: 6rem;
height: 6rem;
}
.rounded {
border-radius: 9999px;
}
}
.balloon-head-item-content {
@extend %balloon-item-content-base;
margin: 0;
align-items: center;
@media screen and (max-width: $md_min_width) {
justify-content: center;
text-align: center;
}
}
}
.balloon-title-item {
@extend %balloon-item-base;
.balloon-title-item-line {
@extend %balloon-item-line-base;
}
.balloon-title-item-content {
@extend %balloon-item-content-base;
@media screen and (max-width: $md_min_width) {
justify-content: center;
text-align: center;
}
}
}
.balloon-card-item {
@extend %balloon-item-base;
.balloon-card-item-line {
@extend %balloon-item-line-base;
}
.balloon-card-item-content {
@extend %balloon-item-content-base;
@include text-sm;
overflow: auto;
border-radius: 0.375rem;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
background-color: var(--color-background-card);
padding: 1rem 1.2rem;
}
}
.balloon-dot {
width: .8rem;
height: .8rem;
border-radius: 1rem;
margin: 0.25rem 0;
border: 2px solid var(--color-text);
}
.balloon-line-container {
display: flex;
flex: 1 1 0%;
justify-content: center;
.balloon-line {
background-color: var(--color-text);
}
}
}
html[data-theme="dark"] {
.balloon-head-item {
.balloon-head-item-img-light {
display: none;
}
}
}
html[data-theme="light"] {
.balloon-head-item {
.balloon-head-item-img-dark {
display: none;
}
}
}

View File

@@ -0,0 +1,55 @@
.bookcase-layout {
display: grid;
gap: 1rem;
grid-template-columns: repeat(auto-fill, 8rem);
.bookcase-item {
figure {
position: relative;
margin: 0;
}
figcaption {
@include text-sm;
text-align: center;
margin-top: .7rem;
a {
color: var(--color-text);
}
}
img, .bookcase-item-overlay {
width: 8rem;
height: 12rem;
border-radius: 0.375rem;
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
object-fit: cover;
}
.bookcase-item-overlay {
position: absolute;
top: 0;
left: 0;
background-color: transparent;
opacity: 0.25;
&:hover {
background-color: var(--color-background-overlay);
}
}
}
}
html[data-theme="light"] {
.bookcase-item-img-dark {
display: none;
}
}
html[data-theme="dark"] {
.bookcase-item-img-light {
display: none;
}
}

View File

@@ -0,0 +1,46 @@
.gallery-layout {
figure {
@media screen and (min-width: $md_min_width) {
margin-left: -1.25rem;
margin-right: -1.25rem;
}
img {
@include mx-auto;
}
}
figcaption {
@include my-2;
@include text-xs;
font-style: italic;
text-align: center;
}
.gallery-item {
margin-bottom: 4rem;
}
.gallery-item-title {
margin: 1rem 0;
a {
@include list-link-item;
}
span {
@include text-3xl;
@include font-bold;
}
}
.gallery-item-content {
@include my-4;
}
.gallery-item-statistic {
display: grid;
gap: 0.5rem;
grid-template-columns: max-content 1fr;
}
}

View File

@@ -0,0 +1,21 @@
ul.list-layout {
list-style: none;
padding: 0;
li {
margin-bottom: .5rem;
line-height: 1.625;
display: list-item;
list-style-type: none;
a {
@include list-link-item;
line-height: 1.7rem;
}
span {
@include text-xs;
color: var(--color-text-secondary);
}
}
}

View File

@@ -0,0 +1,36 @@
.postcard-layout {
a {
color: var(--color-text);
}
.postcard-item {
padding: 1rem;
background-color: var(--color-background-card);
border-radius: .375rem;
margin: 2rem 0;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
&:hover {
background-color: var(--color-background-hover);
}
.postcard-title {
@include text-xl;
@include font-medium;
}
.postcard-summary {
@include text-xs;
color: var(--color-text-secondary);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin: .5rem 0;
}
.postcard-metadata {
@include text-xs;
color: var(--color-text-secondary);
}
}
}

View File

@@ -0,0 +1,10 @@
.term-title {
display: flex;
align-items: center;
gap: 8px;
margin: 2rem 0;
h1 {
margin: 0;
}
}

View File

@@ -0,0 +1,8 @@
@mixin list-link-item {
color: var(--color-text);
border-bottom: 2px solid var(--color-border);
&:hover {
border-bottom-color: var(--color-text-secondary);
}
}

View File

@@ -0,0 +1,49 @@
@mixin my-0 {
margin-top: 0;
margin-bottom: 0;
}
@mixin my-2 {
margin-top: .5rem;
margin-bottom: .5rem;
}
@mixin my-4 {
margin-top: 1rem;
margin-bottom: 1rem;
}
@mixin my-6 {
margin-top: 1.5rem;
margin-bottom: 1.5rem;
}
@mixin my-8 {
margin-top: 2rem;
margin-bottom: 2rem;
}
@mixin mx-auto {
margin-left: auto;
margin-right: auto;
}
@mixin mx-0 {
margin-left: 0;
margin-right: 0;
}
@mixin mx-1 {
margin-left: 0.25rem;
margin-right: 0.25rem;
}
@mixin mx-2 {
margin-left: .5rem;
margin-right: .5rem;
}
@mixin mx-4 {
margin-left: 1rem;
margin-right: 1rem;
}
@mixin mx-6 {
margin-left: 1.5rem;
margin-right: 1.5rem;
}
@mixin mx-8 {
margin-left: 2rem;
margin-right: 2rem;
}

View File

@@ -0,0 +1,45 @@
@mixin py-0 {
padding-top: 0;
padding-bottom: 0;
}
@mixin py-2 {
padding-top: .5rem;
padding-bottom: .5rem;
}
@mixin py-4 {
padding-top: 1rem;
padding-bottom: 1rem;
}
@mixin py-6 {
padding-top: 1.5rem;
padding-bottom: 1.5rem;
}
@mixin py-8 {
padding-top: 2rem;
padding-bottom: 2rem;
}
@mixin px-0 {
padding-left: 0;
padding-right: 0;
}
@mixin px-2 {
padding-left: .5rem;
padding-right: .5rem;
}
@mixin px-3 {
padding-left: .75rem;
padding-right: .75rem;
}
@mixin px-4 {
padding-left: 1rem;
padding-right: 1rem;
}
@mixin px-6 {
padding-left: 1.5rem;
padding-right: 1.5rem;
}
@mixin px-8 {
padding-left: 2rem;
padding-right: 2rem;
}

View File

@@ -0,0 +1,56 @@
@mixin text-xs {
font-size: 0.75rem; /* 12px */
line-height: 1rem; /* 16px */
}
@mixin text-sm {
font-size: 0.875rem; /* 14px */
line-height: 1.25rem; /* 20px */
}
@mixin text-base {
font-size: 1rem; /* 16px */
line-height: 1.5rem; /* 24px */
}
@mixin text-lg {
font-size: 1.125rem; /* 18px */
line-height: 1.75rem; /* 28px */
}
@mixin text-xl {
font-size: 1.25rem; /* 20px */
line-height: 1.75rem; /* 28px */
}
@mixin text-2xl {
font-size: 1.375rem; /* 22px */
line-height: 1.875rem; /* 30px */
}
@mixin text-3xl {
font-size: 1.5rem; /* 24px */
line-height: 2rem; /* 32px */
}
@mixin font-thin {
font-weight: 100;
}
@mixin font-extralight {
font-weight: 200;
}
@mixin font-light {
font-weight: 300;
}
@mixin font-normal {
font-weight: 400;
}
@mixin font-medium {
font-weight: 500;
}
@mixin font-semibold {
font-weight: 600;
}
@mixin font-bold {
font-weight: 700;
}
@mixin font-extrabold {
font-weight: 800;
}
@mixin font-black {
font-weight: 900;
}

View File

@@ -0,0 +1,431 @@
/*!
Pure v2.1.0
Copyright 2013 Yahoo!
Licensed under the BSD License.
https://github.com/pure-css/pure/blob/master/LICENSE
*/
/*!
normalize.css v | MIT License | git.io/normalize
Copyright (c) Nicolas Gallagher and Jonathan Neal
*/
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15;
/* 1 */
-webkit-text-size-adjust: 100%;
/* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
-webkit-box-sizing: content-box;
box-sizing: content-box;
/* 1 */
height: 0;
/* 1 */
overflow: visible;
/* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none;
/* 1 */
text-decoration: underline;
/* 2 */
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
/* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b, strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code, kbd, samp {
font-family: monospace, monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub, sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button, input, optgroup, select, textarea {
font-family: inherit;
/* 1 */
font-size: 100%;
/* 1 */
line-height: 1.15;
/* 1 */
margin: 0;
/* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button, input {
/* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button, select {
/* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button, [type="button"], [type="reset"], [type="submit"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner, [type="button"]::-moz-focus-inner, [type="reset"]::-moz-focus-inner, [type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring, [type="button"]:-moz-focusring, [type="reset"]:-moz-focusring, [type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
-webkit-box-sizing: border-box;
box-sizing: border-box;
/* 1 */
color: inherit;
/* 2 */
display: table;
/* 1 */
max-width: 100%;
/* 1 */
padding: 0;
/* 3 */
white-space: normal;
/* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type="checkbox"], [type="radio"] {
-webkit-box-sizing: border-box;
box-sizing: border-box;
/* 1 */
padding: 0;
/* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"] {
&::-webkit-inner-spin-button, &::-webkit-outer-spin-button {
height: auto;
}
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield;
/* 1 */
outline-offset: -2px;
/* 2 */
&::-webkit-search-decoration {
-webkit-appearance: none;
}
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button;
/* 1 */
font: inherit;
/* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template, [hidden] {
display: none;
}
/**
* Add the correct display in IE 10.
*/
/*csslint important:false*/
/* ==========================================================================
Pure Base Extras
========================================================================== */
/**
* Extra rules that Pure adds on top of Normalize.css
*/
html {
font-family: sans-serif;
}
/**
* Always hide an element when it has the `hidden` HTML attribute.
*/
.hidden, [hidden] {
display: none !important;
}
/**
* Add this class to an image to make it fit within it's fluid parent wrapper while maintaining
* aspect ratio.
*/
.pure-img {
max-width: 100%;
height: auto;
display: block;
}

View File

@@ -0,0 +1,12 @@
$sm_min_width: 35.5rem;
$md_min_width: 48rem;
$lg_min_width: 64rem;
$xl_min_width: 80rem;
$xxl_min_width: 120rem;
$sm_main_width: 100%;
$md_main_width: 80%;
$lg_main_width: 55%;
$xl_main_width: 55%;
$xxl_main_width: 55%;