From b816a0ed53c052081441bd3ccd2098557f587eee Mon Sep 17 00:00:00 2001 From: David Darnes Date: Sun, 31 Dec 2023 09:12:31 +0000 Subject: [PATCH 01/16] Version bump to 5.0.0 --- alembic-jekyll-theme.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alembic-jekyll-theme.gemspec b/alembic-jekyll-theme.gemspec index 502b32ed3..d6cd26757 100644 --- a/alembic-jekyll-theme.gemspec +++ b/alembic-jekyll-theme.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "alembic-jekyll-theme" - spec.version = "4.1.0" + spec.version = "5.0.0" spec.authors = ["David Darnes"] spec.email = ["me@daviddarnes.com"] From 752bc27c5784e445ba7451f1572829861f57a786 Mon Sep 17 00:00:00 2001 From: Yang Ming-Tian <1178715749@qq.com> Date: Mon, 13 Nov 2023 17:39:27 +0800 Subject: [PATCH 02/16] Prevent `li` of `ul` from incrementing the counter --- _sass/sassline-base/_typography.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_sass/sassline-base/_typography.scss b/_sass/sassline-base/_typography.scss index 4146bd058..eca81d227 100644 --- a/_sass/sassline-base/_typography.scss +++ b/_sass/sassline-base/_typography.scss @@ -135,6 +135,7 @@ a { ul { li { + counter-increment: none; &:before { content: ''; @@ -165,6 +166,7 @@ a { ul { li { + counter-increment: none; &:before { content: ''; From 6814e24118782dbcddd3058db1d0c07aa6ccfe93 Mon Sep 17 00:00:00 2001 From: Yang Ming-Tian <1178715749@qq.com> Date: Sun, 19 Nov 2023 23:55:20 +0800 Subject: [PATCH 03/16] Disable discretionary ligatures of OTF --- _sass/sassline-base/_typography.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_sass/sassline-base/_typography.scss b/_sass/sassline-base/_typography.scss index eca81d227..532875f17 100644 --- a/_sass/sassline-base/_typography.scss +++ b/_sass/sassline-base/_typography.scss @@ -57,11 +57,11 @@ a { font-feature-settings: 'kern', 'onum', 'liga'; } - // Headings. OpenType ligatures, discretionary ligatures and lining figures enabled if available. + // Headings. OpenType ligatures and lining figures enabled if available. h1, h2, h3, h4, h5, h6 { color: $headingColour; font-family: unquote(map-get($headingtype, font-family)); - font-feature-settings: 'dlig', 'liga', 'lnum', 'kern'; + font-feature-settings: 'liga', 'lnum', 'kern'; font-style: normal; font-weight: map-get($headingtype, bold); } From b4ab81f911a4c9a0b1db77da58e2d31d0c17c512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rafael=20Zambrano=20Sarabia?= Date: Tue, 14 Nov 2023 21:41:32 -0400 Subject: [PATCH 04/16] Solve divition deprecation for min-width --- _sass/sassline-base/_mixins.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_sass/sassline-base/_mixins.scss b/_sass/sassline-base/_mixins.scss index 08fc704cd..f0852f403 100644 --- a/_sass/sassline-base/_mixins.scss +++ b/_sass/sassline-base/_mixins.scss @@ -70,7 +70,7 @@ $max-widths: map-values($maxwidths); // Loop through breakpoints. @for $i from 2 through $breakpoints-limit { - @media screen and (min-width: nth($points, $i) / 16 * 1em ) { + @media screen and (min-width: math.div(nth($points, $i) / 16 * 1em ) { max-width: #{nth($max-widths, $i) / nth($sizes, $i)}rem; } } From 42323d89fd1e49f04b1fa93fd35f809288318ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rafael=20Zambrano=20Sarabia?= Date: Tue, 14 Nov 2023 21:46:22 -0400 Subject: [PATCH 05/16] Fix typo --- _sass/sassline-base/_mixins.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_sass/sassline-base/_mixins.scss b/_sass/sassline-base/_mixins.scss index f0852f403..5dbf39169 100644 --- a/_sass/sassline-base/_mixins.scss +++ b/_sass/sassline-base/_mixins.scss @@ -70,7 +70,7 @@ $max-widths: map-values($maxwidths); // Loop through breakpoints. @for $i from 2 through $breakpoints-limit { - @media screen and (min-width: math.div(nth($points, $i) / 16 * 1em ) { + @media screen and (min-width: math.div(nth($points, $i), 16) * 1em ) { max-width: #{nth($max-widths, $i) / nth($sizes, $i)}rem; } } From 8b60a5b299f978d75de59a91febb19e3b38a0df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rafael=20Zambrano=20Sarabia?= Date: Tue, 14 Nov 2023 21:49:51 -0400 Subject: [PATCH 06/16] Fix other instance --- _sass/sassline-base/_mixins.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_sass/sassline-base/_mixins.scss b/_sass/sassline-base/_mixins.scss index 5dbf39169..e0142e0a8 100644 --- a/_sass/sassline-base/_mixins.scss +++ b/_sass/sassline-base/_mixins.scss @@ -201,7 +201,7 @@ $max-widths: map-values($maxwidths); $get-scale: map-get($modular-scale, scale-#{$i - 1}); $get-size: map-get($get-scale, $fontsize); - @media screen and (min-width: nth($points, $i) / 16 * 1em ) { + @media screen and (min-width: math.div(nth($points, $i), 16) * 1em ) { font-size: #{$get-size / nth($sizes, $i)}rem; } } From ff7247f1a99e9ddf4f38203f3100d771050c86d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rafael=20Zambrano=20Sarabia?= Date: Tue, 14 Nov 2023 21:53:11 -0400 Subject: [PATCH 07/16] Fix typo --- _sass/sassline-base/_mixins.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_sass/sassline-base/_mixins.scss b/_sass/sassline-base/_mixins.scss index e0142e0a8..a01e121e0 100644 --- a/_sass/sassline-base/_mixins.scss +++ b/_sass/sassline-base/_mixins.scss @@ -201,7 +201,7 @@ $max-widths: map-values($maxwidths); $get-scale: map-get($modular-scale, scale-#{$i - 1}); $get-size: map-get($get-scale, $fontsize); - @media screen and (min-width: math.div(nth($points, $i), 16) * 1em ) { + @media screen and (min-width: calc(nth($points, $i) / 16) * 1em ) { font-size: #{$get-size / nth($sizes, $i)}rem; } } From 2f9ee8b05e7a4e83df988d32467572383c22440f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rafael=20Zambrano=20Sarabia?= Date: Tue, 14 Nov 2023 22:44:01 -0400 Subject: [PATCH 08/16] Apply script on mixins --- _sass/sassline-base/_mixins.scss | 120 ++++++++++++++++--------------- 1 file changed, 61 insertions(+), 59 deletions(-) diff --git a/_sass/sassline-base/_mixins.scss b/_sass/sassline-base/_mixins.scss index a01e121e0..c8d2dc3d8 100644 --- a/_sass/sassline-base/_mixins.scss +++ b/_sass/sassline-base/_mixins.scss @@ -4,6 +4,8 @@ // Global variables used in mixins. // Number of breakpoints. +@use "sass:math"; + $breakpoints-limit: length($breakpoints); // List of rootsizes, breakpoints, and max-widths. @@ -24,7 +26,7 @@ $max-widths: map-values($maxwidths); @if $value == string { // If using 'break-1', 'break-2' etc output the correct breakpoints from map. @if map-has-key($breakpoints, $break) { - @media screen and (min-width: #{map-get($breakpoints, $break) / 16 * 1em} ) { @content; } + @media screen and (min-width: #{math.div(map-get($breakpoints, $break), 16) * 1em} ) { @content; } } @else { @warn "#{$break} is not a set breakpoint variable"; } @@ -33,9 +35,9 @@ $max-widths: map-values($maxwidths); } @else if $value == number { // If using other numbers output value in ems either for min, min & max or max width breakpoints. $query: "all" !default; - @if $break != 0 and $max != 0 { $query: "(min-width: #{$break / 16 * 1em}) and (max-width: #{$max / 16 * 1em})"; } - @else if $break != 0 and $max == 0 { $query: "(min-width: #{$break / 16 * 1em})"; } - @else if $break == 0 and $max != 0 { $query: "(max-width: #{$max / 16 * 1em})"; } + @if $break != 0 and $max != 0 { $query: "(min-width: #{math.div($break, 16) * 1em}) and (max-width: #{math.div($max, 16) * 1em})"; } + @else if $break != 0 and $max == 0 { $query: "(min-width: #{math.div($break, 16) * 1em})"; } + @else if $break == 0 and $max != 0 { $query: "(max-width: #{math.div($max, 16) * 1em})"; } @media #{$query} { @content; } } @else { @@ -45,12 +47,12 @@ $max-widths: map-values($maxwidths); // Root font-size in %, outputted in correct breakpoints. @mixin rootsize { - font-size: nth($sizes, 1) / 16 * 100%; + font-size: math.div(nth($sizes, 1), 16) * 100%; // Loop through breakpoints. @for $i from 2 through $breakpoints-limit { - @media screen and (min-width: nth($points, $i) / 16 * 1em ) { - font-size: nth($sizes, $i) / 16 * 100%; + @media screen and (min-width: math.div(nth($points, $i), 16) * 1em ) { + font-size: math.div(nth($sizes, $i), 16) * 100%; } } } @@ -63,15 +65,15 @@ $max-widths: map-values($maxwidths); // If specifying a breakpoint to use (and breakpoint exists). @if $break-value == number and $breakpoint <= ($breakpoints-limit - 1) and $breakpoint >= 0 { - max-width: #{nth($max-widths, ($breakpoint + 1)) / nth($sizes, ($breakpoint + 1))}rem; + max-width: #{math.div(nth($max-widths, ($breakpoint + 1)), nth($sizes, ($breakpoint + 1)))}rem; } @else if $breakpoint == all { - max-width: #{nth($max-widths, 1) / nth($sizes, 1)}rem; + max-width: #{math.div(nth($max-widths, 1), nth($sizes, 1))}rem; // Loop through breakpoints. @for $i from 2 through $breakpoints-limit { @media screen and (min-width: math.div(nth($points, $i), 16) * 1em ) { - max-width: #{nth($max-widths, $i) / nth($sizes, $i)}rem; + max-width: #{math.div(nth($max-widths, $i), nth($sizes, $i))}rem; } } } @@ -85,15 +87,15 @@ $max-widths: map-values($maxwidths); // If specifying a breakpoint to use (and breakpoint exists). @if $break-value == number and $breakpoint <= ($breakpoints-limit - 1) and $breakpoint >= 0 { - max-width: #{nth($line-widths, ($breakpoint + 1)) / nth($sizes, ($breakpoint + 1))}rem; + max-width: #{math.div(nth($line-widths, ($breakpoint + 1)), nth($sizes, ($breakpoint + 1)))}rem; } @else if $breakpoint == all { - max-width: #{nth($line-widths, 1) / nth($sizes, 1)}rem; + max-width: #{math.div(nth($line-widths, 1), nth($sizes, 1))}rem; // Loop through breakpoints. @for $i from 2 through $breakpoints-limit { - @media screen and (min-width: nth($points, $i) / 16 * 1em ) { - max-width: #{nth($line-widths, $i) / nth($sizes, $i)}rem; + @media screen and (min-width: math.div(nth($points, $i), 16) * 1em ) { + max-width: #{math.div(nth($line-widths, $i), nth($sizes, $i))}rem; } } } @@ -110,11 +112,11 @@ $max-widths: map-values($maxwidths); @if $break-value == number and $breakpoint <= ($breakpoints-limit - 1) and $breakpoint > 0 { @if $gutter == small { - $gutter: map-get($gutterwidths, small) * 2 / 1rem; + $gutter: math.div(map-get($gutterwidths, small) * 2, 1rem); } @else if $gutter == medium { - $gutter: map-get($gutterwidths, medium) * 2 / 1rem; + $gutter: math.div(map-get($gutterwidths, medium) * 2, 1rem); } @else if $gutter == large { - $gutter: map-get($gutterwidths, large) * 2 / 1rem; + $gutter: math.div(map-get($gutterwidths, large) * 2, 1rem); } @else { $gutter: 0; } @@ -124,7 +126,7 @@ $max-widths: map-values($maxwidths); $gutter-size: ($gutter * $rootsize); $container-width: map-get($maxwidths, width-#{$breakpoint}); - $percentage: percentage(($ideal-measure + $gutter-size) / $container-width); + $percentage: percentage(math.div($ideal-measure + $gutter-size, $container-width)); @if $percentage < 55 { $percentage: 55%; @@ -163,14 +165,14 @@ $max-widths: map-values($maxwidths); // If using a number for fontsize. @if $font-value == number { - font-size: #{$fontsize / nth($sizes, ($breakpoint + 1))}rem; + font-size: #{math.div($fontsize, nth($sizes, ($breakpoint + 1)))}rem; // If using a variable from the scale for fontsize. } @else if $in-scale == true { $get-scale: map-get($modular-scale, scale-#{$breakpoint}); $get-size: map-get($get-scale, $fontsize); - font-size: #{$get-size / nth($sizes, ($breakpoint + 1))}rem; + font-size: #{math.div($get-size, nth($sizes, ($breakpoint + 1)))}rem; } @else { @warn "#{$fontsize} is not a valid scale variable"; @@ -181,12 +183,12 @@ $max-widths: map-values($maxwidths); // If using a number for fontsize. @if $font-value == number { - font-size: #{$fontsize / nth($sizes, 1)}rem; + font-size: #{math.div($fontsize, nth($sizes, 1))}rem; // Loop through breakpoints. @for $i from 2 through $breakpoints-limit { - @media screen and (min-width: nth($points, $i) / 16 * 1em ) { - font-size: #{$fontsize / nth($sizes, $i)}rem; + @media screen and (min-width: math.div(nth($points, $i), 16) * 1em ) { + font-size: #{math.div($fontsize, nth($sizes, $i))}rem; } } @@ -194,7 +196,7 @@ $max-widths: map-values($maxwidths); } @else if $in-scale == true { $get-scale: map-get($modular-scale, scale-0); $get-size: map-get($get-scale, $fontsize); - font-size: #{$get-size / nth($sizes, 1)}rem; + font-size: #{math.div($get-size, nth($sizes, 1))}rem; // Loop through breakpoints. @for $i from 2 through $breakpoints-limit { @@ -202,7 +204,7 @@ $max-widths: map-values($maxwidths); $get-size: map-get($get-scale, $fontsize); @media screen and (min-width: calc(nth($points, $i) / 16) * 1em ) { - font-size: #{$get-size / nth($sizes, $i)}rem; + font-size: #{calc($get-size / nth($sizes, $i))}rem; } } @@ -240,8 +242,8 @@ $max-widths: map-values($maxwidths); // If using a number for fontsize. @if $font-value == number { $rootsize: nth($sizes, ($breakpoint + 1)); - $baseline-shift: #{($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001}; - $baseline-push: #{$below - (($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001)}; + $baseline-shift: #{math.div($fontsize * 0.5 * (math.div($lineheight * $rootsize, $fontsize) - $cap-height), $rootsize) + 0.00001}; + $baseline-push: #{$below - (math.div($fontsize * 0.5 * (math.div($lineheight * $rootsize, $fontsize) - $cap-height), $rootsize) + 0.00001)}; margin-bottom: #{$baseline-push}rem; padding-top: #{$baseline-shift}rem; @@ -252,8 +254,8 @@ $max-widths: map-values($maxwidths); $get-size: map-get($get-scale, $fontsize); $rootsize: nth($sizes, ($breakpoint + 1)); - $baseline-shift: #{($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001}; - $baseline-push: #{$below - (($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001)}; + $baseline-shift: #{math.div($get-size * 0.5 * (math.div($lineheight * $rootsize, $get-size) - $cap-height), $rootsize) + 0.00001}; + $baseline-push: #{$below - (math.div($get-size * 0.5 * (math.div($lineheight * $rootsize, $get-size) - $cap-height), $rootsize) + 0.00001)}; margin-bottom: #{$baseline-push}rem; padding-top: #{$baseline-shift}rem; @@ -268,8 +270,8 @@ $max-widths: map-values($maxwidths); // If using a number for fontsize. @if $font-value == number { $rootsize: nth($sizes, 1); - $baseline-shift: #{($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001}; - $baseline-push: #{$below - (($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001)}; + $baseline-shift: #{math.div($fontsize * 0.5 * (math.div($lineheight * $rootsize, $fontsize) - $cap-height), $rootsize) + 0.00001}; + $baseline-push: #{$below - (math.div($fontsize * 0.5 * (math.div($lineheight * $rootsize, $fontsize) - $cap-height), $rootsize) + 0.00001)}; margin-bottom: #{$baseline-push}rem; padding-top: #{$baseline-shift}rem; @@ -277,10 +279,10 @@ $max-widths: map-values($maxwidths); // Loop through breakpoints. @for $i from 2 through $breakpoints-limit { $rootsize: nth($sizes, $i); - $baseline-shift: #{($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001}; - $baseline-push: #{$below - (($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001)}; + $baseline-shift: #{math.div($fontsize * 0.5 * (math.div($lineheight * $rootsize, $fontsize) - $cap-height), $rootsize) + 0.00001}; + $baseline-push: #{$below - (math.div($fontsize * 0.5 * (math.div($lineheight * $rootsize, $fontsize) - $cap-height), $rootsize) + 0.00001)}; - @media screen and (min-width: nth($points, $i) / 16 * 1em ) { + @media screen and (min-width: math.div(nth($points, $i), 16) * 1em ) { margin-bottom: #{$baseline-push}rem; padding-top: #{$baseline-shift}rem; } @@ -292,8 +294,8 @@ $max-widths: map-values($maxwidths); $get-size: map-get($get-scale, $fontsize); $rootsize: nth($sizes, 1); - $baseline-shift: #{($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001}; - $baseline-push: #{$below - (($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001)}; + $baseline-shift: #{math.div($get-size * 0.5 * (math.div($lineheight * $rootsize, $get-size) - $cap-height), $rootsize) + 0.00001}; + $baseline-push: #{$below - (math.div($get-size * 0.5 * (math.div($lineheight * $rootsize, $get-size) - $cap-height), $rootsize) + 0.00001)}; margin-bottom: #{$baseline-push}rem; padding-top: #{$baseline-shift}rem; @@ -304,10 +306,10 @@ $max-widths: map-values($maxwidths); $get-size: map-get($get-scale, $fontsize); $rootsize: nth($sizes, $i); - $baseline-shift: #{($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001}; - $baseline-push: #{$below - (($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001)}; + $baseline-shift: #{math.div($get-size * 0.5 * (math.div($lineheight * $rootsize, $get-size) - $cap-height), $rootsize) + 0.00001}; + $baseline-push: #{$below - (math.div($get-size * 0.5 * (math.div($lineheight * $rootsize, $get-size) - $cap-height), $rootsize) + 0.00001)}; - @media screen and (min-width: nth($points, $i) / 16 * 1em ) { + @media screen and (min-width: math.div(nth($points, $i), 16) * 1em ) { margin-bottom: #{$baseline-push}rem; padding-top: #{$baseline-shift}rem; } @@ -335,9 +337,9 @@ $max-widths: map-values($maxwidths); @if $font-value == number { $rootsize: nth($sizes, ($breakpoint + 1)); - $baseline-shift: #{($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001}; - $baseline-push: #{$below - (($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001)}; - font-size: #{$fontsize / nth($sizes, ($breakpoint + 1))}rem; + $baseline-shift: #{math.div($fontsize * 0.5 * (math.div($lineheight * $rootsize, $fontsize) - $cap-height), $rootsize) + 0.00001}; + $baseline-push: #{$below - (math.div($fontsize * 0.5 * (math.div($lineheight * $rootsize, $fontsize) - $cap-height), $rootsize) + 0.00001)}; + font-size: #{math.div($fontsize, nth($sizes, ($breakpoint + 1)))}rem; margin-bottom: #{$baseline-push}rem; padding-top: #{$baseline-shift}rem; @@ -345,9 +347,9 @@ $max-widths: map-values($maxwidths); $get-scale: map-get($modular-scale, scale-#{$breakpoint}); $get-size: map-get($get-scale, $fontsize); $rootsize: nth($sizes, ($breakpoint + 1)); - $baseline-shift: #{($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001}; - $baseline-push: #{$below - (($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001)}; - font-size: #{$get-size / nth($sizes, ($breakpoint + 1))}rem; + $baseline-shift: #{math.div($get-size * 0.5 * (math.div($lineheight * $rootsize, $get-size) - $cap-height), $rootsize) + 0.00001}; + $baseline-push: #{$below - (math.div($get-size * 0.5 * (math.div($lineheight * $rootsize, $get-size) - $cap-height), $rootsize) + 0.00001)}; + font-size: #{math.div($get-size, nth($sizes, ($breakpoint + 1)))}rem; margin-bottom: #{$baseline-push}rem; padding-top: #{$baseline-shift}rem; @@ -359,18 +361,18 @@ $max-widths: map-values($maxwidths); @if $font-value == number { $rootsize: nth($sizes, 1); - $baseline-shift: #{($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001}; - $baseline-push: #{$below - (($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001)}; - font-size: #{$fontsize / nth($sizes, 1)}rem; + $baseline-shift: #{math.div($fontsize * 0.5 * (math.div($lineheight * $rootsize, $fontsize) - $cap-height), $rootsize) + 0.00001}; + $baseline-push: #{$below - (math.div($fontsize * 0.5 * (math.div($lineheight * $rootsize, $fontsize) - $cap-height), $rootsize) + 0.00001)}; + font-size: #{math.div($fontsize, nth($sizes, 1))}rem; margin-bottom: #{$baseline-push}rem; padding-top: #{$baseline-shift}rem; @for $i from 2 through $breakpoints-limit { $rootsize: nth($sizes, $i); - $baseline-shift: #{($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001}; - $baseline-push: #{$below - (($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001)}; - @media screen and (min-width: nth($points, $i) / 16 * 1em ) { - font-size: #{$fontsize / nth($sizes, $i)}rem; + $baseline-shift: #{math.div($fontsize * 0.5 * (math.div($lineheight * $rootsize, $fontsize) - $cap-height), $rootsize) + 0.00001}; + $baseline-push: #{$below - (math.div($fontsize * 0.5 * (math.div($lineheight * $rootsize, $fontsize) - $cap-height), $rootsize) + 0.00001)}; + @media screen and (min-width: math.div(nth($points, $i), 16) * 1em ) { + font-size: #{math.div($fontsize, nth($sizes, $i))}rem; margin-bottom: #{$baseline-push}rem; padding-top: #{$baseline-shift}rem; } @@ -380,9 +382,9 @@ $max-widths: map-values($maxwidths); $get-scale: map-get($modular-scale, scale-0); $get-size: map-get($get-scale, $fontsize); $rootsize: nth($sizes, 1); - $baseline-shift: #{($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001}; - $baseline-push: #{$below - (($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001)}; - font-size: #{$get-size / nth($sizes, 1)}rem; + $baseline-shift: #{math.div($get-size * 0.5 * (math.div($lineheight * $rootsize, $get-size) - $cap-height), $rootsize) + 0.00001}; + $baseline-push: #{$below - (math.div($get-size * 0.5 * (math.div($lineheight * $rootsize, $get-size) - $cap-height), $rootsize) + 0.00001)}; + font-size: #{math.div($get-size, nth($sizes, 1))}rem; margin-bottom: #{$baseline-push}rem; padding-top: #{$baseline-shift}rem; @@ -390,10 +392,10 @@ $max-widths: map-values($maxwidths); $get-scale: map-get($modular-scale, scale-#{$i - 1}); $get-size: map-get($get-scale, $fontsize); $rootsize: nth($sizes, $i); - $baseline-shift: #{($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001}; - $baseline-push: #{$below - (($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001)}; - @media screen and (min-width: nth($points, $i) / 16 * 1em ) { - font-size: #{$get-size / nth($sizes, $i)}rem; + $baseline-shift: #{math.div($get-size * 0.5 * (math.div($lineheight * $rootsize, $get-size) - $cap-height), $rootsize) + 0.00001}; + $baseline-push: #{$below - (math.div($get-size * 0.5 * (math.div($lineheight * $rootsize, $get-size) - $cap-height), $rootsize) + 0.00001)}; + @media screen and (min-width: math.div(nth($points, $i), 16) * 1em ) { + font-size: #{math.div($get-size, nth($sizes, $i))}rem; margin-bottom: #{$baseline-push}rem; padding-top: #{$baseline-shift}rem; } From e0127a94cf29352c2aa1e29c26e3226379ac167e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Rafael=20Zambrano=20Sarabia?= Date: Tue, 14 Nov 2023 22:56:48 -0400 Subject: [PATCH 09/16] Apply script on typography --- _sass/sassline-base/_typography.scss | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/_sass/sassline-base/_typography.scss b/_sass/sassline-base/_typography.scss index 532875f17..1ea00f4d4 100644 --- a/_sass/sassline-base/_typography.scss +++ b/_sass/sassline-base/_typography.scss @@ -2,6 +2,8 @@ // --------------------------------------- // Setting root sizes and base styles. +@use "sass:math"; + html { @include rootsize; @@ -280,8 +282,8 @@ a { $get-scale: map-get($modular-scale, scale-0); $get-size: map-get($get-scale, zeta); $rootsize: nth($sizes, 1); - $baseline-shift: #{($get-size / 2 * ((2 * $rootsize / $get-size) - map-get($bodytype, cap-height))) / $rootsize + 0.00001}; - $baseline-push: #{3 - (($get-size * ((2 * $rootsize / $get-size) - map-get($bodytype, cap-height))) / $rootsize + 0.00001)}; + $baseline-shift: #{math.div($get-size * 0.5 * (math.div(2 * $rootsize, $get-size) - map-get($bodytype, cap-height)), $rootsize) + 0.00001}; + $baseline-push: #{3 - (math.div($get-size * (math.div(2 * $rootsize, $get-size) - map-get($bodytype, cap-height)), $rootsize) + 0.00001)}; margin-bottom: #{$baseline-push}rem; padding-bottom: #{$baseline-shift}rem; @@ -290,10 +292,10 @@ a { $get-scale: map-get($modular-scale, scale-#{$i - 1}); $get-size: map-get($get-scale, zeta); $rootsize: nth($sizes, $i); - $baseline-shift: #{($get-size / 2 * ((2 * $rootsize / $get-size) - map-get($bodytype, cap-height))) / $rootsize + 0.00001}; - $baseline-push: #{3 - (($get-size * ((2 * $rootsize / $get-size) - map-get($bodytype, cap-height))) / $rootsize + 0.00001)}; + $baseline-shift: #{math.div($get-size * 0.5 * (math.div(2 * $rootsize, $get-size) - map-get($bodytype, cap-height)), $rootsize) + 0.00001}; + $baseline-push: #{3 - (math.div($get-size * (math.div(2 * $rootsize, $get-size) - map-get($bodytype, cap-height)), $rootsize) + 0.00001)}; - @media screen and (min-width: nth($points, $i) / 16 * 1em ) { + @media screen and (min-width: math.div(nth($points, $i), 16) * 1em ) { margin-bottom: #{$baseline-push}rem; padding-bottom: #{$baseline-shift}rem; } From dde829e1b8f9962bb24f054931b6a83fa7126684 Mon Sep 17 00:00:00 2001 From: David Darnes Date: Tue, 2 Jan 2024 23:42:44 +0000 Subject: [PATCH 10/16] Update jekyll-commonmark --- alembic-jekyll-theme.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alembic-jekyll-theme.gemspec b/alembic-jekyll-theme.gemspec index d6cd26757..57a0905ef 100644 --- a/alembic-jekyll-theme.gemspec +++ b/alembic-jekyll-theme.gemspec @@ -22,7 +22,7 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.7.1" spec.add_runtime_dependency "jekyll-redirect-from", "~> 0.16" spec.add_runtime_dependency "jekyll-feed", "~> 0.15" - spec.add_runtime_dependency "jekyll-commonmark", "~> 1.3.1" + spec.add_runtime_dependency "jekyll-commonmark", "~> 1.4.0" spec.add_runtime_dependency "jekyll-include-cache", "~> 0.2" spec.add_runtime_dependency "jemoji", "~> 0.12" end From 2969b1ae66426fc88440443fa472511352081a56 Mon Sep 17 00:00:00 2001 From: David Darnes Date: Tue, 2 Jan 2024 23:45:40 +0000 Subject: [PATCH 11/16] Remove Forestry from starter options --- README.md | 24 +++++++++++++++++++----- index.md | 11 ++++------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index fbb8443cb..7012006ed 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # [Alembic](https://alembic.darn.es/) + [![Gem Version](https://badge.fury.io/rb/alembic-jekyll-theme.svg)](https://badge.fury.io/rb/alembic-jekyll-theme) ⚗ A Jekyll boilerplate theme designed to be a starting point for any Jekyll website. @@ -8,6 +9,7 @@ [](https://buymeacoffee.com/daviddarnes#support) ## Contents + - [About](#about) - [Features](#features) - [Examples](#examples) @@ -63,9 +65,6 @@ To give you a running start I've put together some starter kits that you can dow - Vanilla Jekyll starter kit: [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/daviddarnes/alembic-kit) -- Forestry starter kit: - [![Deploy to Forestry](https://assets.forestry.io/import-to-forestry.svg)](https://app.forestry.io/quick-start?repo=daviddarnes/alembic-forestry-kit&engine=jekyll) - [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/daviddarnes/alembic-forestry-kit) - Netlify CMS starter kit: [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/daviddarnes/alembic-netlifycms-kit&stack=cms) @@ -166,45 +165,53 @@ If you want to customise this further you can find the include for custom fonts There are 2 main types of includes: ones designed for the site and ones that are designed as shortcodes. Here are a list of the shortcode includes: ### `button.html` + A button that can link to a page of any kind. Example usage: `{% include button.html text="I'm a button" link="https://david.darn.es" %}` Available options: + - `text`: The text of the button _required_ - `link`: The link that the button goes to _required_ - `icon`: The icon that is added to the end of the button text - `color`: The colour of the button ### `figure.html` + An image with optional caption. Example usage: `{% include figure.html image="/uploads/feature-image.jpg" caption="Check out my photo" %}` Available options: + - `image`: The image shown _required_ - `caption`: A caption to explain the image - `position`: The position of the image; `left`, `right` or `center` - `width` & `height`: Optional width and height attributes of the containing image ### `icon.html` + An icon. Example usage: `{% include icon.html id="twitter" %}` Available options: + - `id`: The reference for the icon _required_ - `title`: The accessible label for the icon - `color`: The desired colour of the icon - `width` & `height`: Width and height attributes for the icon, default is `16` ### `nav-share.html` + A set of buttons that share the current page to various social networks, which is controlled within the `_config.yml` file under the `sharing_links` keyword. Example usage: `{% include nav-share.html %}` Available options: -``` yml + +```yml Twitter: "#1DA1F2" facebook: "#3B5998" Pinterest: "#BD081C" @@ -219,34 +226,40 @@ Email: true _The first item is the name of the network (must be one of the ones stated above) and the second is the colour of the button. To remove a button remove the line of the same name._ ### `video.html` + A YouTube video. Example usage: `{% include video.html id="zrkcGL5H3MU" %}` Available options: + - `id`: The YouTube ID for the video _required_ ### `map.html` + A Google map. _See Google [My Maps](https://www.google.com/mymaps)_ Example usage: `{% include map.html id="1UT-2Z-Vg_MG_TrS5X2p8SthsJhc" %}` Available options: + - `id`: The map ID for the video _required_ ### `site-form.html` + Adds a contact form to the page. This can be used with [Formspree](https://formspree.io/) or [Netlify Forms](https://www.netlify.com/docs/form-handling/) depending on your setup. Example usage: `{% include site-form.html %}` Available options: + - `netlify_form=true`: Set whether you would like to use Netlify Forms, otherwise the form will default to Formspree - `name`: Give the form a name, by default the form is called "Contact". The name will be reflected when form submissions come through in Netlify or in your email client. The name is also used in the label and input elements for accessibility - Use the `email` option in the `/_config.yml` to change to the desired email. ### `site-search.html` + Adds a search form to the page. Example usage: `{% include site-search.html %}` @@ -254,6 +267,7 @@ Example usage: `{% include site-search.html %}` This include has no options. This include will add a block of javascript to the page and javascript reference in order for the search field to work correctly. ### `site-before-start.html` & `site-before-end.html` + Optional html includes for adding scripts, css, js or any embed code you wish to add to every page without the need to overwrite the entire `default.html` template. **Example usage:** These are different to other includes as they are designed to be overwritten. If you create a `site-before-start.html` file in the `_includes/` the contents of the file will be included immediately before the closing `` tag. If you create a `site-before-end.html` file the contents of the file will be included immediately before the closing `` tag. diff --git a/index.md b/index.md index e994c0fae..178b9954e 100644 --- a/index.md +++ b/index.md @@ -43,17 +43,14 @@ Here are a few examples of Alembic out in the wild being used in a variety of wa To give you a running start I've put together some starter kits that you can download, fork or even deploy immediately: -- ⚗️🍨 Vanilla Jekyll starter kit +- ⚗️🍨 Vanilla Jekyll starter kit [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/daviddarnes/alembic-kit){:style="background: none"} -- ⚗️🌲 Forestry starter kit - [![Deploy to Forestry](https://assets.forestry.io/import-to-forestry.svg)](https://app.forestry.io/quick-start?repo=daviddarnes/alembic-forestry-kit&engine=jekyll){:style="background: none"} - [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/daviddarnes/alembic-forestry-kit){:style="background: none"} -- ⚗️💠 Netlify CMS starter kit +- ⚗️💠 Netlify CMS starter kit [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/daviddarnes/alembic-netlifycms-kit&stack=cms){:style="background: none"} -- ⚗️:octocat: GitHub Pages with remote theme kit +- ⚗️:octocat: GitHub Pages with remote theme kit {% include button.html text="Download kit" link="https://github.com/daviddarnes/alembic-kit/archive/remote-theme.zip" color="#24292e" %} -- ⚗️🚀 Stackbit starter kit +- ⚗️🚀 Stackbit starter kit [![Create with Stackbit](https://assets.stackbit.com/badge/create-with-stackbit.svg)](https://app.stackbit.com/create?theme=https://github.com/daviddarnes/alembic-stackbit-kit){:style="background: none"} ### As a Jekyll theme From 75b714c97e69d0cc229efb10e9b161b393fd1fc0 Mon Sep 17 00:00:00 2001 From: David Darnes Date: Tue, 2 Jan 2024 23:58:45 +0000 Subject: [PATCH 12/16] Update Sassline --- _sass/sassline-base/_variables.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_sass/sassline-base/_variables.scss b/_sass/sassline-base/_variables.scss index 0b4715300..898d26312 100644 --- a/_sass/sassline-base/_variables.scss +++ b/_sass/sassline-base/_variables.scss @@ -24,7 +24,7 @@ $rootsizes: ( ) !default; // Set the optimum line-length for your text (based on typeface). -// Aim for 75-100 characters a line when possible, at smaller sizes type size is more important. +// Aim for 75–100 characters a line when possible, at smaller sizes type size is more important. // ! Make sure to have as many widths as breakpoints above. // Note: this was 'maxwidths' in previous versions. $measures: ( From 6ab614b799bf9ef1a79eab727cca8c24a775992e Mon Sep 17 00:00:00 2001 From: David Darnes Date: Wed, 3 Jan 2024 09:22:37 +0000 Subject: [PATCH 13/16] Dark mode syntax highlighting --- README.md | 2 +- _sass/_syntax.scss | 487 +++++++++++++++++++++++++++++++++++++++------ 2 files changed, 427 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index 7012006ed..8636bb304 100644 --- a/README.md +++ b/README.md @@ -297,4 +297,4 @@ There are some more specific options you can apply when creating a page or a pos - Thanks to [Sassline](https://sassline.com/) for the typographic basis, by [Jake Giltsoff](https://twitter.com/jakegiltsoff) - Thanks to [Flexbox mixin](https://github.com/mastastealth/sass-flex-mixin) by [Brian Franco](https://twitter.com/brianfranco) - Thanks to [Normalize](https://necolas.github.io/normalize.css/) by [Nicolas Gallagher](https://twitter.com/necolas) and [Jonathan Neal](https://twitter.com/jon_neal). -- Thanks to [pygments-css](http://richleland.github.io/pygments-css/) for the autumn syntax highlighting, by [Rich Leland](https://twitter.com/richleland) +- Thanks to [pygments-css](http://richleland.github.io/pygments-css/) for the autumn and monokai syntax highlighting, by [Rich Leland](https://twitter.com/richleland) diff --git a/_sass/_syntax.scss b/_sass/_syntax.scss index dc60655fa..20c7adfce 100644 --- a/_sass/_syntax.scss +++ b/_sass/_syntax.scss @@ -1,61 +1,426 @@ -.hll { background-color: #ffffcc } -.c { color: #999988; font-style: italic } /* Comment */ -.err { color: #a61717; background-color: #e3d2d2 } /* Error */ -.k { color: #000000; font-weight: bold } /* Keyword */ -.o { color: #000000; font-weight: bold } /* Operator */ -.cm { color: #999988; font-style: italic } /* Comment.Multiline */ -.cp { color: #999999; font-weight: bold; font-style: italic } /* Comment.Preproc */ -.c1 { color: #999988; font-style: italic } /* Comment.Single */ -.cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ -.gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ -.ge { color: #000000; font-style: italic } /* Generic.Emph */ -.gr { color: #aa0000 } /* Generic.Error */ -.gh { color: #999999 } /* Generic.Heading */ -.gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ -.go { color: #888888 } /* Generic.Output */ -.gp { color: #555555 } /* Generic.Prompt */ -.gs { font-weight: bold } /* Generic.Strong */ -.gu { color: #aaaaaa } /* Generic.Subheading */ -.gt { color: #aa0000 } /* Generic.Traceback */ -.kc { color: #000000; font-weight: bold } /* Keyword.Constant */ -.kd { color: #000000; font-weight: bold } /* Keyword.Declaration */ -.kn { color: #000000; font-weight: bold } /* Keyword.Namespace */ -.kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */ -.kr { color: #000000; font-weight: bold } /* Keyword.Reserved */ -.kt { color: #445588; font-weight: bold } /* Keyword.Type */ -.m { color: #009999 } /* Literal.Number */ -.s { color: #d01040 } /* Literal.String */ -.na { color: #008080 } /* Name.Attribute */ -.nb { color: #0086B3 } /* Name.Builtin */ -.nc { color: #445588; font-weight: bold } /* Name.Class */ -.no { color: #008080 } /* Name.Constant */ -.nd { color: #3c5d5d; font-weight: bold } /* Name.Decorator */ -.ni { color: #800080 } /* Name.Entity */ -.ne { color: #990000; font-weight: bold } /* Name.Exception */ -.nf { color: #990000; font-weight: bold } /* Name.Function */ -.nl { color: #990000; font-weight: bold } /* Name.Label */ -.nn { color: #555555 } /* Name.Namespace */ -.nt { color: #000080 } /* Name.Tag */ -.nv { color: #008080 } /* Name.Variable */ -.ow { color: #000000; font-weight: bold } /* Operator.Word */ -.w { color: #bbbbbb } /* Text.Whitespace */ -.mf { color: #009999 } /* Literal.Number.Float */ -.mh { color: #009999 } /* Literal.Number.Hex */ -.mi { color: #009999 } /* Literal.Number.Integer */ -.mo { color: #009999 } /* Literal.Number.Oct */ -.sb { color: #d01040 } /* Literal.String.Backtick */ -.sc { color: #d01040 } /* Literal.String.Char */ -.sd { color: #d01040 } /* Literal.String.Doc */ -.s2 { color: #d01040 } /* Literal.String.Double */ -.se { color: #d01040 } /* Literal.String.Escape */ -.sh { color: #d01040 } /* Literal.String.Heredoc */ -.si { color: #d01040 } /* Literal.String.Interpol */ -.sx { color: #d01040 } /* Literal.String.Other */ -.sr { color: #009926 } /* Literal.String.Regex */ -.s1 { color: #d01040 } /* Literal.String.Single */ -.ss { color: #990073 } /* Literal.String.Symbol */ -.bp { color: #999999 } /* Name.Builtin.Pseudo */ -.vc { color: #008080 } /* Name.Variable.Class */ -.vg { color: #008080 } /* Name.Variable.Global */ -.vi { color: #008080 } /* Name.Variable.Instance */ -.il { color: #009999 } /* Literal.Number.Integer.Long */ +.highlight .hll { + background-color: #ffffcc; +} +.highlight { + background: #ffffff; +} +.highlight .c { + color: #aaaaaa; + font-style: italic; +} /* Comment */ +.highlight .err { + color: #ff0000; + background-color: #ffaaaa; +} /* Error */ +.highlight .k { + color: #0000aa; +} /* Keyword */ +.highlight .ch { + color: #aaaaaa; + font-style: italic; +} /* Comment.Hashbang */ +.highlight .cm { + color: #aaaaaa; + font-style: italic; +} /* Comment.Multiline */ +.highlight .cp { + color: #4c8317; +} /* Comment.Preproc */ +.highlight .cpf { + color: #aaaaaa; + font-style: italic; +} /* Comment.PreprocFile */ +.highlight .c1 { + color: #aaaaaa; + font-style: italic; +} /* Comment.Single */ +.highlight .cs { + color: #0000aa; + font-style: italic; +} /* Comment.Special */ +.highlight .gd { + color: #aa0000; +} /* Generic.Deleted */ +.highlight .ge { + font-style: italic; +} /* Generic.Emph */ +.highlight .gr { + color: #aa0000; +} /* Generic.Error */ +.highlight .gh { + color: #000080; + font-weight: bold; +} /* Generic.Heading */ +.highlight .gi { + color: #00aa00; +} /* Generic.Inserted */ +.highlight .go { + color: #888888; +} /* Generic.Output */ +.highlight .gp { + color: #555555; +} /* Generic.Prompt */ +.highlight .gs { + font-weight: bold; +} /* Generic.Strong */ +.highlight .gu { + color: #800080; + font-weight: bold; +} /* Generic.Subheading */ +.highlight .gt { + color: #aa0000; +} /* Generic.Traceback */ +.highlight .kc { + color: #0000aa; +} /* Keyword.Constant */ +.highlight .kd { + color: #0000aa; +} /* Keyword.Declaration */ +.highlight .kn { + color: #0000aa; +} /* Keyword.Namespace */ +.highlight .kp { + color: #0000aa; +} /* Keyword.Pseudo */ +.highlight .kr { + color: #0000aa; +} /* Keyword.Reserved */ +.highlight .kt { + color: #00aaaa; +} /* Keyword.Type */ +.highlight .m { + color: #009999; +} /* Literal.Number */ +.highlight .s { + color: #aa5500; +} /* Literal.String */ +.highlight .na { + color: #1e90ff; +} /* Name.Attribute */ +.highlight .nb { + color: #00aaaa; +} /* Name.Builtin */ +.highlight .nc { + color: #00aa00; + text-decoration: underline; +} /* Name.Class */ +.highlight .no { + color: #aa0000; +} /* Name.Constant */ +.highlight .nd { + color: #888888; +} /* Name.Decorator */ +.highlight .ni { + color: #880000; + font-weight: bold; +} /* Name.Entity */ +.highlight .nf { + color: #00aa00; +} /* Name.Function */ +.highlight .nn { + color: #00aaaa; + text-decoration: underline; +} /* Name.Namespace */ +.highlight .nt { + color: #1e90ff; + font-weight: bold; +} /* Name.Tag */ +.highlight .nv { + color: #aa0000; +} /* Name.Variable */ +.highlight .ow { + color: #0000aa; +} /* Operator.Word */ +.highlight .w { + color: #bbbbbb; +} /* Text.Whitespace */ +.highlight .mb { + color: #009999; +} /* Literal.Number.Bin */ +.highlight .mf { + color: #009999; +} /* Literal.Number.Float */ +.highlight .mh { + color: #009999; +} /* Literal.Number.Hex */ +.highlight .mi { + color: #009999; +} /* Literal.Number.Integer */ +.highlight .mo { + color: #009999; +} /* Literal.Number.Oct */ +.highlight .sa { + color: #aa5500; +} /* Literal.String.Affix */ +.highlight .sb { + color: #aa5500; +} /* Literal.String.Backtick */ +.highlight .sc { + color: #aa5500; +} /* Literal.String.Char */ +.highlight .dl { + color: #aa5500; +} /* Literal.String.Delimiter */ +.highlight .sd { + color: #aa5500; +} /* Literal.String.Doc */ +.highlight .s2 { + color: #aa5500; +} /* Literal.String.Double */ +.highlight .se { + color: #aa5500; +} /* Literal.String.Escape */ +.highlight .sh { + color: #aa5500; +} /* Literal.String.Heredoc */ +.highlight .si { + color: #aa5500; +} /* Literal.String.Interpol */ +.highlight .sx { + color: #aa5500; +} /* Literal.String.Other */ +.highlight .sr { + color: #009999; +} /* Literal.String.Regex */ +.highlight .s1 { + color: #aa5500; +} /* Literal.String.Single */ +.highlight .ss { + color: #0000aa; +} /* Literal.String.Symbol */ +.highlight .bp { + color: #00aaaa; +} /* Name.Builtin.Pseudo */ +.highlight .fm { + color: #00aa00; +} /* Name.Function.Magic */ +.highlight .vc { + color: #aa0000; +} /* Name.Variable.Class */ +.highlight .vg { + color: #aa0000; +} /* Name.Variable.Global */ +.highlight .vi { + color: #aa0000; +} /* Name.Variable.Instance */ +.highlight .vm { + color: #aa0000; +} /* Name.Variable.Magic */ +.highlight .il { + color: #009999; +} /* Literal.Number.Integer.Long */ + +@media (prefers-color-scheme: dark) { + .highlight .hll { + background-color: #49483e; + } + .highlight { + background: #272822; + color: #f8f8f2; + } + .highlight .c { + color: #75715e; + } /* Comment */ + .highlight .err { + color: #960050; + background-color: #1e0010; + } /* Error */ + .highlight .k { + color: #66d9ef; + } /* Keyword */ + .highlight .l { + color: #ae81ff; + } /* Literal */ + .highlight .n { + color: #f8f8f2; + } /* Name */ + .highlight .o { + color: #f92672; + } /* Operator */ + .highlight .p { + color: #f8f8f2; + } /* Punctuation */ + .highlight .ch { + color: #75715e; + } /* Comment.Hashbang */ + .highlight .cm { + color: #75715e; + } /* Comment.Multiline */ + .highlight .cp { + color: #75715e; + } /* Comment.Preproc */ + .highlight .cpf { + color: #75715e; + } /* Comment.PreprocFile */ + .highlight .c1 { + color: #75715e; + } /* Comment.Single */ + .highlight .cs { + color: #75715e; + } /* Comment.Special */ + .highlight .gd { + color: #f92672; + } /* Generic.Deleted */ + .highlight .ge { + font-style: italic; + } /* Generic.Emph */ + .highlight .gi { + color: #a6e22e; + } /* Generic.Inserted */ + .highlight .gs { + font-weight: bold; + } /* Generic.Strong */ + .highlight .gu { + color: #75715e; + } /* Generic.Subheading */ + .highlight .kc { + color: #66d9ef; + } /* Keyword.Constant */ + .highlight .kd { + color: #66d9ef; + } /* Keyword.Declaration */ + .highlight .kn { + color: #f92672; + } /* Keyword.Namespace */ + .highlight .kp { + color: #66d9ef; + } /* Keyword.Pseudo */ + .highlight .kr { + color: #66d9ef; + } /* Keyword.Reserved */ + .highlight .kt { + color: #66d9ef; + } /* Keyword.Type */ + .highlight .ld { + color: #e6db74; + } /* Literal.Date */ + .highlight .m { + color: #ae81ff; + } /* Literal.Number */ + .highlight .s { + color: #e6db74; + } /* Literal.String */ + .highlight .na { + color: #a6e22e; + } /* Name.Attribute */ + .highlight .nb { + color: #f8f8f2; + } /* Name.Builtin */ + .highlight .nc { + color: #a6e22e; + } /* Name.Class */ + .highlight .no { + color: #66d9ef; + } /* Name.Constant */ + .highlight .nd { + color: #a6e22e; + } /* Name.Decorator */ + .highlight .ni { + color: #f8f8f2; + } /* Name.Entity */ + .highlight .ne { + color: #a6e22e; + } /* Name.Exception */ + .highlight .nf { + color: #a6e22e; + } /* Name.Function */ + .highlight .nl { + color: #f8f8f2; + } /* Name.Label */ + .highlight .nn { + color: #f8f8f2; + } /* Name.Namespace */ + .highlight .nx { + color: #a6e22e; + } /* Name.Other */ + .highlight .py { + color: #f8f8f2; + } /* Name.Property */ + .highlight .nt { + color: #f92672; + } /* Name.Tag */ + .highlight .nv { + color: #f8f8f2; + } /* Name.Variable */ + .highlight .ow { + color: #f92672; + } /* Operator.Word */ + .highlight .w { + color: #f8f8f2; + } /* Text.Whitespace */ + .highlight .mb { + color: #ae81ff; + } /* Literal.Number.Bin */ + .highlight .mf { + color: #ae81ff; + } /* Literal.Number.Float */ + .highlight .mh { + color: #ae81ff; + } /* Literal.Number.Hex */ + .highlight .mi { + color: #ae81ff; + } /* Literal.Number.Integer */ + .highlight .mo { + color: #ae81ff; + } /* Literal.Number.Oct */ + .highlight .sa { + color: #e6db74; + } /* Literal.String.Affix */ + .highlight .sb { + color: #e6db74; + } /* Literal.String.Backtick */ + .highlight .sc { + color: #e6db74; + } /* Literal.String.Char */ + .highlight .dl { + color: #e6db74; + } /* Literal.String.Delimiter */ + .highlight .sd { + color: #e6db74; + } /* Literal.String.Doc */ + .highlight .s2 { + color: #e6db74; + } /* Literal.String.Double */ + .highlight .se { + color: #ae81ff; + } /* Literal.String.Escape */ + .highlight .sh { + color: #e6db74; + } /* Literal.String.Heredoc */ + .highlight .si { + color: #e6db74; + } /* Literal.String.Interpol */ + .highlight .sx { + color: #e6db74; + } /* Literal.String.Other */ + .highlight .sr { + color: #e6db74; + } /* Literal.String.Regex */ + .highlight .s1 { + color: #e6db74; + } /* Literal.String.Single */ + .highlight .ss { + color: #e6db74; + } /* Literal.String.Symbol */ + .highlight .bp { + color: #f8f8f2; + } /* Name.Builtin.Pseudo */ + .highlight .fm { + color: #a6e22e; + } /* Name.Function.Magic */ + .highlight .vc { + color: #f8f8f2; + } /* Name.Variable.Class */ + .highlight .vg { + color: #f8f8f2; + } /* Name.Variable.Global */ + .highlight .vi { + color: #f8f8f2; + } /* Name.Variable.Instance */ + .highlight .vm { + color: #f8f8f2; + } /* Name.Variable.Magic */ + .highlight .il { + color: #ae81ff; + } /* Literal.Number.Integer.Long */ +} From 469e41e795d35c9f3d36fab7a843713501e9a6ec Mon Sep 17 00:00:00 2001 From: David Darnes Date: Wed, 3 Jan 2024 09:23:24 +0000 Subject: [PATCH 14/16] Dark mode theming and formatting --- _sass/_settings.scss | 44 ++++++++++++++++++--------- _sass/_theme.scss | 71 +++++++++++++++++++++++++------------------- 2 files changed, 70 insertions(+), 45 deletions(-) diff --git a/_sass/_settings.scss b/_sass/_settings.scss index ccdc60ea4..1b82da793 100644 --- a/_sass/_settings.scss +++ b/_sass/_settings.scss @@ -1,17 +1,33 @@ // Background colours -$backgroundColour: #ffffff !default; -$codeBackgroundColour: #fafafa !default; -$featureBackgroundColour: #f9fafa !default; -$accentColour: #05bf85 !default; +$backgroundColour: var(--background, #ffffff) !default; +$codeBackgroundColour: var(--background-code, #fafafa) !default; +$featureBackgroundColour: var(--background-feature, #f9fafa) !default; +$accentColour: var(--accent, #05bf85) !default; // Text colours -$headingColour: #242e2b !default; -$bodyColour: #384743 !default; -$linkColour: #05bf85 !default; -$hoverColour: #008000 !default; -$focusColour: #fa407a !default; -$captionColour: #a8adac !default; -$white: #ffffff !default; +$headingColour: var(--heading, #242e2b) !default; +$bodyColour: var(--body, #384743) !default; +$linkColour: var(--link, #05bf85) !default; +$hoverColour: var(--hover, #008000) !default; +$focusColour: var(--focus, #fa407a) !default; +$captionColour: var(--caption, #a8adac) !default; +$white: var(--white, #ffffff) !default; + +@mixin dark-scheme { + --background: #111111; + --background-code: #333333; + --background-feature: #343737; + --accent: #05bf85; + + // Text colours + --heading: #ebf8f4; + --body: #f0fffb; + --link: #05bf85; + --hover: #008000; + --focus: #fa407a; + --caption: #a8adac; + --white: #000000; +} // Typography $bodytype: ( @@ -19,20 +35,20 @@ $bodytype: ( regular: 400, bold: 700, italic: italic, - cap-height: 0.75 + cap-height: 0.75, ) !default; $headingtype: ( font-family: '"Merriweather", serif', regular: 400, bold: 700, - cap-height: 0.75 + cap-height: 0.75, ) !default; $monospacetype: ( font-family: "Menlo, monospace", regular: 400, - cap-height: 0.68 + cap-height: 0.68, ) !default; // TIP: Load custom fonts in _config.yaml diff --git a/_sass/_theme.scss b/_sass/_theme.scss index 8bfd4fc21..fe87ce98b 100644 --- a/_sass/_theme.scss +++ b/_sass/_theme.scss @@ -14,7 +14,6 @@ body { margin: 0 auto; } - // Header, feature and footer .header, .footer { @@ -44,7 +43,7 @@ body { } .feature { - padding-bottom: .4rem; + padding-bottom: 0.4rem; margin-bottom: 1.6rem; text-align: center; background: $featureBackgroundColour; @@ -71,7 +70,7 @@ body { .nav { a { - padding: .2rem; + padding: 0.2rem; } &--social a { display: inline-block; @@ -80,7 +79,7 @@ body { } .small { - padding-top: .8rem; + padding-top: 0.8rem; color: $captionColour; display: inline-block; } @@ -102,7 +101,6 @@ body { } } - // Pagination nav .nav--paginator { @include flexbox; @@ -115,7 +113,6 @@ body { min-width: 20%; } - // Main content .main { @include flexbox; @@ -142,7 +139,7 @@ body { } .share .button { - margin-right: .3rem; + margin-right: 0.3rem; } .aside { @@ -151,7 +148,7 @@ body { margin-left: 4%; @include flex(1, 0, auto); opacity: 0.5; - transition: opacity .1s; + transition: opacity 0.1s; .section { position: sticky; top: 0; @@ -171,7 +168,6 @@ body { margin: 0; } - // Lists .list { list-style: none; @@ -189,7 +185,7 @@ body { .item { &--nav { @include breakpoint(break-1) { - margin-left: .4rem; + margin-left: 0.4rem; display: inline-block; } &:first-of-type { @@ -203,10 +199,9 @@ body { } } - // Links, icons and images a .icon { - transition: fill .1s; + transition: fill 0.1s; &:hover { fill: currentColor; } @@ -229,12 +224,12 @@ img { line-height: 0; &--left { float: left; - padding-right: .8rem; + padding-right: 0.8rem; } &--right { float: right; text-align: right; - padding-left: .8rem; + padding-left: 0.8rem; } &--center { text-align: center; @@ -264,7 +259,7 @@ img { .video, .map, .form { - margin-bottom: .8rem; + margin-bottom: 0.8rem; } audio, @@ -272,7 +267,6 @@ video { width: 100%; } - // Form elements and buttons .form { position: relative; @@ -295,16 +289,16 @@ input[type="submit"], input[type="color"], textarea, select { - padding: .6rem 1.2rem; - margin-bottom: .6rem; - transition: color .1s, background-color .1s, border .1s; + padding: 0.6rem 1.2rem; + margin-bottom: 0.6rem; + transition: color 0.1s, background-color 0.1s, border 0.1s; line-height: inherit; border: none; box-shadow: none; border-radius: 0; -webkit-appearance: none; .icon { - margin: 0 0 .35rem; + margin: 0 0 0.35rem; } } @@ -315,15 +309,15 @@ button, display: inline-block; color: $backgroundColour; background: $accentColour; - transition: box-shadow .1s; + transition: box-shadow 0.1s; will-change: box-shadow; box-shadow: inset 0 0 0 2rem transparent; &:hover { - box-shadow: inset 0 0 0 2rem rgba(0,0,0,0.25); + box-shadow: inset 0 0 0 2rem rgba(0, 0, 0, 0.25); } &:active, &:focus { - box-shadow: inset 0 0 0 2rem rgba(0,0,0,0.25); + box-shadow: inset 0 0 0 2rem rgba(0, 0, 0, 0.25); } } @@ -351,8 +345,8 @@ textarea, select { &:focus, &:hover:focus { - outline: solid .12rem $focusColour; - outline-offset: -.12rem; + outline: solid 0.12rem $focusColour; + outline-offset: -0.12rem; } } @@ -378,15 +372,21 @@ select { } textarea { - resize: vertical; + resize: vertical; } label { - @include baseline($fontsize: zeta, $font: $bodytype, $lineheight: 2, $below: 2, $breakpoint: all); + @include baseline( + $fontsize: zeta, + $font: $bodytype, + $lineheight: 2, + $below: 2, + $breakpoint: all + ); } code { - padding: .12rem .2rem; + padding: 0.12rem 0.2rem; color: $headingColour; } @@ -417,7 +417,6 @@ pre code { text-shadow: none; } - // Sassline overrides .typeset { a > code { @@ -447,11 +446,21 @@ pre code { .nav a { padding-left: 0; padding-right: 0; - margin-left: .2rem; - margin-right: .2rem; + margin-left: 0.2rem; + margin-right: 0.2rem; } pre { white-space: pre; overflow-x: scroll; } } + +@media (prefers-color-scheme: dark) { + :root:has(:not([value="light"]:checked)) { + @include dark-scheme(); + } +} + +:root:has([value="dark"]:checked) { + @include dark-scheme(); +} From 3da4d4601cc0a3044f7f3270e90ccdb63c2bc00a Mon Sep 17 00:00:00 2001 From: David Darnes Date: Wed, 3 Jan 2024 09:38:14 +0000 Subject: [PATCH 15/16] Comments on dark colours --- _sass/_settings.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_sass/_settings.scss b/_sass/_settings.scss index 1b82da793..fbdfa607b 100644 --- a/_sass/_settings.scss +++ b/_sass/_settings.scss @@ -13,7 +13,9 @@ $focusColour: var(--focus, #fa407a) !default; $captionColour: var(--caption, #a8adac) !default; $white: var(--white, #ffffff) !default; +// Dark colours @mixin dark-scheme { + // Background colours --background: #111111; --background-code: #333333; --background-feature: #343737; From 914c00a25c5b9c74b51f8e16556e3b663dcc8f4e Mon Sep 17 00:00:00 2001 From: David Darnes Date: Sun, 11 Feb 2024 17:27:34 +0000 Subject: [PATCH 16/16] First pass at adding a color scheme switcher to the footer --- _includes/site-color-scheme.html | 22 +++++++++++++++++ _includes/site-footer.html | 8 ++++--- _includes/site-header.html | 6 ++--- _sass/_settings.scss | 3 +-- _sass/_theme.scss | 41 ++++++++++++++++++++++++++++---- 5 files changed, 67 insertions(+), 13 deletions(-) create mode 100644 _includes/site-color-scheme.html diff --git a/_includes/site-color-scheme.html b/_includes/site-color-scheme.html new file mode 100644 index 000000000..ef680ab58 --- /dev/null +++ b/_includes/site-color-scheme.html @@ -0,0 +1,22 @@ + + + +
+ Color scheme + + + +
+
diff --git a/_includes/site-footer.html b/_includes/site-footer.html index c03cb9e39..3f550dd86 100644 --- a/_includes/site-footer.html +++ b/_includes/site-footer.html @@ -1,9 +1,11 @@
-
diff --git a/_includes/site-header.html b/_includes/site-header.html index c8ba7af54..591361aa9 100644 --- a/_includes/site-header.html +++ b/_includes/site-header.html @@ -1,10 +1,8 @@
- {% if site.logo %}{% include site-logo.html %}{% endif %} - - {% include nav-header.html %} + {% if site.logo %}{% include site-logo.html %}{% endif %} {% include + nav-header.html %}
{% include site-feature.html %} -
diff --git a/_sass/_settings.scss b/_sass/_settings.scss index fbdfa607b..912981090 100644 --- a/_sass/_settings.scss +++ b/_sass/_settings.scss @@ -27,8 +27,7 @@ $white: var(--white, #ffffff) !default; --link: #05bf85; --hover: #008000; --focus: #fa407a; - --caption: #a8adac; - --white: #000000; + --caption: #6f7473; } // Typography diff --git a/_sass/_theme.scss b/_sass/_theme.scss index fe87ce98b..85f53a726 100644 --- a/_sass/_theme.scss +++ b/_sass/_theme.scss @@ -49,12 +49,25 @@ body { background: $featureBackgroundColour; background-size: cover; background-position: center; + position: relative; .container { min-height: 35vh; max-width: 60%; + position: relative; + z-index: 1; @include flex-direction(column); @include justify-content(center); } + &[style]::before { + content: ""; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: $featureBackgroundColour; + opacity: 0.3; + } } .logo { @@ -168,6 +181,26 @@ body { margin: 0; } +.color-scheme { + form, + label { + @include flexbox; + @include align-items(center); + margin: 0; + padding: 0; + } + legend, + input[type="radio"] { + margin-right: 0.15rem; + } + label { + margin-left: 0.4rem; + } + legend::after { + content: ":"; + } +} + // Lists .list { list-style: none; @@ -307,7 +340,7 @@ button, .button { cursor: pointer; display: inline-block; - color: $backgroundColour; + color: $white; background: $accentColour; transition: box-shadow 0.1s; will-change: box-shadow; @@ -426,12 +459,12 @@ pre code { button { background-image: none; text-shadow: none; - color: $backgroundColour; + color: $white; &:hover, &:active, &:focus { background-image: none; - color: $backgroundColour; + color: $white; } } hr { @@ -456,7 +489,7 @@ pre code { } @media (prefers-color-scheme: dark) { - :root:has(:not([value="light"]:checked)) { + :root:not(:has([value="light"]:checked)) { @include dark-scheme(); } }