refactor: Modularize CSS and fix theme-aware text colors

CSS Restructuring:
- Reorganize monolithic main.css into modular architecture
- Create foundation/ (reset, variables, typography, themes)
- Create layout/ (container, page, grid, paper)
- Create components/ (8 component files)
- Create interactive/ (toggles, remaining for future split)
- Create effects/ (skeleton loading)
- Create contexts/ (print styles)

Theme Support Fixes:
- Replace all hardcoded text colors with CSS variables
- Fix .section-title: rgb(51,51,51) → var(--text-primary)
- Fix .cv-name, .intro-text: hardcoded → theme-aware
- Fix .experience-period, .duration-text: #555/#aaa → variables
- Fix course/project/experience text colors
- Support proper light/dark theme text contrast

Icon & Layout Fixes:
- Standardize all icon sizes to 80×80px
- Change all icon backgrounds to transparent
- Fix award section layout (missing flexbox)
- Update HTML templates (experience.html, awards.html) to width='80'
- Fix default icon sizing conflicts

View Switcher Fix:
- Fix toggleTheme() to target .cv-container instead of body
- Ensures clean/default theme toggle works correctly

Files: 40+ CSS files modularized, 3 templates updated, 7 tests added
This commit is contained in:
juanatsap
2025-11-19 14:31:17 +00:00
parent f8948413bc
commit f7cda5dba3
41 changed files with 12804 additions and 4740 deletions
+58
View File
@@ -0,0 +1,58 @@
/* ============================================================================
CV CONTAINER & ZOOM WRAPPER
============================================================================ */
/* Zoom Wrapper - wraps cv-container for zoom functionality */
.zoom-wrapper {
/* CSS zoom property changes actual layout space (not just visual) */
/* This allows footer to naturally position right after zoomed content */
}
/* Main CV Container */
.cv-container {
width: 100%;
max-width: 100%; /* Full width to accommodate pages */
margin: 0 auto;
padding: 20px 0 0 0; /* Top padding to prevent sticky action bar overlap */
display: block;
/* Clean theme - no sidebars, centered content */
&.theme-clean {
padding: 20px 0 0 0;
transition: all 0.3s ease-in-out;
.cv-page {
box-shadow: var(--shadow-lg);
border: 1px solid var(--border-color);
margin: 0 auto;
max-width: 900px;
transition: all 0.3s ease-in-out;
}
.cv-sidebar,
.cv-title-badges-header,
.cv-footer {
display: none !important;
animation: fadeOutShrink 0.3s ease-in-out;
}
.page-content {
grid-template-columns: 1fr !important;
transition: grid-template-columns 0.3s ease-in-out;
}
.cv-main {
grid-column: 1 !important;
padding: 2rem 3rem!important;
transition: all 0.3s ease-in-out;
}
}
}
/* Animate sidebar, header, footer when hiding/showing */
.cv-sidebar,
.cv-title-badges-header,
.cv-footer {
overflow: hidden;
transition: all 0.3s ease-in-out;
}
+38
View File
@@ -0,0 +1,38 @@
/* ============================================================================
GRID LAYOUT - Page Content Grid
============================================================================ */
/* Professional Title Badges - Spans Both Columns */
.cv-title-badges-header {
grid-column: 1 / -1; /* Span all columns */
background: #303030 !important; /* Elegant dark gray */
padding: 10px 20px;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
gap: 0;
border-bottom: 2px solid #34495e;
}
.title-badge {
font-size: 0.9em;
font-weight: normal;
color: #ccc;
text-transform: uppercase;
white-space: nowrap;
}
.badge-separator {
color: #ccc;
font-weight: normal;
padding: 0 15px;
position: relative;
top: -1px;
}
/* Main Content Area */
.cv-main {
background: var(--paper-white);
padding: 3rem 2.5rem 8rem 2.5rem; /* Bottom padding for footer and zoom control clearance */
}
+112
View File
@@ -0,0 +1,112 @@
.cv-page {
background: var(--paper-bg);
max-width: 1200px;
margin: 2rem auto;
box-shadow: var(--shadow-lg);
border: 1px solid var(--border-color);
transform: scale(0.95);
transform-origin: top center;
transition: transform 0.3s ease;
}
/* Page Content Grid */
.page-content {
display: grid;
}
/* Page 1: Left sidebar + Main content */
.page-1 .page-content {
grid-template-columns: 300px 1fr;
}
/* Page 2: Main content + Right sidebar */
.page-2 .page-content {
grid-template-columns: 1fr 300px;
}
/* Sidebar positioning */
.cv-sidebar-left {
grid-column: 1;
grid-row: 1;
}
.cv-sidebar-right {
grid-column: 2;
grid-row: 1;
text-align: right;
}
/* Main content positioning */
.page-1 .cv-main {
grid-column: 2;
grid-row: 1;
}
.page-2 .cv-main {
grid-column: 1;
grid-row: 1;
}
/* ===============================================
FOOTER STYLES
=============================================== */
.cv-footer {
background: #303030;
color: #ccc;
padding: 20px 0;
margin: 0;
grid-column: 1 / -1; /* Span all columns */
}
.footer-content {
list-style: none;
text-align: center;
margin: 0;
padding: 0;
}
.footer-content li {
display: inline-block;
margin: 0;
}
.footer-content li > div {
display: inline-block;
margin: 0 20px;
text-align: left;
}
.footer-label {
width: 200px;
font-size: 1.7em;
}
.footer-value {
width: 450px;
font-size: 1em;
}
.footer-value b {
font-weight: normal;
font-size: 1.7em;
}
.footer-separator {
position: relative;
left: -4%;
font-size: 0.6em;
}
.footer-separator i {
opacity: 0.3;
}
.cv-footer a {
color: inherit;
}
.cv-footer a:hover {
color: #0275d8;
text-decoration: none;
}
+29
View File
@@ -0,0 +1,29 @@
/* ============================================================================
CV PAPER - Container for two-page layout
============================================================================ */
.cv-paper {
width: 100%;
background: transparent; /* Remove white background - each page has its own */
box-shadow: none; /* Remove shadow - each page has its own */
margin: 0;
position: relative;
display: block; /* Changed from grid to block for stacking pages */
min-height: auto;
/* Zoom transform properties */
transform-origin: top center; /* Scale from top center - page stays anchored at top */
transition: transform 0.08s linear; /* Smooth, immediate zoom response */
will-change: transform; /* Hint browser to optimize for transforms */
}
/* Page break helpers */
.page-break {
page-break-after: always;
break-after: page;
}
.avoid-break {
page-break-inside: avoid;
break-inside: avoid;
}