Switch themes to minimo

This commit is contained in:
Dave Gallant
2021-09-06 11:55:05 -04:00
parent 75f9797c91
commit 4ff7aec7c1
302 changed files with 17841 additions and 607 deletions

View File

@@ -0,0 +1,33 @@
const commentList = document.querySelector('.comment-list')
const respondBlock = document.querySelector('#respond')
const commentForm = respondBlock.querySelector('form')
const cancelReplyLink = respondBlock.querySelector('#cancel-comment-reply-link')
const parentIdInput = respondBlock.querySelector('[name="fields[parent_id]"]')
const moveRespondBlock = commentId => {
if (!commentId) return
const comment = commentList.querySelector(`#comment-${commentId} article`)
parentIdInput.value = commentId
comment.parentNode.insertBefore(respondBlock, comment.nextSibling)
cancelReplyLink.style.display = ''
commentForm.querySelector('textarea').focus()
return false
}
export const initComments = () => {
cancelReplyLink.style.display = 'none'
cancelReplyLink.addEventListener('click', e => {
e.preventDefault()
parentIdInput.value = ''
commentList.parentNode.appendChild(respondBlock)
cancelReplyLink.style.display = 'none'
})
window.moveRespondBlock = moveRespondBlock
}

View File

@@ -0,0 +1,36 @@
const body = document.body
const detailsTagSupported = () => {
let el = document.createElement('details')
if (!('open' in el)) return false
el.innerHTML = '<summary>a</summary>b'
body.appendChild(el)
let diff = el.offsetHeight
el.open = true
let result = diff != el.offsetHeight
body.removeChild(el)
return result
}
export const detailsPolyfill = detailsElements => {
if (!detailsTagSupported()) {
body.classList.add('no-details')
detailsElements.forEach(detailsElement => {
let summaryElement = detailsElement.querySelector('summary')
summaryElement.addEventListener('click', () => {
if (detailsElement.getAttribute('open')) {
detailsElement.open = false
detailsElement.removeAttribute('open')
} else {
detailsElement.open = true
detailsElement.setAttribute('open', 'open')
}
})
})
}
}

View File

@@ -0,0 +1,17 @@
export const shuffle = array => {
let shuffled = [...array],
currIndex = array.length,
tempValue,
randIndex
while (currIndex) {
randIndex = Math.floor(Math.random() * currIndex)
currIndex--
tempValue = shuffled[currIndex]
shuffled[currIndex] = shuffled[randIndex]
shuffled[randIndex] = tempValue
}
return shuffled
}

View File

@@ -0,0 +1,50 @@
import './webpack-public-path'
import '../stylesheets/style'
import docReady from 'es6-docready'
import { shuffle } from './helpers'
docReady(() => {
const body = document.body
const taxonomyClouds = body.querySelectorAll(
'.taxonomy-cloud:not(.no-shuffle)'
)
if (taxonomyClouds.length) {
taxonomyClouds.forEach(taxonomyCloud => {
let terms = taxonomyCloud.querySelectorAll('li')
shuffle(terms).forEach(term => term.parentElement.appendChild(term))
})
}
const detailsElements = body.querySelectorAll('details')
if (detailsElements.length) {
import(/* webpackChunkName: "details-polyfill" */ './details-polyfill').then(
({ detailsPolyfill }) => detailsPolyfill(detailsElements)
)
}
let hasEmoji = body.classList.contains('has-emoji')
if (hasEmoji) {
let entry = body.querySelector('.entry')
import(/* webpackChunkName: "twemoji" */ 'twemoji').then(twemoji =>
twemoji.parse(entry)
)
}
let hasSidebar = body.classList.contains('has-sidebar')
if (hasSidebar) {
import(/* webpackChunkName: "sidebar" */ './sidebar').then(
({ initSidebar }) => initSidebar()
)
}
let hasComments = body.querySelector('#comment-form')
if (hasComments) {
import(/* webpackChunkName: "comments" */ './comments').then(
({ initComments }) => initComments()
)
}
})

View File

@@ -0,0 +1,47 @@
import algoliasearch from 'algoliasearch/lite'
import {
appendResults,
getUrlSearchParam,
setSearchingIndicator
} from './helpers'
const { appId, indexName, searchApiKey } = window.algolia
const client = algoliasearch(appId, searchApiKey)
const index = client.initIndex(
`${indexName}${window.location.pathname.replace('/search/', '')}`
)
const doSearch = (term, resultsBlock) => {
setSearchingIndicator(resultsBlock)
if (!term) {
appendResults([], resultsBlock)
} else {
index.search(
term,
{ attributesToRetrieve: ['title', 'href'], hitsPerPage: 10 },
(err, content) => {
if (err) console.error(err)
else appendResults(content.hits, resultsBlock)
}
)
}
}
const searchForm = document.getElementById('search-form')
const searchInputBox = document.getElementById('search-term')
const resultsBlock = document.getElementById('search-results')
let term = getUrlSearchParam('q')
searchInputBox.value = term
searchInputBox.focus()
doSearch(term, resultsBlock)
searchForm.addEventListener('submit', e => {
e.preventDefault()
doSearch(searchInputBox.value, resultsBlock)
})

View File

@@ -0,0 +1,54 @@
import Fuse from 'fuse.js'
import {
appendResults,
getJSON,
getUrlSearchParam,
setSearchingIndicator
} from './helpers'
const doSearch = (term, fuse, resultsBlock) => {
setSearchingIndicator(resultsBlock)
let results = term
? fuse
.search(term)
.map(result => ({ href: result.href, title: result.title }))
: []
appendResults(results, resultsBlock)
}
const options = {
shouldSort: true,
threshold: 0.5,
location: 0,
distance: 500,
maxPatternLength: 32,
minMatchCharLength: 1,
keys: [{ name: 'title', weight: 0.7 }, { name: 'content', weight: 0.3 }]
}
const searchInputBox = document.getElementById('search-term')
const resultsBlock = document.getElementById('search-results')
let term = getUrlSearchParam('q')
searchInputBox.value = term
searchInputBox.focus()
setSearchingIndicator(resultsBlock)
getJSON(`${window.location.pathname}index.json`, (err, list) => {
if (err) {
console.error(err)
return
}
let fuse = new Fuse(list, options)
doSearch(term, fuse, resultsBlock)
searchInputBox.addEventListener('input', e => {
doSearch(e.target.value, fuse, resultsBlock)
})
})

View File

@@ -0,0 +1,52 @@
export const appendResults = (results, resultsBlock) => {
if (results.length === 0) {
resultsBlock.innerHTML = `<li class='results-empty'>
<a href='#search-term'>${resultsBlock.dataset.resultsEmpty}</a>
</li>`
} else {
resultsBlock.innerHTML = results.reduce((prevItem, { href, title }) => {
return `${prevItem}<li><a href='${href}'>${title}</a></li>`
}, '')
}
}
export const setSearchingIndicator = resultsBlock => {
resultsBlock.innerHTML = `<li class='searching'>
<a href='#search-results'>${resultsBlock.dataset.searching}&hellip;</a>
</li>`
}
export const getUrlSearchParam = name => {
if ('URLSearchParams' in window) {
let urlParams = new URLSearchParams(window.location.search)
return urlParams.get(name)
} else {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]')
let regex = new RegExp('[\\?&]' + name + '=([^&#]*)')
let results = regex.exec(location.search)
return results === null
? ''
: decodeURIComponent(results[1].replace(/\+/g, ' '))
}
}
export const getJSON = (url, callback) => {
let request = new XMLHttpRequest()
request.open('GET', url, true)
request.onload = () => {
if (request.status >= 200 && request.status < 400) {
let data = JSON.parse(request.responseText)
callback(null, data)
} else {
callback(new Error(request.statusText))
}
}
request.onerror = () => {
callback(new Error(`Failed to get JSON! ${request.statusText}`))
}
request.send()
}

View File

@@ -0,0 +1,34 @@
import lunr from 'lunr'
import {
appendResults,
getUrlSearchParam,
setSearchingIndicator
} from './helpers'
const doSearch = (term, idx, pageTitles, resultsBlock) => {
setSearchingIndicator(resultsBlock)
let results = term
? idx
.search(term)
.map(result => ({ href: result.ref, title: pageTitles[result.ref] }))
: []
appendResults(results, resultsBlock)
}
const idx = lunr.Index.load(window.lunr_idx)
const pageTitles = window.page_titles
const searchInputBox = document.getElementById('search-term')
const resultsBlock = document.getElementById('search-results')
let term = getUrlSearchParam('q')
searchInputBox.value = term
searchInputBox.focus()
doSearch(term, idx, pageTitles, resultsBlock)
searchInputBox.addEventListener('input', e => {
doSearch(e.target.value, idx, pageTitles, resultsBlock)
})

View File

@@ -0,0 +1,127 @@
const body = document.body
const sidebar = body.querySelector('#sidebar')
const expandButton = body.querySelector('#sidebar-toggler')
const overlay = body.querySelector('.sidebar-overlay')
const sidebarMenu = body.querySelector('#sidebar-menu')
const collapseButton = expandButton.cloneNode(true)
collapseButton.setAttribute('id', '#sidebar-collapse')
const setAriaExpanded = (items, value) => {
items.forEach(item => item.setAttribute('aria-expanded', value))
}
const hideSidebar = () => {
sidebar.classList.remove('toggled')
setAriaExpanded([sidebar, expandButton, collapseButton], false)
}
const showSidebar = () => {
sidebar.classList.add('toggled')
setAriaExpanded([sidebar, expandButton, collapseButton], true)
sidebar.focus()
}
let windowWidth,
windowHeight,
bodyHeight,
sidebarHeight,
windowPos,
lastWindowPos = 0,
top = false,
bottom = false,
topOffset = 0,
sidebarOffsetTop,
resizeTimer
const resizeHandler = () => {
windowWidth = window.innerWidth
windowHeight = window.innerHeight
}
const scrollHandler = () => {
windowPos = window.scrollY
bodyHeight = body.offsetHeight
sidebarHeight = sidebar.offsetHeight
sidebarOffsetTop = Math.round(windowPos + sidebar.getBoundingClientRect().top)
if (sidebarHeight > windowHeight) {
if (windowPos > lastWindowPos) {
if (top) {
top = false
topOffset = sidebarOffsetTop > 0 ? sidebarOffsetTop : 0
sidebar.setAttribute('style', `top: ${topOffset}px;`)
} else if (
!bottom &&
windowPos + windowHeight > sidebarHeight + sidebarOffsetTop &&
sidebarHeight < bodyHeight
) {
bottom = true
sidebar.setAttribute('style', 'position: fixed; bottom: 0;')
}
} else if (windowPos < lastWindowPos) {
if (bottom) {
bottom = false
topOffset = sidebarOffsetTop > 0 ? sidebarOffsetTop : 0
sidebar.setAttribute('style', `top: ${topOffset}px;`)
} else if (!top && windowPos < sidebarOffsetTop) {
top = true
sidebar.setAttribute('style', 'position: fixed;')
}
} else {
top = bottom = false
topOffset = sidebarOffsetTop ? sidebarOffsetTop : 0
sidebar.setAttribute('style', `top: ${topOffset}px;`)
}
} else if (!top) {
top = true
sidebar.setAttribute('style', 'position: fixed;')
}
lastWindowPos = windowPos
}
const resizeAndScrollHandler = () => {
resizeHandler()
scrollHandler()
}
const initSidebarMenu = () => {
let itemsWithSubmenu = sidebarMenu.querySelectorAll('.item.has-children')
itemsWithSubmenu.forEach(item => {
let toggler = item.querySelector('button')
let submenu = item.querySelector('.sub-menu')
setAriaExpanded([submenu, toggler], false)
toggler.addEventListener('click', () => {
let toggled = item.classList.contains('toggled')
item.classList[toggled ? 'remove' : 'add']('toggled')
setAriaExpanded([submenu, toggler], !toggled)
})
})
}
export const initSidebar = () => {
sidebar.setAttribute('tabindex', '-1')
sidebar.insertBefore(collapseButton, sidebar.children[1])
setAriaExpanded([sidebar, expandButton, collapseButton], false)
expandButton.addEventListener('click', showSidebar)
collapseButton.addEventListener('click', hideSidebar)
overlay.addEventListener('click', hideSidebar)
window.addEventListener('scroll', scrollHandler)
window.addEventListener('resize', () => {
clearTimeout(resizeTimer)
resizeTimer = setTimeout(resizeAndScrollHandler, 500)
})
resizeAndScrollHandler()
if (sidebarMenu) initSidebarMenu()
}

View File

@@ -0,0 +1 @@
__webpack_public_path__ = window.__assets_js_src

View File

@@ -0,0 +1,45 @@
html {
box-sizing: border-box;
}
*,
*:after,
*:before {
box-sizing: inherit;
}
blockquote,
q {
quotes: '' '';
&:after,
&:before {
content: '';
}
:last-child {
margin-bottom: 0;
}
}
hr {
border: 0;
height: 1px;
margin: 2em 0;
background-color: $color__background-hr;
}
img {
max-width: 100%;
height: auto;
}
figure {
margin: 1em 0;
}
@import 'links';
@import 'lists';
@import 'tables';

View File

@@ -0,0 +1,25 @@
a {
color: $color__link;
text-decoration: none;
transition: color 0.1s ease-in-out;
&:focus {
outline-color: $color__accent;
outline-color: var(--color-accent);
}
&:active,
&:hover {
outline: 0;
}
&:active,
&:focus,
&:hover {
color: $color__link-hover;
}
&.button {
display: inline-block;
}
}

View File

@@ -0,0 +1,34 @@
ol,
ul {
padding: 0;
margin: 0 0 1.5em 1.5em;
}
ul {
&.task-list {
list-style: none;
label {
font-weight: inherit;
}
input {
width: auto;
margin-left: -1.5em;
}
}
}
li ol,
li ul {
margin-bottom: 0;
margin-left: 1.5em;
}
dt {
font-weight: 700;
}
dd {
margin: 0 1.5em 1.5em;
}

View File

@@ -0,0 +1,35 @@
table,
td,
th {
border: 1px solid $color__border-table;
}
table {
width: 100%;
margin: 0 0 1.5em;
table-layout: fixed;
border-collapse: separate;
border-spacing: 0;
border-width: 1px 0 0 1px;
}
caption,
td,
th {
font-weight: 400;
text-align: left;
}
th {
border-width: 0 1px 1px 0;
font-weight: 700;
}
td {
border-width: 0 1px 1px 0;
}
td,
th {
padding: 0.375em;
}

View File

@@ -0,0 +1,31 @@
.screen-reader-text {
position: absolute;
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
height: 1px;
width: 1px;
margin: -1px;
padding: 0;
border: 0;
overflow: hidden;
word-wrap: normal !important;
&:focus {
display: block;
left: 0.5em;
top: 0.5em;
clip: auto;
clip-path: none;
height: auto;
width: auto;
padding: 1em;
border-radius: 0.25em;
@include font-size(0.875);
font-weight: 700;
line-height: normal;
text-decoration: none;
background: $color__background-screen;
color: $color__text-screen !important;
z-index: 100000;
}
}

View File

@@ -0,0 +1,3 @@
@import 'variables/variables';
@import 'mixins/mixins';

View File

@@ -0,0 +1,9 @@
@mixin font-size($size) {
font-size: #{$size}em;
}
@mixin screen($screenSize) {
@media screen and (min-width: #{$screenSize}) {
@content;
}
}

View File

@@ -0,0 +1,39 @@
$color__accent: #ffcd00;
$color__bluegrey-900: #263238;
$color__bluegrey-800: #37474f;
$color__bluegrey-700: #455a64;
$color__grey-900: #212121;
$color__grey-400: #bdbdbd;
$color__grey-200: #eeeeee;
$color__grey-50: #fafafa;
$color__pure-black: #000000;
$color__black: $color__grey-900;
$color__grey: $color__grey-400;
$color__light-grey: $color__grey-200;
$color__white: $color__grey-50;
$color__pure-white: #ffffff;
$color__background-hr: $color__grey;
$color__background-screen: $color__black;
$color__background-code: $color__light-grey;
$color__text-heading: $color__bluegrey-900;
$color__text-main: $color__bluegrey-800;
$color__text-screen: $color__white;
$color__text-input: $color__text-main;
$color__text-code: $color__black;
$color__button-background: $color__pure-white;
$color__button-text: $color__text-main;
$color__blockquote-border: $color__grey;
$color__link: $color__black;
$color__link-hover: $color__text-main;
$color__border-input: $color__grey;
$color__border-table: $color__grey;
$color__border-code: darken($color__background-code, 7);

View File

@@ -0,0 +1,11 @@
$container__max-width: 740px;
$container__gutter: 20px;
$sidebar__width: 300px;
$max-width__cover-wide: 1080px;
$breakpoint-small: 480px;
$breakpoint-medium: 920px;
$transition-duration: 0.2s;

View File

@@ -0,0 +1,20 @@
$font-family__main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
Oxygen-Sans, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
$font-family__code: Menlo, Consolas, Monaco, 'Ubuntu Mono', 'Liberation Mono',
'Lucida Console', monospace;
$line-height__body: 1.5;
$line-height__heading: 1.2;
$font-size__base: 16px;
$font-size__h1: 2;
$font-size__h2: 1.75;
$font-size__h3: 1.5;
$font-size__h4: 1.375;
$font-size__h5: 1.25;
$font-size__h6: 1.125;
$font-size__main: 1;
$font-size__code: 0.9375;
$font-size__blockquote: 1.125;

View File

@@ -0,0 +1,5 @@
@import 'colors';
@import 'structure';
@import 'typography';

View File

@@ -0,0 +1,43 @@
.button,
button,
input[type='button'],
input[type='reset'],
input[type='submit'] {
width: auto;
padding: 0.5em 0.75em;
border: 1px solid $color__border-input;
border-radius: 0.2em;
background: $color__button-background;
color: $color__button-text;
@include font-size(1);
font-weight: 700;
line-height: 1.15;
text-align: center;
letter-spacing: 1px;
white-space: nowrap;
text-transform: uppercase;
user-select: none;
cursor: pointer;
transition: 0.1s ease-in-out;
&:focus {
outline-color: $color__accent;
outline-color: var(--color-accent);
}
&:active,
&:hover {
outline: 0;
}
&:active,
&:focus,
&:hover {
background: $color__button-text;
color: $color__button-background;
}
}

View File

@@ -0,0 +1,23 @@
input,
select,
textarea {
width: 100%;
padding: 0.625em 0.875em;
border: 1px solid $color__border-input;
border-radius: 0.2em;
color: $color__text-input;
transition: 0.1s ease-in-out;
&:focus {
border-color: $color__accent;
border-color: var(--color-accent);
outline-color: transparent;
}
}
input {
&[type='checkbox'],
&[type='radio'] {
width: auto;
}
}

View File

@@ -0,0 +1,8 @@
@import 'buttons';
@import 'fields';
label {
font-weight: 700;
letter-spacing: 1px;
}

View File

@@ -0,0 +1 @@
@import 'shortcodes/shortcodes';

View File

@@ -0,0 +1,17 @@
.align-center {
text-align: center;
& > blockquote {
display: inline-block;
}
& > ol,
& > ul {
display: inline-block;
text-align: initial;
}
li {
word-wrap: normal;
}
}

View File

@@ -0,0 +1,24 @@
.convo {
ol {
display: table;
list-style: none;
margin: 0;
}
li {
display: table-row;
& > div {
display: table-cell;
padding-bottom: 1.5em;
}
}
.person {
@include font-size(0.9);
font-style: italic;
text-align: right;
}
.sep {
padding-left: 0.75em;
padding-right: 0.5em;
}
}

View File

@@ -0,0 +1,3 @@
@import 'center';
@import 'convo';
@import 'text';

View File

@@ -0,0 +1,6 @@
.text-shortcode {
* {
color: inherit;
@include font-size(1);
}
}

View File

@@ -0,0 +1,22 @@
.footer {
.sep-before {
&:before {
border-bottom-color: $color__accent;
border-bottom-color: var(--color-accent);
}
}
a {
font-style: italic;
}
.container > div,
.container > section {
width: 100%;
margin-top: 1em;
&:first-child {
margin-top: 0;
}
}
}

View File

@@ -0,0 +1,38 @@
.header {
.sep-after {
&:after {
border-bottom-color: $color__accent;
border-bottom-color: var(--color-accent);
.has-cover & {
display: none;
}
}
}
}
.site-header {
display: none;
@at-root .home &,
.error404 & {
display: flex;
}
}
.header-info {
margin-top: 1.5em;
.title {
margin-bottom: 0;
}
.desc {
margin: 0.5em 0 0;
}
.taxonomy-name {
@include font-size(0.875);
margin-right: 0.25em;
font-style: italic;
}
}

View File

@@ -0,0 +1,67 @@
body {
background: $color__pure-white;
}
.site {
overflow-x: hidden;
}
.main {
width: 100%;
padding: 2em 0;
transition: margin-left $transition-duration;
.sidebar.toggled ~ & {
margin-left: $sidebar__width;
}
@include screen($breakpoint-medium) {
width: auto;
.has-sidebar & {
float: left;
width: calc(100% - #{$sidebar__width});
margin-left: $sidebar__width;
padding-left: 2em;
}
}
}
.container {
width: 100%;
max-width: $container__max-width;
padding: 0 $container__gutter;
margin: 0 auto;
.has-sidebar & {
margin-left: 0;
}
}
.sep {
&-after:after,
&-before:before {
content: '';
display: block;
width: 4em;
margin-top: 2.5em;
margin-bottom: 2.5em;
border-bottom: 0.125em solid $color__grey;
}
}
@import 'sidebar/sidebar';
@import 'header';
@import 'entry/entry';
@import 'lists';
@import 'footer';
@import 'others/others';
@import 'widgets/widgets';

View File

@@ -0,0 +1,59 @@
.list {
margin: 0 auto;
list-style: none;
&-container {
.entry + & {
margin-top: 2.5em;
}
}
.item {
display: flex;
width: 100%;
margin-top: 1em;
&:first-of-type {
margin-top: 0;
}
.meta {
flex: 0 0 6em;
span {
@include font-size(0.875);
}
}
&-header {
flex: 1;
}
&-title {
@include font-size(1);
font-weight: 400;
margin-bottom: 0;
line-height: inherit;
}
.icon {
margin-right: 0.25em;
}
}
}
/* Taxonomy Cloud */
.taxonomy-cloud {
display: flex;
flex-wrap: wrap;
align-items: center;
li {
max-width: 100%;
padding: 0 1.5em 0.5em 0;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
}

View File

@@ -0,0 +1,108 @@
.comments {
ol {
list-style: none;
&.comment-list {
margin: 0;
}
}
&-title {
@include font-size(1.25);
margin-bottom: 1.5em;
}
}
.comment {
position: relative;
margin: 1em 0;
&-header {
min-height: 3em;
}
.avatar {
float: left;
height: 3em;
width: 3em;
border-radius: 0.25em;
margin-right: 0.75em;
}
&-meta {
@include font-size(0.875);
}
.fn {
display: inline-block;
margin-top: 0.1em;
}
.says {
@extend .screen-reader-text;
}
.reply {
display: inline-block;
position: absolute;
right: 0;
margin-top: -2em;
a {
display: inline-block;
}
}
&-content {
margin-top: 0.75em;
border-radius: 0.25em;
border: 1px solid $color__grey;
padding: 1em;
padding-bottom: 2em;
@extend .entry-content;
}
&-respond {
margin: 1.5em 0;
}
&-reply-title {
small {
display: inline-block;
@include font-size(0.5);
margin-left: 1em;
}
}
&-form {
label {
display: inline-block;
margin-bottom: 0.25em;
}
& > div {
margin-top: 1em;
}
}
&-submission-feedback {
display: none;
position: relative;
border-radius: 0.25em;
border: 1px solid $color__grey;
padding: 1.5em;
margin-bottom: 1.5em;
a {
position: absolute;
top: 1.5em;
right: 1.5em;
@include font-size(0.875);
}
&:target {
display: block;
}
}
}

View File

@@ -0,0 +1,22 @@
.entry-content {
& > :last-child {
&,
& > :last-child {
margin-bottom: 0;
}
}
a {
border-bottom: 0.125em dashed $color__grey;
&:focus,
&:hover {
border-bottom-color: $color__accent;
border-bottom-color: var(--color-accent);
}
&.footnote-return {
border-bottom: none;
}
}
}

View File

@@ -0,0 +1,34 @@
.entry-cover {
figure {
margin-top: 2em;
margin-bottom: 2.5em;
}
img {
display: block;
}
figcaption {
text-align: center;
margin: 0.25em auto 0;
padding: 0;
span {
@include font-size(0.875);
}
}
}
.cover-wide {
padding: 0;
max-width: $max-width__cover-wide;
}
.cover-full {
padding: 0;
max-width: 100%;
img {
width: 100%;
}
}

View File

@@ -0,0 +1,6 @@
@import 'meta';
@import 'cover';
@import 'toc';
@import 'content';
@import 'footer';
@import 'comments';

View File

@@ -0,0 +1,13 @@
.entry-footer {
.container > div {
margin-top: 0.5em;
&:first-child {
margin-top: 2.5em;
}
}
.icon {
margin-right: 0.375em;
}
}

View File

@@ -0,0 +1,13 @@
.entry-meta {
margin-top: 0.75em;
span {
@include font-size(0.9375);
margin-right: 0.75em;
font-style: italic;
}
.icon {
margin-right: 0.25em;
}
}

View File

@@ -0,0 +1,42 @@
details,
summary {
display: block;
}
summary {
cursor: pointer;
}
.no-details {
details {
&:not([open]) > :not(summary) {
display: none;
}
& > summary:before {
content: '\25BC';
display: inline-block;
margin-right: 0.25em;
transition: 0.1s;
transform: rotate(-90deg);
}
&[open] > summary:before {
transform: rotate(0deg);
}
}
}
.entry-toc {
margin-bottom: 2.5em;
ul {
list-style: none;
}
nav {
& > ul {
margin: 0;
}
}
}

View File

@@ -0,0 +1,22 @@
.error404 {
.gopher {
margin: 0;
img {
width: 17.5em;
}
a {
display: block;
border: 0;
}
figcaption {
margin-top: 1em;
}
.title {
margin-bottom: 0;
}
}
}

View File

@@ -0,0 +1,20 @@
.layout-archive {
.list {
.item {
padding-left: 1em;
.meta {
flex: 0 0 3.5em;
}
}
}
}
.archive-group {
&.sep-after {
&:last-child {
&:after {
display: none;
}
}
}
}

View File

@@ -0,0 +1,11 @@
.home-widgets {
.sep-before {
&:before {
display: none;
.entry + & {
display: block;
}
}
}
}

View File

@@ -0,0 +1,18 @@
.icon {
display: inline-block;
height: 1em;
width: 1em;
stroke: currentColor;
fill: none;
position: relative;
top: 2px;
}
img.emoji {
height: 1em;
width: 1em;
margin: 0 0.05em 0 0.1em;
vertical-align: -0.1em;
}

View File

@@ -0,0 +1,9 @@
@import '404';
@import 'home';
@import 'icons';
@import 'archive';
@import 'search';

View File

@@ -0,0 +1,23 @@
.search-results {
li {
height: 2.5em;
line-height: 2em;
border: 1px solid $color__border-input;
border-top-width: 0;
&:last-child {
border-radius: 0 0 0.2em 0.2em;
}
&.results-empty,
&.searching {
font-style: italic;
}
a {
display: block;
padding: 0.25em 0.875em;
}
}
}

View File

@@ -0,0 +1,116 @@
.sidebar {
visibility: hidden;
float: left;
left: -$sidebar__width;
position: absolute;
width: $sidebar__width;
max-width: 100%;
min-height: 100%;
padding: 2em 0;
margin-right: -100%;
outline: 0;
z-index: 99999;
transition: left $transition-duration;
text-align: right;
background: $color__pure-white;
&.toggled {
visibility: visible;
left: 0;
}
.sep-after {
&:after {
margin-left: auto;
}
}
@include screen($breakpoint-medium) {
visibility: visible;
left: 0;
}
}
.sidebar-toggler {
background: none;
border: 0;
.icon {
@include font-size(1.25);
}
&:focus,
&:hover,
&:active {
background: none;
}
.main & {
padding: 0;
position: absolute;
right: $container__gutter;
&[aria-expanded='true'] {
display: none;
}
.close {
display: none;
}
}
.main-menu & {
position: static;
margin-right: 0.75em;
&[aria-expanded='true'] {
display: inline-block;
}
}
.sidebar & {
position: absolute;
top: 0.5em;
left: 0.5em;
z-index: 2027;
.open {
display: none;
}
}
@include screen($breakpoint-medium) {
display: none;
}
}
.sidebar-overlay {
display: none;
.sidebar.toggled & {
display: block;
&:after {
content: '';
display: block;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -2027;
background: $color__pure-white;
opacity: 0.75;
}
@include screen($breakpoint-medium) {
display: none;
}
}
}

View File

@@ -0,0 +1,26 @@
.widget-about {
.logo {
max-width: 5em;
a {
display: block;
line-height: 0;
}
.sidebar & {
margin-left: auto;
}
}
.site-title {
margin-bottom: 0;
@include font-size(1.75);
}
.sidebar &.sep-after {
&:after {
border-bottom-color: $color__accent;
border-bottom-color: var(--color-accent);
}
}
}

View File

@@ -0,0 +1,26 @@
.widget-breadcrumbs {
ol {
list-style: none;
margin: 0;
}
li {
display: inline-block;
&:after {
display: inline-block;
padding: 0 0.25em;
speak: none;
}
&:last-child {
&:after {
display: none;
}
}
span {
font-weight: bold;
}
}
}

View File

@@ -0,0 +1,11 @@
.widget-recent_posts {
.sidebar & {
.meta {
display: none;
}
.item {
margin-top: 0;
}
}
}

View File

@@ -0,0 +1,27 @@
.widget-search {
.search-form {
position: relative;
}
.search-submit {
position: absolute;
top: 0;
right: 0;
height: 2.5em;
width: 2.5em;
border-radius: 0 0.2em 0.2em 0;
}
.layout-search & {
header {
display: none;
}
.search-term {
height: 2.5em;
padding-right: 3em;
border-radius: 0.2em 0.2em 0 0;
}
}
}

View File

@@ -0,0 +1,26 @@
.widget-social_menu {
ul {
list-style: none;
margin: 0;
}
li {
display: inline-block;
margin-right: 0.625em;
&:last-child {
margin-right: 0;
}
a {
@include font-size(1.125);
}
}
.sidebar & {
li {
margin-right: 0;
margin-left: 0.625em;
}
}
}

View File

@@ -0,0 +1,13 @@
.widget-taxonomy_cloud {
.sidebar & {
.taxonomy-cloud {
justify-content: flex-end;
@include font-size(0.875);
}
li {
padding: 0 0 0.4em 0.8em;
}
}
}

View File

@@ -0,0 +1,42 @@
.widget {
&-title {
margin-bottom: 1em;
}
&.sep-after {
&:after {
margin-top: 1.5em;
margin-bottom: 1.5em;
}
&:last-of-type {
&:after {
display: none;
}
}
}
.sidebar & {
&-title {
margin-bottom: 0.5em;
@include font-size($font-size__h5);
}
.container {
padding: 0;
}
}
}
.header-widgets {
.main-menu + & {
margin-top: 1em;
}
}
@import 'about';
@import 'breadcrumbs';
@import 'recent-posts';
@import 'search';
@import 'social-menu';
@import 'taxonomy-cloud';

View File

@@ -0,0 +1,23 @@
.entry-nav {
.sep-before {
&:nth-child(2) {
&:before {
width: 2em;
margin: 1em 0;
}
}
}
div {
a {
display: block;
font-style: italic;
}
span {
display: block;
font-style: normal;
@include font-size(0.875);
}
}
}

View File

@@ -0,0 +1,5 @@
@import 'menus/menus';
@import 'entry-nav';
@import 'pagination';

View File

@@ -0,0 +1,24 @@
.page-links {
margin-top: 2em;
}
.page-link {
display: inline-block;
padding: 0.25em 0.625em;
&:first-child {
padding-left: 0;
}
&:last-child {
padding-right: 0;
}
&.current {
font-weight: 700;
}
&.dots {
padding: 0;
}
}

View File

@@ -0,0 +1,15 @@
.main-menu {
& > div {
display: flex;
align-items: center;
}
li {
display: inline-block;
margin-right: 0.625em;
&:last-child {
margin-right: 0;
}
}
}

View File

@@ -0,0 +1,32 @@
.menu {
ul {
list-style: none;
margin: 0;
}
li {
text-transform: uppercase;
&.current {
& > a {
font-weight: 700;
pointer-events: none;
}
}
}
}
@import 'main';
@import 'sidebar';
.menu a,
.sub-menu-toggler,
.sidebar-toggler span,
.widget-social_menu a {
color: $color__bluegrey-700;
&:focus,
&:hover {
color: $color__bluegrey-900;
}
}

View File

@@ -0,0 +1,61 @@
.sidebar-menu {
.item {
display: flex;
flex-flow: row wrap;
justify-content: flex-end;
}
.has-current {
& > a {
font-style: italic;
}
}
.sub-menu {
display: none;
padding-left: 0;
flex: 100%;
flex-shrink: 0;
.item:not(.has-children) {
padding-right: 1.2em;
}
}
}
.sub-menu-toggler {
border: 0;
padding: 0;
margin-left: 0.2em;
font-weight: 400;
width: 1em;
&:active,
&:focus,
&:hover {
background: none;
}
& > .sign {
position: relative;
top: -2px;
&:after {
content: '+';
}
}
}
.toggled {
& > .sub-menu {
display: block;
}
& > .sub-menu-toggler {
& > .sign {
&:after {
content: '';
}
}
}
}

View File

@@ -0,0 +1,363 @@
/*
* RTL Stylesheet for Minimo
*/
@import 'extras/extras';
/*****************
# Typography
*****************/
// typography/_copy.scss
blockquote {
padding-left: 0;
padding-right: 1em;
border-left: 0;
border-right: 0.2em solid $color__blockquote-border;
}
/*****************
# Elements
*****************/
body {
direction: rtl;
}
// elements/_lists.scss
ol,
ul {
margin: 0 2em 1.5em 0;
}
li > ol,
li > ul {
padding-left: 0;
padding-right: 1.5em;
margin-left: 0;
margin-right: 0.5em;
}
// elements/_tables.scss
caption,
td,
th {
text-align: right;
}
/*****************
# Forms
*****************/
/*****************
# Navigation
*****************/
// navigation/menus/_main.scss
.main-menu {
li {
margin-right: 0;
margin-left: 0.625em;
&:last-child {
margin-left: 0;
}
}
}
// navigation/menus/_sidebar.scss
.sidebar-menu {
.sub-menu {
padding-right: 0;
.item:not(.has-children) {
padding-right: 0;
padding-left: 1.2em;
}
}
}
.sub-menu-toggler {
margin-left: 0;
margin-right: 0.2em;
}
// navigation/_pagination.scss
.page-link {
&:first-child {
padding-left: 0.625em;
padding-right: 0;
}
&:last-child {
padding-left: 0;
padding-right: 0.625em;
}
&.next,
&.prev {
.icon {
transform: rotate(180deg);
}
}
}
/*****************
# Layouts
*****************/
// layouts/_layouts.scss
.main {
transition: margin-right $transition-duration;
.sidebar.toggled ~ & {
margin-left: 0;
margin-right: $sidebar__width;
}
@include screen($breakpoint-medium) {
.has-sidebar & {
float: right;
margin-left: 0;
margin-right: $sidebar__width;
padding-left: 0;
padding-right: 2em;
}
}
}
.container {
.has-sidebar & {
margin-left: auto;
margin-right: 0;
}
}
// layouts/sidebar/_sidebar.scss
.sidebar {
float: right;
left: auto;
right: -$sidebar__width;
margin-right: 0;
margin-left: -100%;
transition: right $transition-duration;
text-align: left;
&.toggled {
right: 0;
}
.sep-after {
&:after {
margin-left: 0;
margin-right: auto;
}
}
@include screen($breakpoint-medium) {
left: auto;
right: 0;
}
}
.sidebar-toggler {
.main & {
right: auto;
left: $container__gutter;
}
.main-menu & {
margin-right: 0;
margin-left: 0.75em;
}
.sidebar & {
left: auto;
right: 0.5em;
}
}
// layouts/_header.scss
.header-info {
.taxonomy-name {
margin-right: 0;
margin-left: 0.25em;
}
}
// layouts/entry/_meta.scss
.entry-meta {
& > span {
display: inline-block;
}
span {
margin-right: 0;
margin-left: 0.75em;
}
.icon {
margin-right: 0;
margin-left: 0.25em;
}
}
// layouts/entry/_toc.scss
.no-details {
details {
& > summary:before {
margin-right: 0;
margin-left: 0.25em;
}
}
}
// layouts/entry/_footer.scss
.entry-footer {
.icon {
margin-right: 0;
margin-left: 0.375em;
}
}
// layouts/entry/_comments.scss
.comment {
.avatar {
float: right;
margin-right: 0;
margin-left: 0.75em;
}
.reply {
right: auto;
left: 0;
}
&-reply-title {
small {
margin-left: 0;
margin-right: 1em;
}
}
&-submission-feedback {
a {
right: auto;
left: 1.5em;
}
}
}
// layouts/_lists.scss
.list {
.item {
.icon {
margin-right: 0;
margin-left: 0.25em;
}
}
}
.taxonomy-cloud {
li {
padding: 0 0 0.5em 1.5em;
}
}
// layouts/others/_icons.scss
img.emoji {
margin: 0 0.1em 0 0.05em;
}
// layouts/others/_archive.scss
.layout-archive {
.list {
.item {
padding-left: 0;
padding-right: 1em;
}
}
}
// layouts/widgets/_about.scss
.widget-about {
.logo {
.sidebar & {
margin-left: 0;
margin-right: auto;
}
}
}
// layouts/widgets/_search.scss
.widget-search {
.search-submit {
right: auto;
left: 0;
border-radius: 0.2em 0 0 0;
}
.layout-search & {
.search-term {
padding-right: 0.875em;
padding-left: 3em;
}
}
}
// layouts/widgets/_social-menu.scss
.widget-social_menu {
li {
margin-right: 0;
margin-left: 0.625em;
&:last-child {
margin-left: 0;
}
}
.sidebar & {
li {
margin-left: 0;
margin-right: 0.625em;
}
}
}
// layouts/widgets/_taxonomy-cloud.scss
.widget-taxonomy_cloud {
.sidebar & {
li {
padding: 0 0.8em 0.4em 0;
}
}
}
/*****************
# Accessibility
*****************/
// extras/_accessibility.scss
.screen-reader-text {
&:focus {
left: auto;
right: 0.5em;
}
}
/*****************
# Hugo Specific
*****************/
// hugo/shortcodes/_convo.scss
.convo {
.sep {
padding-left: 0.5em;
padding-right: 0.75em;
}
}

View File

@@ -0,0 +1,46 @@
/*!
* Theme Name: Minimo
* Author: Munif Tanjim
*/
@import 'extras/extras';
/*****************
# Normalize
*****************/
@import '~normalize.css/normalize.css';
/*****************
# Typography
*****************/
@import 'typography/typography';
/*****************
# Elements
*****************/
@import 'elements/elements';
/*****************
# Forms
*****************/
@import 'forms/forms';
/*****************
# Navigation
*****************/
@import 'navigation/navigation';
/*****************
# Layouts
*****************/
@import 'layouts/layouts';
/*****************
# Accessibility
*****************/
@import 'extras/accessibility';
/*****************
# Hugo Specific
*****************/
@import 'hugo/hugo';

View File

@@ -0,0 +1,52 @@
pre,
code,
kbd,
var,
samp {
font-family: $font-family__code;
background: $color__background-code;
color: $color__text-code;
border: 1px solid $color__border-code;
border-radius: 0.25em;
padding: 0.1em 0.25em;
}
pre {
overflow: auto;
word-wrap: normal;
text-align: initial;
margin-bottom: 1.5em;
padding: 0.75em 1em;
code,
kbd,
var,
samp {
background: none;
color: inherit;
border: 0;
padding: 0;
}
}
code,
kbd,
var,
samp {
@include font-size($font-size__code);
}
.highlight {
pre {
border: 0;
margin: 0;
}
.entry-content & {
margin-bottom: 1.5em;
}
}

View File

@@ -0,0 +1,45 @@
p {
margin: 0 0 1.5em;
&:last-child {
margin: 0;
}
}
cite,
dfn,
em,
i {
font-style: italic;
}
blockquote {
@include font-size($font-size__blockquote);
font-style: italic;
margin: 0 0 1.5em;
padding-left: 1em;
border-left: 0.2em solid $color__blockquote-border;
}
address {
margin: 0 0 1.5em;
}
@import 'codes';
abbr,
acronym {
border-bottom: 1px dotted $color__black;
cursor: help;
}
ins,
mark {
background: $color__black;
text-decoration: none;
}
big {
font-size: 125%;
}

View File

@@ -0,0 +1,53 @@
.title,
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: $font-family__main;
font-weight: 700;
line-height: $line-height__heading;
color: $color__text-heading;
margin: 0 0 0.625em;
}
.entry-content {
h2,
h3,
h4,
h5,
h6 {
margin-top: 1.5em;
&:first-child {
margin-top: 0;
}
}
}
.site-title,
h1 {
@include font-size($font-size__h1);
}
h2 {
@include font-size($font-size__h2);
}
h3 {
@include font-size($font-size__h3);
}
h4 {
@include font-size($font-size__h4);
}
h5 {
@include font-size($font-size__h5);
}
h6 {
@include font-size($font-size__h6);
}

View File

@@ -0,0 +1,19 @@
body {
font-family: $font-family__main;
@include font-size($font-size__main);
line-height: $line-height__body;
color: $color__text-main;
word-wrap: break-word;
@include screen($breakpoint-small) {
@include font-size($font-size__main * 1.125);
}
}
@import 'headings';
@import 'copy';
.desc {
font-style: italic;
}