This document defines the visual design system and coding standards for Rachel Sharp's portfolio website.
--primary-color: #3A4A2D; /* Darker olive green - primary accent */
--secondary-color: #7A9263; /* Darker sage green - secondary actions */
--accent-color: #8B6F4E; /* Darker gold - links and buttons */--text-color: #1F2515; /* Very dark green - primary text */
--text-light: #3A4A2D; /* Dark olive - secondary text */
--text-muted: #4A5A3A; /* Darker muted green - tertiary text */--background-color: #FAF1E4; /* Warm off-white background */
--light-background: #CEDEBD; /* Light sage - section backgrounds */
--card-background: #FFFFFF; /* Pure white - cards and forms */--border: #CEDEBD; /* Light sage border */
--border-light: #E4DDD4; /* Very light warm border */
--shadow-subtle: rgba(67, 83, 52, 0.05);
--shadow-medium: rgba(67, 83, 52, 0.1);
--shadow-strong: rgba(67, 83, 52, 0.15);--font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
--heading-font: 'Lora', Georgia, serif;- Hero Title:
clamp(2.5rem, 5vw, 3.5rem) - Page Title:
3rem(mobile:2rem) - Section Title:
2rem - Subsection:
1.5rem - Body Text:
1rem(wide screens:1.1rem) - Small Text:
0.9rem
- Headings:
1.1to1.4 - Body Text:
1.8(wide screens:1.9) - Compact Text:
1.6
--gap: 24px--content-gap: 20px
/* Margins */
margin-bottom: 1.5rem; /* Paragraphs */
margin-bottom: 1.8rem; /* Lists */
margin-top: 3rem; /* H2 headers */
margin-top: 2.5rem; /* H3 headers */
/* Padding */
padding: 2rem; /* Section content */
padding: 80px 1rem; /* Hero section (wide) */
padding: 3rem 1rem; /* Hero section (default) */--nav-width: 1024px;
--main-width: 720px; /* Theme constraint */
max-width: 1400px; /* Hero container */
max-width: 900px; /* Research page */- Mobile:
< 600px - Tablet:
600px - 992px - Desktop:
> 992px - Hero:
841px(specific media query)
.button {
background-color: var(--accent-color);
color: white;
padding: 12px 24px;
border-radius: 4px;
font-weight: 600;
letter-spacing: 1px;
transition: all 0.25s ease;
}
.button:hover {
background-color: var(--primary-color);
transform: translateY(-1px);
}.card {
background: var(--card-background);
border-radius: 8px;
box-shadow: 0 2px 8px var(--shadow-subtle);
padding: 1.5rem;
transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 16px var(--shadow-medium);
}.content-image {
max-width: 100%;
border-radius: 8px;
box-shadow: 0 3px 10px var(--shadow-medium);
border: 1px solid var(--border-light);
}
/* Floated images */
.float-right {
float: right;
margin: 0 0 2rem 2.5rem;
max-width: 200px;
}.form-input {
padding: 10px 16px;
border: 1px solid var(--border);
border-radius: 4px;
background-color: var(--card-background);
color: var(--text-color);
transition: border-color 0.25s ease;
}
.form-input:focus {
outline: none;
border-color: var(--primary-color);
}@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}transition: all 0.3s ease; /* General */
transition: all 0.25s ease; /* Quick interactions */
transition: all 0.2s ease; /* Hover states */-
custom.css: Main customization file
- CSS variables and theme
- Global styles
- Component styles
- Responsive overrides
-
hero.css: Hero section specific
- Grid layout
- Media queries
- Hero animations
-
portfolio.css: Portfolio grid
- Filter functionality
- Grid animations
- Loading states
- BEM-inspired:
.component-name__element--modifier - Sections:
.section-name(e.g.,.hero-section) - Containers:
.name-container(e.g.,.hero-container) - Content:
.name-content(e.g.,.hero-content)
- Avoid excessive nesting (max 3 levels)
- Use classes over IDs for styling
- Use
!importantsparingly (only for overrides) - Prefer custom properties for theming
:focus {
outline: 2px solid var(--primary-color);
outline-offset: 2px;
}
:focus:not(:focus-visible) {
outline: none;
}.skip-link {
position: absolute;
top: -40px;
left: 0;
background: var(--primary-color);
color: white;
padding: 8px;
text-decoration: none;
border-radius: 0 0 4px 0;
}
.skip-link:focus {
top: 0;
}- Mobile First: Write base styles for mobile, enhance for larger screens
- Performance: Use
transformandopacityfor animations - Maintainability: Use CSS custom properties for repeated values
- Accessibility: Ensure 4.5:1 contrast ratios minimum
- Progressive Enhancement: Layer complexity for capable browsers
<section class="about-section section-collapsible collapsed">
<div class="section-container">
<button class="section-header-collapsible" aria-expanded="false">
<h2 class="section-title">About Me</h2>
<span class="collapse-icon" aria-hidden="true">▲</span>
</button>
<div class="section-content-collapsible">
<!-- Content -->
</div>
</div>
</section><figure class="float-right">
<img src="/images/photo.jpg"
alt="Descriptive alt text"
loading="lazy">
<figcaption>Optional caption</figcaption>
</figure>