Files
cv-site/static/css/03-components/_sidebar.css
T
juanatsap 0956c78d00 style: Add CSS variable fallbacks for better browser compatibility
Following LogRocket CSS best practices:
- Added fallback values to 150+ CSS variable usages across 22 files
- Fallbacks use light theme defaults for consistent behavior
- Improves compatibility with older browsers
- Example: var(--text-primary) → var(--text-primary, #1a1a1a)

Variables with fallbacks:
- Colors: text-primary, text-secondary, text-muted, accent-blue, etc.
- Backgrounds: page-bg, paper-bg, action-bar-bg, sidebar-bg
- Shadows: shadow-sm, shadow-md, shadow-lg
- Borders: border-color, border-light, icon-border

CSS Variables Best Practices compliance: 6/7 recommendations now followed
2025-11-30 14:35:02 +00:00

159 lines
3.1 KiB
CSS

/* ============================================================================
SIDEBAR COMPONENT
============================================================================ */
/* Sidebar - Left/Right columns */
.cv-sidebar {
background: var(--sidebar-bg, #d1d4d2);
padding: 4rem 1.5rem;
font-size: 0.9rem;
}
/* Sidebar Accordion - Hidden on desktop, visible on mobile */
.sidebar-accordion-header {
display: none;
}
.sidebar-section {
margin-bottom: 2rem;
/* Add margin when section is collapsed */
&:has(details:not([open])) {
margin-bottom: 3rem;
margin-top: 0rem;
}
/* Collapsible Details */
details {
margin: 0;
summary ~ * {
overflow: hidden;
max-height: 0;
opacity: 0;
transform: translateY(-8px);
transition: max-height 0.5s ease-in-out,
opacity 0.3s ease-in-out,
transform 0.3s ease-in-out;
}
&[open] summary ~ * {
max-height: 1500px;
opacity: 1;
transform: translateY(0);
}
&[open] .sidebar-content {
margin-top: 0.5rem;
}
}
summary {
cursor: pointer;
list-style: none;
user-select: none;
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
/* Remove default triangle marker */
&::-webkit-details-marker,
&::marker {
display: none;
}
.sidebar-title {
margin-bottom: 0;
}
&:hover .sidebar-title {
color: var(--accent-blue, #0066cc);
}
&:hover::after,
details:not([open]) &::after {
opacity: 1;
}
}
}
.sidebar-title {
font-family: 'Quicksand', sans-serif;
font-size: 1.4em;
font-weight: 700;
line-height: 1.3em;
margin-bottom: 10px;
padding: 0;
color: var(--text-primary, #1a1a1a);
text-align: left;
}
.sidebar-content {
font-family: 'Quicksand', sans-serif;
font-size: 0.95rem;
font-weight: 400;
line-height: 1.5;
color: var(--text-primary, #1a1a1a);
}
.skill-item {
margin-bottom: 0.15rem;
color: var(--text-primary, #1a1a1a);
font-weight: 400;
}
/* Left Sidebar Specific */
.cv-sidebar-left {
.sidebar-section summary::after {
content: '▶';
font-size: 0.8em;
color: var(--text-muted, #666666);
transition: transform 0.2s ease, opacity 0.2s ease;
opacity: 0;
margin-left: 15px;
flex-shrink: 0;
}
.sidebar-section details[open] summary::after {
transform: rotate(90deg);
}
.sidebar-content,
.skill-item {
text-align: left;
}
}
/* Right Sidebar Specific */
.cv-sidebar-right {
.sidebar-section summary {
flex-direction: row-reverse;
justify-content: space-between;
.sidebar-title {
text-align: right;
width: 100%;
}
&::after {
content: '▶';
font-size: 0.8em;
color: var(--text-muted, #666666);
transition: transform 0.2s ease, opacity 0.2s ease;
opacity: 0;
margin-right: 15px;
flex-shrink: 0;
}
}
.sidebar-section details[open] summary::after {
transform: rotate(90deg);
}
.sidebar-content,
.skill-item {
text-align: right;
}
}