Layout and UI

View saved

Goal

This snapshot advances Wavelength Daily by teaching you to build shared navigation with Open Props and scoped CSS.

Each numbered folder is a complete app. Run it independently and compare adjacent snapshots to isolate the new responsibility.

Prerequisites

Use Node.js 20 or newer, npm, and a terminal. Basic TypeScript, HTML, and CSS familiarity will help.

The development server uses port 5173. Database snapshots also need Docker and the Supabase CLI.

  • Node.js and npm
  • A code editor
  • Docker from part 4 onward

Concepts

Open Props supplies design tokens while Svelte style blocks scope component rules automatically.

SvelteKit keeps route UI, server loading, and form actions close together while preserving a clear browser/server boundary.

Walkthrough

Import shared primitives once, then keep hero, card, navigation, and responsive rules beside their components.

Trace the example from request to rendered page, then inspect the complete matching snapshot for types, validation, and failure handling.

<style>.hero { padding-block: var(--size-10); }</style>

Run and verify

Enter 03-Layout-And-UI, install dependencies, and start the app. Supabase stages must start the local stack and copy the printed anon key into .env.

Open http://localhost:5173 and keep the terminal visible so browser actions can be matched to server errors.

git clone https://github.com/michaeldunga1/fcc-sveltekit-blog.git
cd fcc-sveltekit-blog/03-Layout-And-UI
npm install
npm run dev

Troubleshooting

If tokens are missing, verify the Open Props imports and that npm installed the package.

A missing package usually means npm install ran in another snapshot. After changing environment variables, restart the SvelteKit process.

  • Read the first error first
  • Check the current snapshot path
  • Never commit .env or node_modules

Try this

Create a compact mobile navigation without adding a CSS framework.

Test one happy path and one invalid or unauthorized path before moving on.

  • Make one focused change
  • Verify it in the browser
  • Compare with the next snapshot after it works

Next: Data Layer

Comments

One comment per signed-in account. Comments are saved with this page’s URL.