Scaffolded Page Styling
Time to put your learning into practice. In this assignment you will add a new page to your portfolio and style it entirely with custom properties, math functions, and native CSS nesting. You will work from provided HTML so you can focus on the CSS, and you will establish the directory pattern you will follow for every assignment going forward.
Assignment Instructions
1. Set Up the Directory
Create the following folder structure inside your portfolio repository. This establishes the convention you will use all semester: each unit gets its own directory, and each assignment or choose topic gets a subdirectory inside it.
[portfolio]
├── css/
│ └── main.css
├── unit-1/
│ └── custom-properties/
│ ├── index.html # New
│ └── styles.css # New
├── index.html # Update: Add Link
└── README.md # Update: Pages Links
The unit-1/custom-properties/ directory is where this assignment lives. Future assignments will follow the same pattern (for example unit-2/layered-components/ or unit-2/scope/ for a choose topic).
2. Add the HTML
Create unit-1/custom-properties/index.html and paste in the following HTML. This is a ward activity board with multiple sections of event cards. Do not modify the HTML structure. Your job is to style it using the CSS techniques you learned this week.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ward Activity Board</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<nav class="site-nav">
<a href="../../index.html">← Home</a>
</nav>
<header class="board-header">
<h1>Riverside 4th Ward</h1>
<p>Upcoming activities, service opportunities, and announcements.</p>
</header>
<main>
<section class="card-group">
<h2>This Week</h2>
<div class="cards">
<article class="card">
<div class="card-tag">Service</div>
<h3>Food Bank Volunteer Day</h3>
<p>Help sort and package donations at the community food bank. Families welcome. Meet in the east parking lot at 8:00 AM.</p>
<div class="card-meta">
<span>Saturday, 8:00 AM</span>
<a href="#">Details</a>
</div>
</article>
<article class="card">
<div class="card-tag">Youth</div>
<h3>Standards Night</h3>
<p>An evening focused on preparing for mission calls, temple covenants, and building a Christlike life. Refreshments provided.</p>
<div class="card-meta">
<span>Friday, 7:00 PM</span>
<a href="#">Details</a>
</div>
</article>
<article class="card">
<div class="card-tag">Ward</div>
<h3>Potluck Dinner</h3>
<p>Bring a dish to share and enjoy an evening of food and fellowship in the cultural hall. All families are invited.</p>
<div class="card-meta">
<span>Saturday, 5:30 PM</span>
<a href="#">Details</a>
</div>
</article>
</div>
</section>
<section class="card-group">
<h2>Coming Up</h2>
<div class="cards">
<article class="card">
<div class="card-tag">Relief Society</div>
<h3>Enrichment Night</h3>
<p>Developing Christlike attributes through creative arts. Supplies provided. Bring a friend who might enjoy the evening.</p>
<div class="card-meta">
<span>Wednesday, 6:30 PM</span>
<a href="#">Details</a>
</div>
</article>
<article class="card">
<div class="card-tag">Elders Quorum</div>
<h3>Moving Help Needed</h3>
<p>A family in the ward is relocating this month. Sign up to help load and unload on moving day. Trucks are arranged.</p>
<div class="card-meta">
<span>Next Saturday, 9:00 AM</span>
<a href="#">Details</a>
</div>
</article>
<article class="card">
<div class="card-tag">Stake</div>
<h3>Stake Conference</h3>
<p>General session on Sunday at 10:00 AM. Adult session Saturday evening at 7:00 PM. No regular ward meetings this week.</p>
<div class="card-meta">
<span>Sunday, 10:00 AM</span>
<a href="#">Details</a>
</div>
</article>
</div>
</section>
<section class="card-group">
<h2>Announcements</h2>
<div class="cards">
<article class="card">
<div class="card-tag">Bishopric</div>
<h3>New Calling Sustainings</h3>
<p>Several new callings will be presented for a sustaining vote during sacrament meeting this Sunday. Please plan to attend.</p>
<div class="card-meta">
<span>This Sunday</span>
</div>
</article>
<article class="card">
<div class="card-tag">Temple</div>
<h3>Temple Night</h3>
<p>Ward temple night is the second Friday of each month. Contact the temple committee for ride sharing and scheduling.</p>
<div class="card-meta">
<span>Second Friday Monthly</span>
<a href="#">Sign Up</a>
</div>
</article>
</div>
</section>
</main>
<footer class="board-footer">
<p>© Riverside 4th Ward. Built as a WDD 331R assignment.</p>
</footer>
</body>
</html>
3. Write the CSS
Create unit-1/custom-properties/styles.css and write all of your styles in this file. Start with the scaffolding below, then fill in every section marked with comments. Your completed stylesheet must meet these requirements:
-
At least 7 custom properties on
:rootcovering color, spacing, typography, and border radius. Name them by purpose, not appearance. -
At least one
clamp()for fluid sizing (font size or padding that scales with the viewport). -
At least one
calc()that derives a value from a token (for example, doubling a spacing token for larger gaps). -
At least one
var()fallback demonstrating the fallback pattern. -
All CSS must use native nesting. Descendant selectors should not use
&. Use&only for pseudo classes, compound selectors, or reversing context. - The page should look presentable. You have creative freedom with colors, fonts, and layout decisions, but the cards should be arranged in a grid or flex layout, text should be readable, and the overall page should feel intentional.
Here is the CSS scaffolding to start from. Read the comments carefully and replace each placeholder section with your own styles.
/* ========================================
TOKENS
Define your design decisions here.
Everything else in this file should
reference these tokens with var().
======================================== */
:root {
/* Colors: at least primary, background, text, accent */
/* Spacing: at least sm, md, lg */
/* Typography: font family, base size */
/* Borders: radius */
}
/* ========================================
RESET
A minimal reset so you start clean.
======================================== */
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
/* ========================================
BASE STYLES
Style the body, links, and any raw
HTML elements here. Use nesting.
======================================== */
body {
/* font family, color, background, line-height, padding */
/* Use clamp() for padding to make it fluid. */
a {
/* link color from tokens */
&:hover {
/* hover color from tokens */
}
}
}
/* ========================================
NAVIGATION
Style .site-nav so students can get
back to the homepage.
======================================== */
.site-nav {
/* padding, margin-bottom */
}
/* ========================================
BOARD HEADER
Style the page header area.
======================================== */
.board-header {
/* text alignment, margin, padding */
/* Use clamp() for the h1 font size. */
h1 {
/* fluid font size */
}
p {
/* muted text color, spacing */
}
}
/* ========================================
CARD GROUP
Each section of cards (This Week,
Coming Up, Announcements).
======================================== */
.card-group {
/* margin-bottom using a token */
h2 {
/* section heading styles */
}
}
/* ========================================
CARDS GRID
Layout the .cards container as a
responsive grid or flex layout.
======================================== */
.cards {
/* display, gap (use calc to derive from a token), columns */
}
/* ========================================
INDIVIDUAL CARD
Style each .card article. This is where
most of your nesting will happen.
======================================== */
.card {
/* background, padding, border-radius, shadow */
/* Use a var() with a fallback value here. */
.card-tag {
/* small label: font-size, padding, background, border-radius */
}
h3 {
/* card title styles */
}
p {
/* card body text */
}
.card-meta {
/* bottom row: flexbox with space-between */
/* style the span and link inside here with nesting */
}
}
/* ========================================
FOOTER
Style the .board-footer at the bottom.
======================================== */
.board-footer {
/* text alignment, padding, muted color, top border */
}
4. Add Navigation to Your Homepage
Open your portfolio homepage (index.html at the root) and add a link to this assignment page. This is the beginning of your site navigation. You can use a simple list, a nav element, or whatever structure you prefer. The important thing is that a visitor to your homepage can find your work.
<nav>
<h2>Assignments</h2>
<ul>
<li>
<a href="unit-1/custom-properties/index.html">
Custom Properties and Nesting
</a>
</li>
</ul>
</nav>
As you complete future assignments and choose topics, you will keep adding links here. By the end of the semester your homepage will be a table of contents for everything you built.
5. Update the README
Open your README.md and add a link to this assignment under the Pages section. Use a clear, descriptive title for the link.
## Pages
- [Home](index.html)
- [Custom Properties and Nesting](unit-1/custom-properties/index.html)
6. Commit, Push, and Verify
Stage your changes, commit with a descriptive message, and push to GitHub. Verify that the deployment workflow succeeds and that your new page loads on your live site with styles applied.
git add -A
git commit -m "Add custom properties and nesting assignment"
git push origin main
Visit your live site and confirm that the homepage links to the assignment page, the assignment page links back home, and the ward activity board is styled according to your CSS. Check the page at different browser widths to make sure your clamp() values are working.
Submission
Complete the report below with your site details and reflection. When you are finished, click the download button to generate a PDF and submit it to Canvas.
My live ward activity board is at and the source code is at .
Write a thoughtful response to each prompt. Connect your answers to what you learned and how it applies beyond this assignment.
You wrote all of your CSS using native nesting. Compare the experience to writing flat, non-nested CSS. Where did nesting make your stylesheet clearer, and was there a point where it started to feel like too much? How would you decide where to stop nesting in a larger project?
Your stylesheet derives values from tokens using calc() and clamp(). Pick one of those derived values and explain what would happen if you changed the base token it depends on. How many places in your stylesheet would be affected, and why does that matter on a team?
Look at your finished ward activity board at a narrow mobile width and a wide desktop width. Describe one specific thing that clamp() or your responsive layout handled automatically that would have required a media query in traditional CSS: