Files
TinyTorch/site/_static/custom.css
Vijay Janapa Reddi 4520fb1a9c Improve WIP banner functionality and styling
- Change banner positioning from relative to fixed for better visibility
- Add header spacing to accommodate fixed banner
- Enhance banner injection with dynamic HTML creation
- Add comments explaining banner implementation details
2025-11-13 17:50:53 -05:00

322 lines
7.9 KiB
CSS

/* ============================================
TinyTorch Design System - ML Systems Education
============================================ */
/* Color Variables - ML Systems Theme */
:root {
/* Primary Brand Colors */
--tt-primary-blue: #1e3a8a;
--tt-primary-blue-light: #3b82f6;
--tt-primary-blue-lighter: #60a5fa;
/* Fire Gradient (Tagline) */
--tt-fire-red: #E74C3C;
--tt-fire-orange: #E67E22;
--tt-fire-yellow: #F39C12;
/* Tier Colors - Learning Journey */
--tt-foundation-bg: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
--tt-foundation-border: #1976d2;
--tt-foundation-text: #0d47a1;
--tt-foundation-text-light: #1565c0;
--tt-architecture-bg: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
--tt-architecture-border: #7b1fa2;
--tt-architecture-text: #4a148c;
--tt-architecture-text-light: #6a1b9a;
--tt-optimization-bg: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
--tt-optimization-border: #f57c00;
--tt-optimization-text: #e65100;
--tt-optimization-text-light: #ef6c00;
--tt-olympics-bg: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
--tt-olympics-border: #c2185b;
--tt-olympics-text: #880e4f;
--tt-olympics-text-light: #ad1457;
/* Semantic Colors */
--tt-text-primary: #1f2937;
--tt-text-secondary: #374151;
--tt-text-muted: #6b7280;
/* Spacing System */
--tt-space-xs: 0.5rem;
--tt-space-sm: 0.75rem;
--tt-space-md: 1rem;
--tt-space-lg: 1.5rem;
--tt-space-xl: 2rem;
--tt-space-2xl: 3rem;
/* Border Radius */
--tt-radius-sm: 0.5rem;
--tt-radius-md: 0.75rem;
/* Shadows */
--tt-shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
--tt-shadow-md: 0 4px 6px rgba(0,0,0,0.1);
--tt-shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}
/* Mermaid diagram styling - remove grey backgrounds ONLY from Mermaid containers */
pre.mermaid {
background: transparent !important;
border: none !important;
margin: 1.5rem auto !important;
text-align: center !important;
padding: 0 !important;
}
/* Ensure Mermaid diagrams are properly centered and clean */
pre.mermaid.align-center {
display: block;
margin-left: auto;
margin-right: auto;
background: transparent !important;
}
/* Fix oversized navigation links at bottom of pages */
.prev-next-area .prev-next-info .prev-next-label {
font-size: 0.9rem !important;
font-weight: normal !important;
}
.prev-next-area .prev-next-info a {
font-size: 1rem !important;
font-weight: 500 !important;
line-height: 1.4 !important;
}
/* Ensure consistent navigation styling */
.prev-next-area {
border-top: 1px solid #dee2e6;
padding-top: 1.5rem;
margin-top: 3rem;
}
.prev-next-area .prev-next-info {
max-width: none !important;
}
/* Work-in-Progress Banner Styles - Construction Theme */
.wip-banner {
background: linear-gradient(135deg, #ffc107 0%, #ffb300 25%, #ff9800 50%, #ffc107 100%);
border-bottom: 3px solid #ff6f00;
color: #000000;
padding: 0.75rem 1rem;
text-align: center;
position: fixed;
top: 0;
left: 0;
right: 0;
box-shadow: 0 4px 12px rgba(255, 152, 0, 0.25);
z-index: 9999;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
animation: attention-pulse 4s ease-in-out infinite;
}
/* Push down Jupyter Book header to make room for banner */
header.bd-header {
margin-top: 4rem !important;
}
/* Add spacing to main content area */
.bd-container {
padding-top: 1rem !important;
}
/* Add spacing after the banner */
.wip-banner + * {
margin-top: 2.5rem !important;
}
.wip-banner.collapsed {
padding: 0.5rem 1rem;
}
.wip-banner-content {
max-width: 1200px;
margin: 0 auto;
position: relative;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column; /* Stack title and description vertically */
flex-wrap: nowrap;
gap: 0.25rem;
padding-right: 2rem; /* Space for toggle button */
}
.wip-banner-title {
font-size: 1rem;
font-weight: 700;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
gap: 0.3rem; /* Reduced gap to prevent wrapping */
color: #000000;
text-transform: uppercase;
letter-spacing: 0.5px;
white-space: nowrap; /* Prevent text wrapping */
flex-shrink: 0; /* Don't shrink the title */
}
.wip-banner-title .icon {
font-size: 1.2rem;
animation: construction-blink 2s infinite ease-in-out;
}
.wip-banner-description {
font-size: 0.85rem;
margin: 0;
line-height: 1.4;
transition: all 0.3s ease;
color: #212121;
font-weight: 500;
max-width: 600px;
flex-shrink: 1; /* Allow description to shrink if needed */
text-align: center;
}
.wip-banner.collapsed .wip-banner-description {
display: none;
}
.wip-banner-toggle {
position: absolute;
right: 0.5rem;
top: 50%;
transform: translateY(-50%);
background: rgba(0, 0, 0, 0.1);
border: 2px solid rgba(0, 0, 0, 0.2);
color: #000000;
font-size: 0.875rem;
cursor: pointer;
padding: 0.25rem 0.375rem;
border-radius: 4px;
transition: all 0.2s ease;
opacity: 0.8;
width: 1.75rem;
height: 1.75rem;
display: flex;
align-items: center;
justify-content: center;
}
.wip-banner-toggle:hover {
background: rgba(0, 0, 0, 0.2);
border-color: rgba(0, 0, 0, 0.4);
opacity: 1;
transform: translateY(-50%) scale(1.05);
}
.wip-banner-close {
position: absolute;
right: 0.5rem;
top: 50%;
transform: translateY(-50%);
background: rgba(0, 0, 0, 0.1);
border: 2px solid rgba(0, 0, 0, 0.2);
color: #000000;
font-size: 1rem;
cursor: pointer;
padding: 0.25rem;
border-radius: 4px;
transition: all 0.2s ease;
opacity: 0.8;
width: 1.75rem;
height: 1.75rem;
display: flex;
align-items: center;
justify-content: center;
font-weight: 600;
}
.wip-banner-close:hover {
background: rgba(0, 0, 0, 0.2);
border-color: rgba(0, 0, 0, 0.4);
opacity: 1;
transform: translateY(-50%) scale(1.1);
}
.wip-banner.hidden {
display: none;
}
@keyframes attention-pulse {
0%, 100% {
box-shadow: 0 4px 12px rgba(255, 152, 0, 0.25);
}
50% {
box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}
}
@keyframes construction-blink {
0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
25% { transform: scale(1.1) rotate(-5deg); }
50% { opacity: 0.8; transform: scale(0.95) rotate(0deg); }
75% { transform: scale(1.1) rotate(5deg); }
}
/* Adjust banner when sidebar is expanded or on smaller screens */
@media (max-width: 1200px) {
.wip-banner-title {
font-size: 0.9rem;
}
.wip-banner-title .icon {
font-size: 1rem;
}
.wip-banner-title span:nth-child(2), /* Hide second icon */
.wip-banner-title span:nth-child(4) { /* Hide fourth icon */
display: none;
}
}
/* Mobile responsiveness for banner */
@media (max-width: 768px) {
.wip-banner {
padding: 0.625rem 0.75rem;
}
.wip-banner-content {
flex-direction: column; /* Stack vertically on mobile */
gap: 0.25rem;
padding-right: 2rem;
}
.wip-banner-title {
font-size: 0.8rem;
flex-wrap: nowrap;
}
.wip-banner-title span:nth-child(2), /* Hide warning icon on mobile */
.wip-banner-title span:nth-child(4), /* Hide hammer icon on mobile */
.wip-banner-title span:nth-child(5) { /* Hide last construction icon */
display: none;
}
.wip-banner-description {
font-size: 0.7rem;
margin: 0;
line-height: 1.2;
}
.wip-banner-toggle {
right: 2rem;
width: 1.5rem;
height: 1.5rem;
font-size: 0.75rem;
}
.wip-banner-close {
right: 0.375rem;
width: 1.5rem;
height: 1.5rem;
font-size: 0.75rem;
}
}