Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
tjkuson authored Jul 18, 2023
2 parents 4ccf6e8 + 4914367 commit 0808a44
Show file tree
Hide file tree
Showing 7 changed files with 1,333 additions and 1,358 deletions.
2 changes: 1 addition & 1 deletion build/bump-version.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const DRY_RUN = process.argv.includes('--dry') || process.argv.includes('--dry-r
const FILES = [
'build/font/css.hbs',
'build/font/scss.hbs',
'config.yml'
'hugo.yml'
]

// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
Expand Down
10 changes: 7 additions & 3 deletions docs/assets/js/color-modes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@
*/

(() => {
const storedTheme = localStorage.getItem('theme')
const getStoredTheme = () => localStorage.getItem('theme')
const setStoredTheme = theme => localStorage.setItem('theme', theme)

const getPreferredTheme = () => {
const storedTheme = getStoredTheme()
if (storedTheme) {
return storedTheme
}

return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
}

const setTheme = function (theme) {
const setTheme = theme => {
if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute('data-bs-theme', 'dark')
} else {
Expand Down Expand Up @@ -54,7 +56,8 @@
}

window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
if (storedTheme !== 'light' || storedTheme !== 'dark') {
const storedTheme = getStoredTheme()
if (storedTheme !== 'light' && storedTheme !== 'dark') {
setTheme(getPreferredTheme())
}
})
Expand All @@ -67,6 +70,7 @@
toggle.addEventListener('click', () => {
const theme = toggle.getAttribute('data-bs-theme-value')
localStorage.setItem('theme', theme)
setStoredTheme(theme)
setTheme(theme)
showActiveTheme(theme, true)
})
Expand Down
2 changes: 1 addition & 1 deletion docs/content/icons/arrow-bar-down.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Arrow bar bottom
title: Arrow bar down
categories:
- Arrows
tags:
Expand Down
2 changes: 1 addition & 1 deletion docs/layouts/_default/sprite.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<nav aria-label="breadcrumb">
<ol class="breadcrumb my-4 p-0">
<li class="breadcrumb-item"><a href="/">Icons</a></li>
<li class="breadcrumb-item active" aria-current="page">SVG Spite</li>
<li class="breadcrumb-item active" aria-current="page">SVG Sprite</li>
</ol>
</nav>
{{ partialCached "icons" . "fonts" }}
Expand Down
File renamed without changes.
Loading

0 comments on commit 0808a44

Please sign in to comment.