Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions week_six/01-intro_challenge/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>CSS Detective</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>

<header class="site-header">
<h1>CSS Detective</h1>
<nav class="site-nav">
<a href="#cards">Cards</a>
<a href="#form">Form</a>
<a href="#list">List</a>
</nav>
</header>

<main class="stack">
<section id="cards" class="stack">
<h2>Cards</h2>

<div class="card-grid">
<article class="card">
<h3>Card One</h3>
<p>Some text here.</p>
<button class="btn btn-primary">Primary</button>
<button class="btn">Secondary</button>
</article>

<article class="card">
<h3>Card Two</h3>
<p>Some text here.</p>
<button class="btn">Secondary</button>
<button class="btn">Secondary</button>
</article>
</div>
</section>

<section id="form" class="stack">
<h2>Form</h2>
<form class="stack">
<label>Email
<input type="email" placeholder="you@example.com" required />
</label>

<label>Password
<input type="password" placeholder="••••••••" required />
</label>

<button class="btn btn-primary" type="submit">Create Account</button>
</form>
</section>

<section id="list" class="stack">
<h2>List</h2>
<ul class="todo-list">
<li>Finish Lab</li>
<li>Refactor CSS</li>
<li>Try one modern selector</li>
<li>Submit Project Phase One</li>
</ul>
</section>
</main>

</body>
</html>
13 changes: 13 additions & 0 deletions week_six/01-intro_challenge/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* Warm Up Challenges

1: Target only the last item in the list and make it stand out.

2: Style links differently when hovered and when focused (keyboard).

3: Style all buttons except the “primary” button.

(Bonus): Add spacing between all items in .stack except the first.

*/


32 changes: 32 additions & 0 deletions week_six/02-modern_css_selectors/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Modern CSS Selectors – Pure Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="styles.css" rel="stylesheet">
</head>

<body>

<h1>Modern CSS Selectors</h1>

<nav>
<a href="#">Home</a>
<a href="#" class="highlight">Featured</a>
<a href="#">Contact</a>
</nav>

<section>
<h2>Plain Section</h2>
<p>This section has no button.</p>
</section>

<section>
<h2>Interactive Section</h2>
<p>This section contains a button.</p>
<button>Click Me</button>
</section>

</body>
</html>
18 changes: 18 additions & 0 deletions week_six/02-modern_css_selectors/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
body {
font-family: system-ui, sans-serif;
padding: 2rem;
background: #f6f6f6;
}

nav {
display: flex;
gap: 1.5rem;
}

section {
background: white;
padding: 1rem;
margin-top: 1.5rem;
border-radius: 6px;
border: 1px solid #ddd;
}
32 changes: 32 additions & 0 deletions week_six/03-CSS variables/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Modern CSS Selectors – Pure Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="styles.css" rel="stylesheet">
</head>

<body>

<h1>Modern CSS Selectors</h1>

<nav>
<a href="#">Home</a>
<a href="#" class="highlight">Featured</a>
<a href="#">Contact</a>
</nav>

<section>
<h2>Plain Section</h2>
<p>This section has no button.</p>
</section>

<section>
<h2>Interactive Section</h2>
<p>This section contains a button.</p>
<button>Click Me</button>
</section>

</body>
</html>
44 changes: 44 additions & 0 deletions week_six/03-CSS variables/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@


body {
font-family: system-ui, sans-serif;
padding: 2rem;
background:/*add color here */
}

nav {
display: flex;
gap: 1.5rem;
}

section {
background:
padding: 1rem;
margin-top: 1.5rem;
border-radius: 6px;
border: 1px solid /*add color here */
}

/* Grouping with :is() */
:is(h1, h2, p) {
margin-bottom: 0.5rem;
}

/* Exclusion with :not() */
nav a:not(.highlight) {
color: /*add color here */
text-decoration: none;
}

/* Accessible focus */
a:focus-visible,
button:focus-visible {
outline: 3px solid /*add color here */
outline-offset: 2px;
}

/* Parent selection with :has() */
section:has(button) {
border-left: 6px solid /*add color here */
padding-left: 1rem;
}
56 changes: 56 additions & 0 deletions week_six/04-reusable-patterns/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Reusable CSS Components Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="styles.css" rel="stylesheet">
</head>

<body>

<h1>Reusable CSS Components: Before & After</h1>

<section>
<h2>❌ Without Reusable Components (Repetition)</h2>
<p>
Each button has its own class, even though the styles are almost identical.
Changes require editing multiple rules.
</p>

<div class="demo-row">
<button class="login-btn">Login</button>
<button class="signup-btn">Sign Up</button>
</div>

<div class="demo-row">
<button class="learn-btn">Learn More</button>
<button class="details-btn">Details</button>
</div>
</section>

<!-- ========================
WITH REUSABLE COMPONENTS
========================= -->
<section>
<h2>✅ With Reusable Components</h2>
<p>
Shared styles live in a base class, and variants control appearance.
New buttons require no new CSS.
</p>

<div class="demo-row">
<button class="btn btn-primary">Login</button>
<button class="btn btn-primary">Sign Up</button>
</div>

<div class="demo-row">
<button class="btn btn-secondary">Learn More</button>
<button class="btn btn-secondary">Details</button>
</div>
</section>

</body>
</html>


70 changes: 70 additions & 0 deletions week_six/04-reusable-patterns/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/* ========================
Base Page Styles
======================== */
body {
font-family: system-ui, sans-serif;
background: #f6f6f6;
padding: 2rem;
}

h1 {
margin-bottom: 1rem;
}

h2 {
margin-top: 2rem;
margin-bottom: 0.5rem;
}

section {
background: white;
padding: 1.5rem;
border-radius: 6px;
border: 1px solid #ddd;
margin-bottom: 2rem;
}

.demo-row {
display: flex;
gap: 1rem;
margin-top: 1rem;
}

/* ========================
❌ WITHOUT REUSABLE COMPONENTS
======================== */

.login-btn {
padding: 0.75rem 1.25rem;
border-radius: 4px;
font-weight: 600;
border: none;
background-color: navy;
color: white;
}

.signup-btn {
padding: 0.75rem 1.25rem;
border-radius: 4px;
font-weight: 600;
border: none;
background-color: navy;
color: white;
}

.learn-btn {
padding: 0.75rem 1.25rem;
border-radius: 4px;
font-weight: 600;
border: none;
background-color: lightgray;
}

.details-btn {
padding: 0.75rem 1.25rem;
border-radius: 4px;
font-weight: 600;
border: none;
background-color: lightgray;
}

41 changes: 41 additions & 0 deletions week_six/05-put-it-together/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Simple CSS System Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="styles.css" rel="stylesheet">
</head>

<body>

<header>
<h1>CSS Components Demo</h1>
<nav>
<button class="btn btn-secondary">Login</button>
<button class="btn btn-primary">Sign Up</button>
</nav>
</header>

<main>
<section class="card">
<h2>Card One</h2>
<p>This card has a primary button.</p>
<button class="btn btn-primary">Action</button>
</section>

<section class="card">
<h2>Card Two</h2>
<p>This card only has secondary buttons.</p>
<button class="btn btn-secondary">Details</button>
</section>

<section class="card">
<h2>Card Three</h2>
<p>All cards reuse the same component styles.</p>
<button class="btn btn-secondary">Learn More</button>
</section>
</main>

</body>
</html>
Loading