22 students 11 weeks
5 hours/week in class ยท 10 hours/week at home
Project 1: Signal + State Project
Project 1: Signal & State โ Checklist
checklist.md
Project 1: Signal & State โ Checklist
Use this checklist before submitting.
Checklist
Tokens
variables.css exists and is linked in HTML
Color tokens defined (surface, text, accent โ minimum)
Typography tokens defined (font sizes)
Spacing tokens defined (at least 3 values)
Tokens are actually used in your CSS (not hardcoded values)
Theme Toggle
Toggle UI is present and visible
Light mode works
Dark mode works
System mode works (follows OS preference)
Toggle feedback is immediate (no delay)
Persistence
Theme choice saves to localStorage
Theme persists after page refresh
First visit respects system preference
Accessibility
Toggle buttons have aria-labels
Toggle buttons are keyboard accessible (can Tab to them)
Focus states are visible
prefers-reduced-motion foundation is in CSS
Deployment
Site is live on GitHub Pages
README has project description
No console errors
Quick Tests
localStorage Test
Open DevTools โ Application โ Local Storage
Click your domain
You should see a theme key with your chosen value
System Preference Test
Open DevTools โ More Tools โ Rendering
Scroll to "Emulate CSS media feature prefers-color-scheme"
Select "dark" โ page should update (if theme is set to "system")
Keyboard Test
Use Tab to navigate to toggle buttons
Press Enter or Space to activate
Focus ring should be visible throughout
Common Issues
Problem
Check
Theme doesn't persist
Is localStorage.setItem being called?
System mode doesn't update
Is the matchMedia listener set up?
Colors don't change
Are you using var(--token-name) not hardcoded colors?
Focus not visible
Did you remove default focus styles without adding custom ones?
Project 1: Signal & State
project-1-brief.md
Project 1: Signal & State
Theme: Designing for Preference
Question: How does your site adapt to the user?
Weight: 20% of course grade
Due: End of Week 3
Overview
You're building an adaptive system โ a portfolio that responds to user preferences, remembers their choices, and respects their system settings.
This isn't just a theme toggle. It's a foundation. The design tokens you create here will carry through every project this quarter. The patterns you learn (state โ CSS response) will power every interaction you build.
What You're Building
Design Tokens โ CSS variables that define your visual language
Theme Toggle โ Light, Dark, and System modes
Persistence โ localStorage remembers user choice
Preference Detection โ First-time visitors get their system preference
Reduced Motion โ Accessibility foundation for animation
Requirements
Design Tokens (variables.css)
Create a variables.css file with your design decisions in one place:
Follow these guides to complete your theme system:
โ Practice 3-1: The Inheritance โ Export Figma tokens, upgrade to data-theme
โ Practice 3-2: The Preference โ Add localStorage + system preference detection
Not currently scheduled โ This enhancement stage may be added later in the quarter.
Enhancement: Fluid tokens with clamp()
Core Challenge
Upgrade your token system with fluid typography and spacing using clamp().
Requirements
Add fluid font sizes using clamp()
At minimum: base font size, heading size
Add fluid spacing using clamp()
At minimum: one spacing token
Tokens scale smoothly between mobile and desktop
No media queries needed for these fluid values
Update README with rationale for your fluid values
What is clamp()?
/* Syntax: clamp(minimum, preferred, maximum) */
:root {
/* Font that scales from 1rem to 1.25rem based on viewport */
--font-size-base: clamp(1rem, 0.875rem + 0.5vw, 1.25rem);
/* Spacing that scales from 1rem to 2rem */
--space-md: clamp(1rem, 0.5rem + 2vw, 2rem);
}
The middle value (0.875rem + 0.5vw) creates the fluid behavior. As viewport grows, the value smoothly transitions between min and max.
Fluid tokens connect to the core question: "How does it adapt to me?" Your system now adapts not just to user preference (light/dark) but also to their device and context.