Design system
++ A shared starting point for Editable. Simple styles, ready to use and adapt. +
+From d549f09601a84fae0726235a7fd4714c7c9673ba Mon Sep 17 00:00:00 2001
From: Michael Aufreiter
+ A shared starting point for Editable. Simple styles, ready to use and adapt.
+ Design system
+
+ A shared scale for headings and body text. +
+display-1
+display-2
+display-3
+display-4
+display-5
+body-xl
++ Good design makes everyday things easier to understand. Clear words, comfortable + spacing, and a thoughtful hierarchy help people find what they need and decide what to + do next. +
+body-lg
++ Good design makes everyday things easier to understand. Clear words, comfortable + spacing, and a thoughtful hierarchy help people find what they need and decide what to + do next. +
+body-base
++ Good design makes everyday things easier to understand. Clear words, comfortable + spacing, and a thoughtful hierarchy help people find what they need and decide what to + do next. +
+body-sm
++ Good design makes everyday things easier to understand. Clear words, comfortable + spacing, and a thoughtful hierarchy help people find what they need and decide what to + do next. +
++ Emphasis and detail within the flow of a sentence. +
++ Start with what people actually need. +
++ Keep the most important information easy to find. +
++ Explore the + typography styles + to see how the scale works. +
+
+ Use font-medium
+ for button labels.
+
+ Highlight the part worth remembering, not the whole paragraph. +
+Explore the typography styles to see how the scale works.
Link · display-1
+
Use font-medium
for button labels.
@@ -180,11 +181,12 @@
Highlight the part worth remembering, not the whole paragraph.
From ac61adc2b9e9898c150bca0b167e2282d4cfab5e Mon Sep 17 00:00:00 2001 From: Michael Aufreiter@@ -19,6 +17,50 @@
+ Center each block with mx-auto max-w-7xl, then add
+ px-5 sm:px-7 inside it. The width limit is 80rem (1280px), including
+ side padding: 1.25rem (20px) on small screens and 1.75rem (28px) from the 40rem (640px) breakpoint,
+ at the default root font size.
+
Page content aligns here.
++ The shaded edges show the shared page padding. Resize the window to compare. +
+<div class="mx-auto max-w-7xl">
+ <div class="px-5 sm:px-7">
+ Page content
+ </div>
+</div>
+ + Keep full-width backgrounds outside the limiter and choose vertical spacing per block. + Narrower reading columns can sit inside this shared page width. Apply the side padding once + so adjacent blocks line up. +
++ Generous spacing separates sections. Compact spacing pulls related blocks together. Each + block has its own top and bottom padding, chosen independently. +
+| Viewport width | Generous | Compact |
|---|---|---|
| Below 640px | 2.5rem · 40px | 1rem · 16px |
| 640–767px | 3.5rem · 56px | 1rem · 16px |
| 768–1023px | 4rem · 64px | 1rem · 16px |
| 1024px and above | 7rem · 112px | 1.75rem · 28px |
+ Pixel equivalents assume the default 16px root font size. Adjacent padding adds up: two + compact edges create a 32px gap, or 56px from 1024px. Two generous edges create an 80px, + 112px, 128px, or 224px gap across the same viewport ranges. +
+Independent content
+First block
+Middle block
+Last block
++ Shaded bands show the padding at its actual size. Resize the window to compare the scale. + Spacing within a block, such as the gap between a heading and a paragraph, is a separate + choice. +
+
+ A top-level block receives its section context through mark, aliased to section. As in Prose.svelte, the block
+ derives its top and bottom padding from that context. No extra padding props are needed.
+
<script lang="ts">
+ import { Node, NodeArrayProperty } from 'svedit';
+ import type { DocumentPath, NodeArrayAttachmentContext } from 'svedit';
+
+ let {
+ path,
+ mark: section = null
+ }: {
+ path: DocumentPath;
+ mark?: NodeArrayAttachmentContext | null;
+ } = $props();
+
+ let padding_top_generous = $derived(!section || section.is_start);
+ let padding_bottom_generous = $derived(!section || section.is_end);
+</script>
+
+<Node {path} class="bg-(--background) text-(--foreground)">
+ <div class="mx-auto max-w-7xl">
+ <div class={[
+ 'px-5 sm:px-7',
+ padding_top_generous
+ ? 'pt-10 sm:pt-14 md:pt-16 lg:pt-28'
+ : 'pt-4 lg:pt-7',
+ padding_bottom_generous
+ ? 'pb-10 sm:pb-14 md:pb-16 lg:pb-28'
+ : 'pb-4 lg:pb-7'
+ ]}>
+ <NodeArrayProperty
+ path={[...path, 'body']}
+ class="flex flex-col gap-5 sm:gap-7"
+ />
+ </div>
+ </div>
+</Node>
+ section.is_start: the top edge is generous.section.is_end: the bottom edge is generous.section.is_middle: both edges are compact; the two
+ boundary checks already cover this case.
+ + This sample is for discussion; the app implementation is unchanged. Responsive classes are + explicit here so the values are visible. Shared spacing utilities can replace those class + strings while keeping the same section-based decisions. +
+<div class="mx-auto max-w-7xl">
- <div class="px-5 sm:px-7">
- Page content
- </div>
+ <div class="px-5 sm:px-7">
+ Page content
+ </div>
</div>
@@ -219,38 +219,38 @@
<script lang="ts">
- import { Node, NodeArrayProperty } from 'svedit';
- import type { DocumentPath, NodeArrayAttachmentContext } from 'svedit';
-
- let {
- path,
- mark: section = null
- }: {
- path: DocumentPath;
- mark?: NodeArrayAttachmentContext | null;
- } = $props();
-
- let padding_top_generous = $derived(!section || section.is_start);
- let padding_bottom_generous = $derived(!section || section.is_end);
+ import { Node, NodeArrayProperty } from 'svedit';
+ import type { DocumentPath, NodeArrayAttachmentContext } from 'svedit';
+
+ let {
+ path,
+ mark: section = null
+ }: {
+ path: DocumentPath;
+ mark?: NodeArrayAttachmentContext | null;
+ } = $props();
+
+ let padding_top_generous = $derived(!section || section.is_start);
+ let padding_bottom_generous = $derived(!section || section.is_end);
</script>
<Node {path} class="bg-(--background) text-(--foreground)">
- <div class="mx-auto max-w-7xl">
- <div class={[
- 'px-5 sm:px-7',
- padding_top_generous
- ? 'pt-10 sm:pt-14 md:pt-16 lg:pt-28'
- : 'pt-4 lg:pt-7',
- padding_bottom_generous
- ? 'pb-10 sm:pb-14 md:pb-16 lg:pb-28'
- : 'pb-4 lg:pb-7'
- ]}>
- <NodeArrayProperty
- path={[...path, 'body']}
- class="flex flex-col gap-5 sm:gap-7"
- />
- </div>
- </div>
+ <div class="mx-auto max-w-7xl">
+ <div class={[
+ 'px-5 sm:px-7',
+ padding_top_generous
+ ? 'pt-10 sm:pt-14 md:pt-16 lg:pt-28'
+ : 'pt-4 lg:pt-7',
+ padding_bottom_generous
+ ? 'pb-10 sm:pb-14 md:pb-16 lg:pb-28'
+ : 'pb-4 lg:pb-7'
+ ]}>
+ <NodeArrayProperty
+ path={[...path, 'body']}
+ class="flex flex-col gap-5 sm:gap-7"
+ />
+ </div>
+ </div>
</Node>
<script lang="ts">
@@ -238,12 +238,8 @@
<div class="mx-auto max-w-7xl">
<div class={[
'px-5 sm:px-7',
- padding_top_generous
- ? 'pt-10 sm:pt-14 md:pt-16 lg:pt-28'
- : 'pt-4 lg:pt-7',
- padding_bottom_generous
- ? 'pb-10 sm:pb-14 md:pb-16 lg:pb-28'
- : 'pb-4 lg:pb-7'
+ padding_top_generous ? 'pt-block-generous' : 'pt-block-compact',
+ padding_bottom_generous ? 'pb-block-generous' : 'pb-block-compact'
]}>
<NodeArrayProperty
path={[...path, 'body']}
@@ -265,9 +261,17 @@
A one-block section is both the start and the end, so both edges are generous.
- This sample is for discussion; the app implementation is unchanged. Responsive classes are
- explicit here so the values are visible. Shared spacing utilities can replace those class
- strings while keeping the same section-based decisions.
+ The app uses shared utilities in src/app.css for the
+ default rhythm: pt-block-generous,
+ pt-block-compact, and their
+ pb- equivalents. They apply the values above to existing elements
+ without adding a wrapper component.
+
+
+ For a custom rhythm, replace the default utility on that edge with explicit responsive
+ classes, such as pt-8 lg:pt-16. Avoid combining a default
+ utility with overrides on the same edge. Keep deliberate exceptions local: flush and
+ full-bleed figures have no vertical padding.
A shared starting point for Editable. Simple styles, ready to use and adapt.
From 0c036954d8cff71b4ad285dc50afa8fd12630a11 Mon Sep 17 00:00:00 2001 From: Michael AufreiterA shared starting point for Editable. Simple styles, ready to use and adapt.
+ Colors, fonts, and corner radii come from the shared tokens in
+ src/app.css. These specimens follow the current token
+ values.
+
+ Keep each surface with its foreground color. Neutral controls use the muted surface on + hover and a 10% foreground tint on press. Primary actions and editing actions use their + respective accent treatments. +
+
+ --background /
+ --foreground
+
Secondary surface
+Supporting text
+
+ --muted /
+ --muted-foreground
+
+ --accent /
+ --accent-foreground
+
+ --editing /
+ --editing-foreground
+
+ --editing-muted /
+ --editing
+
Borders and dividers
+--stroke
Clear words.
+font-sans · Inter
Clear words.
+
+ font-serif · Libertinos Serif Display
+
Clear words.
+font-mono · IBM Plex Mono
+ Buttons and pill shells use the button radius. Popovers cap it at 1rem; their inner rows + and pill controls subtract 4px padding and a 1px border, clamped at zero. Images use their + own radius. Set either token to zero for square corners. +
+ +--button-border-radius
Button radius with an inset interior.
+Button radius capped at 1rem, with an inset row.
+--image-border-radius