Files
cs249r_book/shared/styles/partials/_figures.scss
Vijay Janapa Reddi 4b840ff957 refactor(site): shared styles system and fix subscribe modal for subsites
- Create shared/ directory with centralized SCSS partials and site-head.html
  so site subsites (about, community, newsletter) no longer duplicate
  inline header config or reference book-only styles
- Fix subscribe modal: change script src from broken relative path
  (../../book/quarto/assets/scripts/subscribe-modal.js) to absolute URL
  (https://mlsysbook.ai/vol1/assets/scripts/subscribe-modal.js) which
  the rewrite-dev-urls.sh script converts for dev preview automatically
2026-03-21 12:50:25 -04:00

36 lines
1.1 KiB
SCSS

// =============================================================================
// FIGURE STYLES — Spacing, captions, responsive images
// =============================================================================
// Figure spacing improvements
figure {
margin-top: 2rem !important;
/* More space above figures */
margin-bottom: 1.5rem !important;
/* Consistent space below */
}
// Responsive figure images: scale to container, preserve aspect ratio
// Fixes Python-generated figures that have explicit width/height and can render stretched
.quarto-figure img.figure-img,
.cell-output-display img.figure-img {
max-width: 100% !important;
height: auto !important;
}
// Figure captions
.figure-caption,
.caption,
figure figcaption {
margin-top: 1rem !important;
/* Space between image and caption */
font-size: 0.9rem !important;
/* Slightly smaller caption text */
color: #666 !important;
/* Subtle caption color */
line-height: 1.4 !important;
/* Better caption readability */
text-align: left !important;
text-align-last: left !important;
}