mirror of
https://github.com/thiloho/aurora.git
synced 2025-11-22 03:21:35 +01:00
Correct tab size and adjust toc
This commit is contained in:
@@ -55,6 +55,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
max-inline-size: 100%;
|
inline-size: 100%;
|
||||||
|
margin-block-start: 0.25rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -7,27 +7,27 @@
|
|||||||
let summaryElement: HTMLElement;
|
let summaryElement: HTMLElement;
|
||||||
|
|
||||||
function openMenu() {
|
function openMenu() {
|
||||||
detailsElement.setAttribute("open", "");
|
detailsElement.setAttribute("open", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function closeMenu() {
|
export function closeMenu() {
|
||||||
detailsElement.removeAttribute("open");
|
detailsElement.removeAttribute("open");
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleKeydown(event: KeyboardEvent) {
|
function handleKeydown(event: KeyboardEvent) {
|
||||||
if (event.key === "Escape") closeMenu();
|
if (event.key === "Escape") closeMenu();
|
||||||
|
|
||||||
if (event.key === shortcut) {
|
if (event.key === shortcut) {
|
||||||
summaryElement.focus();
|
summaryElement.focus();
|
||||||
openMenu();
|
openMenu();
|
||||||
} else if (possibleShortcuts.includes(event.key) && event.key !== shortcut) {
|
} else if (possibleShortcuts.includes(event.key) && event.key !== shortcut) {
|
||||||
closeMenu();
|
closeMenu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleClick(event: MouseEvent) {
|
function handleClick(event: MouseEvent) {
|
||||||
if (!detailsElement.contains(event.target as Node)) {
|
if (!detailsElement.contains(event.target as Node)) {
|
||||||
closeMenu();
|
closeMenu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -12,6 +12,6 @@ const { title, description } = Astro.props;
|
|||||||
<meta name="description" content={description} />
|
<meta name="description" content={description} />
|
||||||
<script is:inline>
|
<script is:inline>
|
||||||
const storedTheme = localStorage.getItem("theme");
|
const storedTheme = localStorage.getItem("theme");
|
||||||
document.documentElement.classList = storedTheme;
|
document.documentElement.className = storedTheme;
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -1,34 +1,41 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { MarkdownHeading } from "astro";
|
import type { MarkdownHeading } from "astro";
|
||||||
|
|
||||||
export let headings: MarkdownHeading[] = [];
|
export let headings: MarkdownHeading[] = [];
|
||||||
|
|
||||||
import Dropdown from "./Dropdown.svelte";
|
import Dropdown from "./Dropdown.svelte";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Dropdown shortcut="C">
|
<Dropdown shortcut="C">
|
||||||
<svg slot="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon">
|
<svg slot="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon">
|
||||||
<title>Table of contents (Shift + c)</title>
|
<title>Table of contents (Shift + c)</title>
|
||||||
<path fill-rule="evenodd" d="M2.625 6.75a1.125 1.125 0 112.25 0 1.125 1.125 0 01-2.25 0zm4.875 0A.75.75 0 018.25 6h12a.75.75 0 010 1.5h-12a.75.75 0 01-.75-.75zM2.625 12a1.125 1.125 0 112.25 0 1.125 1.125 0 01-2.25 0zM7.5 12a.75.75 0 01.75-.75h12a.75.75 0 010 1.5h-12A.75.75 0 017.5 12zm-4.875 5.25a1.125 1.125 0 112.25 0 1.125 1.125 0 01-2.25 0zm4.875 0a.75.75 0 01.75-.75h12a.75.75 0 010 1.5h-12a.75.75 0 01-.75-.75z" clip-rule="evenodd" />
|
<path fill-rule="evenodd" d="M2.625 6.75a1.125 1.125 0 112.25 0 1.125 1.125 0 01-2.25 0zm4.875 0A.75.75 0 018.25 6h12a.75.75 0 010 1.5h-12a.75.75 0 01-.75-.75zM2.625 12a1.125 1.125 0 112.25 0 1.125 1.125 0 01-2.25 0zM7.5 12a.75.75 0 01.75-.75h12a.75.75 0 010 1.5h-12A.75.75 0 017.5 12zm-4.875 5.25a1.125 1.125 0 112.25 0 1.125 1.125 0 01-2.25 0zm4.875 0a.75.75 0 01.75-.75h12a.75.75 0 010 1.5h-12a.75.75 0 01-.75-.75z" clip-rule="evenodd" />
|
||||||
</svg>
|
</svg>
|
||||||
<ul>
|
<ul>
|
||||||
{#each headings.filter(({ depth }) => depth === 2) as { slug, text }}
|
{#each headings.filter(({ depth }) => depth === 2) as { slug, text }}
|
||||||
<li>
|
<li>
|
||||||
<a href="#{slug}">{text}</a>
|
<a href="#{slug}">{text}</a>
|
||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
</ul>
|
</ul>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
ul {
|
ul {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border: var(--standard-border);
|
border: var(--standard-border);
|
||||||
padding: 1rem;
|
padding-inline-start: 2rem;
|
||||||
padding-inline-start: 2rem;
|
background-color: var(--background-color);
|
||||||
background-color: var(--background-color);
|
inset-block-start: var(--nav-height);
|
||||||
inset-block-start: var(--nav-height);
|
margin: 0;
|
||||||
margin: 0;
|
padding: 0;
|
||||||
inset-inline-end: 0;
|
list-style: none;
|
||||||
}
|
inset-inline-end: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
display: block;
|
||||||
|
padding-inline: 1rem;
|
||||||
|
padding-block: 0.25rem;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
let theme = "System";
|
let theme = "System";
|
||||||
|
|
||||||
function loadTheme() {
|
function loadTheme() {
|
||||||
theme = localStorage.getItem("theme");
|
theme = localStorage.getItem("theme") || "System";
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveTheme() {
|
function saveTheme() {
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
loadTheme();
|
loadTheme();
|
||||||
|
|
||||||
$: document.documentElement.classList = theme;
|
$: document.documentElement.className = theme;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Dropdown shortcut="T">
|
<Dropdown shortcut="T">
|
||||||
|
|||||||
Reference in New Issue
Block a user