Skill 07 · Stitch::extract Design Md
Subchapter 7.4
references/svelte.mdMarkdown3 KBView on GitHub
Svelte co-locates styles even more tightly than Vue. Every .svelte file
has a <style> block that is scoped by default. Design systems in Svelte
projects typically live in global CSS, CSS custom properties, or a shared
theme store.
src/app.css / src/app.postcss — Global styles and CSS custom
properties. The most important file.
svelte.config.js — May reference CSS preprocessors, Tailwind, or
UnoCSS configuration.
tailwind.config.js (if Tailwind/UnoCSS) — Same extraction as React.
src/lib/theme.ts / src/lib/tokens.ts — Shared design tokens
exported as JS objects.
src/routes/+layout.svelte — Root layout. Shows global font loading,
background, and structural patterns.
Component <style> blocks — Scoped styles revealing component patterns.
<script>
export let variant = 'primary'
</script>
<button class="btn btn-{variant}">
<slot />
</button>
<style>
.btn {
border-radius: 8px;
padding: 0.875rem 2rem;
font-weight: 500;
transition: all 250ms ease-in-out;
}
.btn-primary {
background-color: var(--color-primary);
color: white;
}
.btn-primary:hover {
filter: brightness(0.9);
}
</style>Extraction points:
variant) reveal the intended variant systemvar(--*) references → trace to app.css+layout.svelte at route root — Global header, footer, font loading+layout.ts/js — May load theme data or tokens$lib/ directory — Reusable components and shared utilitiesSvelte projects heavily use CSS custom properties for theming:
/* app.css */
:root {
--color-primary: #294056;
--color-bg: #FCFAFA;
--color-surface: #F5F5F5;
--color-text: #2C2C2C;
--color-text-muted: #6B6B6B;
--font-heading: 'Manrope', sans-serif;
--font-body: 'Inter', sans-serif;
--radius-sm: 8px;
--radius-md: 12px;
--radius-full: 9999px;
--shadow-hover: 0 2px 8px rgba(0,0,0,0.06);
--spacing-section: 5rem;
}These variable names are highly intentional. Use them as the foundation of your design system extraction.
If component libraries are used:
tailwind.config.js using Skeleton’s
design token system. Look for custom theme config object.tailwind.config.js → daisyui.themes array.