Skip to content

Instantly share code, notes, and snippets.

View abegehr's full-sized avatar
👨‍💻

Anton Begehr abegehr

👨‍💻
View GitHub Profile
@abegehr
abegehr / AppRouter.svelte
Last active May 16, 2025 18:01
Simple AppRouter with nested and guarded route definitions for Svelte SPA with browser history support in <200 lines backed by nanostores.
<script module>
/*
Sample usage:
```svelte
<script lang="ts>
import AppRouter, { type Router } from "./AppRouter.svelte";
import Login from "./pages/Login.svelte";
import Home from "./pages/Home.svelte";
import Messages from "./pages/Messages.svelte";

I'm using svelte 5 instead of svelte 4 here is an overview of the changes.

Overview

Svelte 5 introduces runes, a set of advanced primitives for controlling reactivity. The runes replace certain non-runes features and provide more explicit control over state and effects.

$state

  • Purpose: Declare reactive state.
  • Usage:
@ConstantinHvber
ConstantinHvber / TailwindCSS_LLMs.txt
Created April 21, 2025 09:52
AI generated LLMs.txt for the Tailwind CSS docs (April 21, 2025)
# Tailwind CSS LLMs.txt Documentation
> This document provides a comprehensive overview of Tailwind CSS utility classes, examples, and customization options. It covers various CSS properties like layout, spacing, typography, backgrounds, borders, effects, transitions, transforms, and more, explaining how to use Tailwind's utility classes to style web elements effectively and responsively.
This document details the documentation of Tailwind CSS utilities. It explains how Tailwind scans source files for classes, the importance of using complete class names, and how utility classes can be applied conditionally using variants for states (hover, focus), responsive breakpoints, dark mode, and other conditions. It also covers customization via theme variables and adding custom styles.
**Core Concepts (from styling-with-utility-classes.mdx & responsive-design.mdx):**
* **Utility-First:** Style elements by combining many single-purpose utility classes directly in HTML.
* **Constraint-Based:** Utilities general