Project: Design the Garden's Website

In Exercise: Tidy the Events Stylesheet, you sorted a messy stylesheet into layers, with tokens and short selectors, and the page looked exactly the same afterward. That was the last practice piece. You’ve now tried every part of the garden’s design on the events pages, in their practice file, events/events.css.

The rest of the site hasn’t seen any of it. The home, plots, and about pages have their colors and fonts, but no spacing, and their lines run as wide as the window. In this project, you’ll move the design into the site’s own style.css, so every page shares it. You’ll check each step against screenshots and in DevTools, since you can see the layout there. Start with what Rosa is asking for.

Read Rosa’s Brief

Rosa has seen the events pages, and she’d like the whole site to look as though it belongs together. Here’s what she’s asking for:

  • Text that’s comfortable to read, with the headings in the garden’s own font
  • The upcoming events as cards, as on the events page
  • The plots table with room in its cells and a line between them
  • The home page’s photo of plot 7 as a wide strip across the page, without squashing the tomatoes
  • The volunteers’ long email address kept inside its card, even on a phone
  • A stylesheet the next volunteer can find their way around

All of it goes into one stylesheet, style.css, at the root of your garden/ folder. It already holds the garden’s colors, font, and type sizes as tokens on :root, and the home, plots, and about pages link to it.

The events pages link only to events.css, which pulls style.css into its first layer, site, with the @import rule you added in Order Your Rules With Cascade Layers. In the first step, the events pages link to ../style.css and stop linking to events.css, which this project retires.

You unlink the practice file because every rule you need from it gets rebuilt in style.css. Left linked, its rules would compete with the new ones on each card. Its @import would also load style.css a second time, into the site layer. The Styles pane would then list every site rule twice, once from your link and once under site, and you’d have to work out which copy you’re looking at.

There’s still no flexbox or grid layout, so the cards stack in normal flow, one below the other, in a column centered with max-width and auto margins. Your folder keeps its shape, with events.css left in place but linked from nowhere:

garden/
│
├── events/
│   ├── events.css
│   ├── seed-swap.html
│   ├── upcoming.html
│   └── work-day.html
│
├── fonts/
│   └── fraunces-bold.woff2
│
├── images/
│
├── about.html
├── index.html
├── plots.html
└── style.css

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.