diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..1ff0209 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,7 @@ +Copyright 2024 Oskar Wickström + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/index.css b/index.css index 50b19c3..ca2d91f 100644 --- a/index.css +++ b/index.css @@ -156,7 +156,7 @@ table tbody tr:first-child > * { th { - font-weight: 600; + font-weight: 700; } .width-min { width: 0%; @@ -165,8 +165,11 @@ th { width: 100%; } -header { - padding: 0; +.header { + margin-bottom: calc(var(--line-height) * 2); +} +.header tr td:last-child { + text-align: right; } p { @@ -218,6 +221,19 @@ ul { list-style-type: square; padding: 0 0 0 2ch; } +ol { + list-style-type: none; + counter-reset: item; + padding: 0; +} +ol ol { + padding: 0 0 0 3ch; +} +ol li:before { + content: counters(item, ".") ". "; + counter-increment: item; + font-weight: 600; +} li { margin: 0; @@ -250,6 +266,21 @@ input, button, textarea { -webkit-appearance: none; } +input[type=checkbox] { + display: inline-grid; + place-content: center; + vertical-align: middle; + width: 2ch; + height: var(--line-height); + cursor: pointer; +} +input[type=checkbox]:checked:before { + content: ""; + width: 1ch; + height: calc(var(--line-height) / 2); + background: var(--text-color); +} + button:focus, input:focus { --border-thickness: 3px; outline: none; @@ -373,9 +404,6 @@ label input { background: rgba(255, 0, 0, 0.1); } -.debug-toggle { - position: absolute; - top: 0; - right: 0; - margin: var(--line-height) 2ch; +.debug-toggle-label { + text-align: right; } diff --git a/index.js b/index.js index 593f6a9..a624c5b 100644 --- a/index.js +++ b/index.js @@ -52,7 +52,7 @@ function checkOffsets() { const config = { childList: true, subtree: true }; const callback = () => { - const elements = document.querySelectorAll("body :not(.debug-grid)"); + const elements = document.querySelectorAll("body :not(.debug-grid, .debug-toggle)"); for (const element of elements) { const offset = element.offsetTop % 10; if(element.offsetParent == document.body && offset > 0) { @@ -70,9 +70,9 @@ function checkOffsets() { observer.observe(targetNode, config); } -window.addEventListener("load", checkOffsets); - -const debugButton = document.querySelector(".debug-toggle"); -debugButton.addEventListener("click", () => { - document.body.classList.toggle("debug"); -}); +const debugToggle = document.querySelector(".debug-toggle"); +function onDebugToggle() { + document.body.classList.toggle("debug", debugToggle.checked); +} +debugToggle.addEventListener("change", onDebugToggle); +onDebugToggle(); diff --git a/index.md b/index.md index 2130d96..41aadd0 100644 --- a/index.md +++ b/index.md @@ -1,9 +1,11 @@ --- title: The Monospace Web +subtitle: A minimalist design exploration author: Oskar Wickström -date: August 2024 +date: 2024-08-30 lang: en toc-title: Contents +version: v0.1.0 --- ## Introduction @@ -28,21 +30,34 @@ I might update it over time with improvements and support for more standard elem ## The Basics -Look at this lovely horizontal break: +Regular old semantic HTML should render nicely. +This document uses a few extra classes here and there, but mostly it's just markup. + +Look at this horizontal break:
-Or a plain old bulleted list: +Lovely. + +## Lists + +This is a plain old bulleted list: * Banana * Paper boat * Cucumber * Rocket -## Trees +Ordered lists look pretty much as you'd expect: + +1. Goals +1. Motivations + 1. Intrinsic + 1. Extrinsic +1. Second-order effects It's nice to visualize trees. -This is a regular unordered list with a _tree_ class: +This is a regular unordered list with a `tree` class: