Project: CivicTechWR Jekyll Website Branch: perf/perf-improvements Last Updated: October 15, 2025 Tech Stack: Jekyll, HTML, CSS, JavaScript, Bootstrap 4.1.3 Current Branch: perf/bootstrap-optimization
CivicTechWR is a community organization website built with Jekyll. The site focuses on:
Live Site: https://civictechwr.org Primary Audience: Tech enthusiasts, designers, civic-minded individuals in Kitchener-Waterloo
Performance Problems:
Code Quality Issues:
!important
declarations (CSS specificity wars)Style Inconsistencies:
See docs/AUDIT_REPORT.md
for complete performance audit results.
The following critical fixes have been completed:
.github-btn
duplicate from css/pages/projects.css
<link>
tags from _includes/header.html
(causing FOUC)getNextDayOfWeek()
function in js/optimized-bundle.js
npm run minify:optimized
critical.css
, critical-inline.css
, critical-optimized.css
_includes/meeting-section.html
with parametrizable section_id
css/components/buttons.css
(380 lines, ZERO !important
declarations)Status: Foundation complete, HTML migration pending
Files staged for commit:
css/components/buttons.css
(new file)index.html
(loads button CSS on line 57)about.html
(loads button CSS on line 49)projects.html
(loads button CSS on line 49)Remaining Work:
Use the web-design-specialist agent to systematically update button classes:
Migration mapping:
class="btn btn-primary"
β class="btn btn--primary"
class="btn btn-outline"
β class="btn btn--outline"
class="btn btn-outline btn-light-inverse"
β class="btn btn--light"
class="github-btn btn"
β class="btn btn--badge"
class="btn btn-primary meeting-btn"
β class="btn btn--meeting"
class="footer-donate-btn"
β class="btn btn--donate"
class="footer-sponsor-btn"
β class="btn btn--footer"
class="footer-general-btn"
β class="btn btn--footer"
Files requiring updates (29 button instances total):
index.html
- 9 buttons (lines 110, 114, 115-117, 118, 199, 226, 227, 235, 252)about.html
- 2 buttons (line 65)projects.html
- 6 buttons (lines 66, 151, 195 - including 4 JavaScript-generated)_includes/header.html
- 1 button (line 32)_includes/footer.html
- 5 buttons (lines 11, 14, 28, 42, 43)_includes/meeting-section.html
- 1 button (line 47)Agent to use:
# Launch web-design-specialist to perform systematic button class updates
# The agent has already analyzed all files and created a detailed migration plan
# Ask it to execute the migration with exact search-and-replace operations
Use the code-reviewer agent to identify and remove legacy button definitions:
Old button classes to remove from css/style.css
(17+ definitions with !important
):
.btn
(base).navbar .custom-btn
.custom-btn
.custom-border-btn
.btn.custom-link
(with !important
).btn.meeting-btn
(with !important
).footer-donate-btn
.footer-sponsor-btn
.footer-general-btn
.btn-primary
.btn-outline
.btn.btn-primary
(with !important
).btn.btn-outline
(with !important
).btn.btn-outline.btn-light-inverse
(with !important
).meeting-btn
.btn.meeting-btn-alt
(with !important
).github-btn
Expected results:
!important
declarations (majority of 64 instances)Manual testing checklist:
!important
conflicts)Browser testing:
git add css/components/buttons.css index.html about.html projects.html _includes/header.html _includes/footer.html _includes/meeting-section.html css/style.css
git commit -m "feat: Consolidate 7 button systems into unified BEM system
- Create css/components/buttons.css with BEM methodology
- ZERO !important declarations (eliminates CSS specificity wars)
- Update all 29 button instances across 6 files to use new classes
- Remove 17+ old button definitions from style.css (~150-200 lines)
- Maintains visual parity with existing design
- Estimated 5-10KB CSS reduction
π€ Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>"
After button system completion, prioritize these tasks:
!important
declarations (~40-50 left in style.css)
!important
ctwr-web/
βββ _includes/ # Jekyll partials
β βββ header.html # Site navigation (β canonical)
β βββ footer.html # Site footer (β canonical)
βββ _data/ # YAML data files
β βββ projects.yml # Featured projects
β βββ partners.yml # Sponsor information
β βββ navigation.yml # Navigation links
βββ css/
β βββ style.css # Main styles (2,252 lines - needs optimization)
β βββ critical.css # Above-fold styles (has duplicates)
β βββ bootstrap.css # Bootstrap 4.1.3 (155KB - needs PurgeCSS)
β βββ [other CSS]
βββ js/
β βββ jquery.js # jQuery 3.x (85KB - candidate for removal)
β βββ custom.js # Site interactions (31 lines)
β βββ meeting.js # Meetup API integration
βββ images/ # Site images (WebP + JPG fallbacks)
βββ index.html # Homepage
βββ about.html # About page
βββ projects.html # Projects listing
βββ footer.html # β οΈ DUPLICATE - should be deleted
βββ _config.yml # Jekyll configuration
Current State (Problematic):
style.css
index.html
(duplicates style.css)critical.css
duplicates content from style.css
!important
for specificity battlesRecommended Structure:
css/
βββ base/
β βββ variables.css # CSS custom properties
β βββ reset.css # Normalize/reset
β βββ typography.css # Text styles
βββ components/
β βββ buttons.css # Unified button system
β βββ footer.css # Footer styles
β βββ header.css # Navigation styles
β βββ cards.css # Card components
βββ layout/
β βββ grid.css # Layout system
β βββ sections.css # Section spacing
βββ style.css # Main import file
:root {
/* Brand Colors */
--white-color: #fff;
--primary-color: #FC6C6D; /* Red/coral - accent */
--secondary-color: #2D6F72; /* Teal - brand primary */
--dark-color: #000;
--p-color: #717275; /* Body text gray */
/* Layout */
--section-bg-color: #f9f9f9;
--border-color: #e9eaeb;
/* Typography */
--body-font-family: 'DM Sans', sans-serif;
--h1-font-size: 62px;
--h2-font-size: 48px;
--h3-font-size: 36px;
--h4-font-size: 32px;
--h5-font-size: 24px;
--h6-font-size: 22px;
--p-font-size: 18px;
/* Weights */
--font-weight-normal: 400;
--font-weight-medium: 500;
--font-weight-bold: 700;
/* Border Radius */
--border-radius-large: 100px; /* Pills */
--border-radius-medium: 20px; /* Cards */
--border-radius-small: 10px; /* Buttons */
}
:root {
/* Neutral Palette */
--gray-900: #222;
--gray-700: #444;
--gray-600: #555;
--gray-500: #666;
--gray-400: #777;
--gray-300: #999;
--gray-200: #ccc;
--gray-100: #eaeaea;
--gray-50: #fafafa;
/* Spacing Scale */
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-5: 24px;
--space-6: 32px;
--space-7: 48px;
--space-8: 64px;
/* Simplified Radius */
--radius-sm: 4px;
--radius-md: 12px;
--radius-lg: 24px;
--radius-full: 9999px;
}
Use BEM naming convention:
<!-- Primary button -->
<a class="btn btn--primary" href="#">Click Me</a>
<!-- Outline button -->
<a class="btn btn--outline" href="#">Learn More</a>
<!-- Light outline (on dark backgrounds) -->
<a class="btn btn--outline-light" href="#">Join Us</a>
<!-- Size modifiers -->
<a class="btn btn--primary btn--sm" href="#">Small</a>
<a class="btn btn--primary btn--lg" href="#">Large</a>
<!-- Full width -->
<a class="btn btn--primary btn--full" href="#">Full Width</a>
CSS Implementation:
/* Base button */
.btn {
display: inline-block;
padding: var(--space-3) var(--space-5);
font-size: 1rem;
font-weight: 500;
border-radius: var(--radius-sm);
border: none;
text-align: center;
text-decoration: none;
cursor: pointer;
transition: all 0.3s ease;
}
/* Variants */
.btn--primary {
background: var(--secondary-color);
color: var(--white-color);
}
.btn--primary:hover {
background: var(--primary-color);
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.btn--outline {
background: transparent;
color: var(--secondary-color);
border: 2px solid var(--secondary-color);
}
.btn--outline:hover {
background: var(--secondary-color);
color: var(--white-color);
}
Standard link behavior:
var(--secondary-color)
(#2D6F72 teal)var(--primary-color)
(#FC6C6D red)Use spacing variables consistently:
var(--space-*)
tokensvar(--space-8)
or largervar(--space-4)
to var(--space-6)
var(--space-2)
to var(--space-3)
Never hard-code colors - always use CSS variables:
/* β Bad */
background: #2D6F72;
color: #666;
/* β
Good */
background: var(--secondary-color);
color: var(--gray-500);
DO:
.btn--primary
not .btn--blue
)DONβT:
!important
(fix specificity instead)Avoid specificity wars:
/* β Bad - specificity war with !important */
.btn {
background: blue !important;
}
.btn.btn-primary {
background: red !important;
}
/* β
Good - proper specificity hierarchy */
.btn {
background: var(--gray-500);
}
.btn--primary {
background: var(--secondary-color);
}
.btn--primary.btn--disabled {
background: var(--gray-300);
}
DO:
<nav>
, <main>
, <article>
)alt
text to all imagesloading="lazy"
for below-fold imagesrel="noopener noreferrer"
on external linksDONβT:
_includes/
)_data/
YAML files)Total Expected Savings: ~570KB (71% reduction)
Total Potential Savings: ~724KB (90.5% reduction)
# Install dependencies
bundle install
# Run local server
bundle exec jekyll serve --livereload
# Build for production
JEKYLL_ENV=production bundle exec jekyll build
# Run smoke tests
bash scripts/smoke-tests.sh
Branch Strategy:
main
- Production branchperf/perf-improvements
- Current performance optimization workfeature/name
fix/description
Commit Message Format:
<type>: <description>
Examples:
feat: Add unified button system
fix: Remove duplicate footer implementation
perf: Replace Font Awesome with SVG sprites
style: Consolidate CSS duplicate selectors
docs: Update architecture documentation
Before pushing:
bash scripts/smoke-tests.sh
<!-- Use unified button system -->
<a class="btn btn--primary" href="#">Primary Action</a>
<a class="btn btn--outline" href="#">Secondary Action</a>
page-name.html
in root---
layout: null
permalink: /page-name/
---
### Updating Colors
1. Modify CSS variables in `css/style.css`:
```css
:root {
--secondary-color: #2D6F72; /* Update here */
}
_data/projects.yml
- name: "Project Name"
url: "https://project-url.com"
github: "https://github.com/org/repo"
logo: "/images/projects/logo.png"
year: 2025
_data/partners.yml
- name: "Partner Name"
logo: "/images/partners/logo.png"
current: true # false for previous partners
index.html:287
- Includes headerindex.html:686
- Includes footerabout.html
- Team and organization infoprojects.html
- Project showcasecss/style.css
- Main stylesheet (2,252 lines - needs refactoring)css/critical.css
- Critical CSS (251 lines - has duplicates)css/bootstrap.css
- Bootstrap framework (candidate for replacement)js/custom.js:31
- Main site interactionsjs/meeting.js
- Meetup API integrationjs/add-view-all-card.js
- Project card functionality_data/projects.yml
- Featured projects data_data/partners.yml
- Sponsor logos and info_data/navigation.yml
- Site navigation links_config.yml
- Jekyll configuration.gitignore
- Git ignore rulesGemfile
- Ruby dependenciesFrom /tmp/claudepro-directory
:
css/components/buttons.css
with BEM methodology!important
declarations (~40-50 left after button cleanup)Organization: CivicTech Waterloo Region
Email: civictechwr@gmail.com
Maintainers: See about.html
for current organizers
When starting a new conversation to continue this work:
Task: βComplete the button system migration using the web-design-specialist agentβ
What will happen:
Estimated time: 30-45 minutes
Task: βRemove remaining !important declarations from style.css using the code-reviewer agentβ
What will happen:
!important
usage (should be ~40-50 instances after button cleanup)Estimated time: 1-2 hours
Task: βRun a comprehensive site audit using all available agentsβ
What will happen:
Estimated time: 45-60 minutes
Last Updated: October 15, 2025 Next Review: After button system completion