mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-12-07 17:38:56 -05:00
fix style regressions (code was never actually using Hack font I think..?)
and allow default theme (light or dark) to be set in Hugo config and reflected in both HTML & JS
This commit is contained in:
@@ -17,7 +17,8 @@
|
||||
var light = "light";
|
||||
|
||||
// which class is <body> set to initially?
|
||||
var default_theme = light;
|
||||
// eslint-disable-next-line
|
||||
var default_theme = "{{ .Site.Params.defaultTheme }}";
|
||||
|
||||
// use an element with class `dark-mode-toggle` to trigger swap when clicked
|
||||
var toggle = doc.querySelector(".dark-mode-toggle");
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
@charset "UTF-8";
|
||||
|
||||
code,
|
||||
pre {
|
||||
font-family: $webfont-mono;
|
||||
font-size: 0.95em;
|
||||
letter-spacing: normal;
|
||||
}
|
||||
|
||||
// all code
|
||||
code {
|
||||
font-family: $webfont-mono;
|
||||
font-size: 0.95em;
|
||||
letter-spacing: 0;
|
||||
page-break-inside: avoid; // stylelint-disable-line plugin/no-unsupported-browser-features
|
||||
}
|
||||
@@ -25,15 +30,15 @@ code {
|
||||
|
||||
// code fences
|
||||
div.highlight {
|
||||
font-size: 0.975em;
|
||||
line-height: 1.7;
|
||||
line-height: 1.6;
|
||||
max-width: 100%;
|
||||
overflow-x: scroll;
|
||||
margin: 1em 0;
|
||||
border: 1px solid;
|
||||
|
||||
pre {
|
||||
padding-left: 1.7em;
|
||||
padding-left: 1.5em;
|
||||
margin: 1em 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user