Project: Make the Garden Site Responsive

In Exercise: Highlight the Free Plots, you made the free rows on a plots page stand out based on their contents. That was the last new idea of the course. In each lesson, you fixed one slice of the garden’s site, in garden-practice/, and most of the site still uses a desktop layout that scrolls sideways on a phone.

In this project, you’ll carry every move into the real site, garden/, and finish the parts the lessons left alone, until each page works from a 320-pixel phone to a wide screen and at 200 percent zoom. You’ll check the result yourself against screenshots and a checklist. Start with what Rosa is asking for.

Read Rosa’s Brief

Rosa has looked at the visits, and most people open the site on a phone to check when the next work day starts. Here’s what she wants:

  • No page scrolls sideways, on a 320-pixel phone or at 200 percent zoom.
  • The header stacks the garden’s name above the links until the row fits.
  • The home page stacks the welcome and Tomás’s note on a phone, with the sidebar on a wider screen.
  • The event cards fill the column, each card’s day and time on one line once there’s room.
  • The plot map stays readable on a phone, and on a wider screen it shows the garden’s real layout, with the plots on the right half.
  • Headings and spacing grow smoothly with the screen instead of jumping at a breakpoint.
  • The hero photo downloads at a size that suits the screen, in a modern format, with a JPEG for older browsers.
  • Tomás’s volunteer card sits in the home page’s sidebar as well as on the volunteers page and fits both.
  • Every free plot stands out, without anyone adding a class by hand.

Every rule still goes into style.css, in the layer where that kind of rule lives. Page-level media queries go in layout, beside the layout they change. Fluid sizes go into the --size-* and --space-* tokens in tokens. A component that appears in more than one place keeps its rules in components, while the page decides in layout which element is its slot.

Work in garden/, Check in the Browser

You worked in garden-practice/ during the lessons so that garden/, the starter folder you downloaded at the start of the course, stayed untouched. For this project, you’ll work in garden/. Each exercise grades one part of the project. Its editor holds the layered style.css and any page whose markup changes. After your solution passes, copy each change into your own garden/ files.

CSS goes into the same layer of garden/style.css, and markup goes into the matching page: the hero’s <picture> and Tomás’s card into index.html, and plot 12’s row without its class="free" into plots.html. Copy the photo files separately, as described in the hero and card steps. Then check the pages in the live preview.

The tests apply your stylesheet to their own copies of the garden’s pages. They stack your layers in the order you declare them, fill in the tokens, and read each element’s final values. They can’t draw, scroll, or measure a page, though, so the screenshots and checklist at the end of this brief are how you check the layout.

Copy the Lessons’ Slices Into garden/

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.