This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// These are the mixins | |
@mixin grid-layout($column-count, $column-gap: 3rem, $row-gap: null) { | |
$row-gap: if($row-gap == null, $column-gap, $row-gap); | |
display: grid; | |
grid-template-columns: repeat($column-count, 1fr); | |
grid-gap: $row-gap $column-gap; | |
gap: $row-gap $column-gap; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$columns: 12; | |
$gap: 30px; | |
$breakpoints: ( | |
xs: 480px, | |
sm: 768px, | |
md: 960px, | |
lg: 1170px, | |
xl: 1280px | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Neat way to render responsive pie charts in HTML with SVGs and CSS from https://www.smashingmagazine.com/2015/07/designing-simple-pie-charts-with-css/ | |
--> | |
<style> | |
svg.piechart { | |
transform: rotate(-90deg); | |
background: #B0233B; | |
border-radius: 50%; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Select objects in array whose key includes a value | |
* | |
* @param {Array} arr Array to test | |
* @param {String} key Key to inspect | |
* @param {String} value Value key needs to include | |
* @return {String} Filtered array | |
* | |
*/ | |
module.exports = function (arr, key, value) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Select objects in array whose key matches a value | |
* | |
* @param {Array} arr Array to test | |
* @param {String} key Key to inspect | |
* @param {String} value Value key needs to match | |
* @return {String} Filtered array | |
* | |
*/ | |
module.exports = function (arr, key, value) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Removes (index).html from a string | |
* | |
* @param {String} str URL, i.e. /page/index.html | |
* @return {String} Permalinkable URL, i.e. /page/ | |
* | |
*/ | |
module.exports = function (str) { | |
return str.replace(/(?:index)?\.html/g, ''); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { DateTime } = require("luxon"); | |
// date filter formatting using Luxon. Usage: {{ date_field | date('dd LLLL yyyy') }} | |
eleventyConfig.addFilter("date", (it, format = "LLLL dd, yyyy") => { | |
return DateTime.fromJSDate(it, { zone: "utc" }).toFormat(format); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Remove objects in array whose key matches a value | |
* | |
* @param {Array} arr Array to test | |
* @param {String} key Key to inspect | |
* @param {String} value Value key needs to match | |
* @return {String} Filtered array | |
* | |
*/ | |
module.exports = function (arr, key, value) { |