From c0b512d2b44458176cf30ef937f10cbd37eb4c8c Mon Sep 17 00:00:00 2001 From: Sam Scholten Date: Mon, 24 Aug 2026 14:52:40 +1000 Subject: theme: switch to Atkinson Hyperlegible, 28px base, sync beamer variant - Replace EB Garamond with Atkinson Hyperlegible for projection legibility - Drop base font-size to 28px in both standard and beamer themes - Normalize letter-spacing for sans body text (0.2px) - Consolidate logo CSS variables, pad-top/bottom variables, and refined two-column title-row layout into the published theme --- acarp.css | 560 +++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 317 insertions(+), 243 deletions(-) (limited to 'acarp.css') diff --git a/acarp.css b/acarp.css index 91f2482..ed10edb 100644 --- a/acarp.css +++ b/acarp.css @@ -6,10 +6,48 @@ * * A minimal, grid-based theme for Marp presentations designed for academic content. * Grid-only layouts - no flexbox, no utility classes, explicit contracts. + * + * ============================================================================ + * CUSTOMIZATION GUIDE + * ============================================================================ + * + * Most common customizations are in the :root section below. Edit these + * CSS variables to change the theme's appearance: + * + * Dimensions: + * --slide-width: 1280px # Slide width (16:9 aspect ratio) + * --slide-height: 720px # Slide height (16:9 aspect ratio) + * --padding: 70px # Main content padding (left/right) + * --pad-top: 30px # Top padding + * --pad-bottom: 30px # Bottom padding (also pagination position) + * + * Colors: + * --color-background: #fdfcff # Slide background + * --color-foreground: #202228 # Text color + * --color-highlight: #009dd5 # Accent color (links, highlights) + * --color-highlight-heading: #33b1dd # Heading accent color + * --color-background-code: #f2f1f4 # Code block background + * + * Typography: + * Font family: 'Atkinson Hyperlegible' (sans, projection-optimized) + * Base font size: 28px + * Line height: 1.4 + * + * Logo (optional): + * --logo-image: url('path/to/logo.png') + * --logo-width: 100px + * --logo-height: 40px + * --logo-opacity: 0.7 + * --logo-top: 20px + * --logo-right: 20px + * + * For 4:3 aspect ratio (Beamer style), see acarp-beamer.css + * + * ============================================================================ */ /* @theme acarp */ -@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;700&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&display=swap'); /* Import syntax highlighting theme */ @import url('https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/github.min.css'); @@ -23,7 +61,10 @@ --slide-width: 1280px; --slide-height: 720px; --padding: 70px; - --title-top: 40px; + --pad-top: 30px; + --pad-bottom: 30px; + --page-right: var(--padding); + --page-bottom: var(--pad-bottom); --color-background: #fdfcff; --color-background-code: #f2f1f4; --color-foreground: #202228; @@ -32,7 +73,13 @@ --color-highlight-heading: #33b1dd; } -/* Base section styling */ +/* ============================================================================ + BASE SECTION STYLING + + All slides inherit from this base. Defines the slide container, typography, + and positioning context for pagination. + ============================================================================ */ + section { /* Visual appearance */ background: var(--color-background); @@ -43,13 +90,13 @@ section { position: relative; width: var(--slide-width); height: var(--slide-height); - padding: 30px var(--padding); + padding: var(--pad-top) var(--padding) var(--pad-bottom); z-index: 0; /* Typography */ - font-family: 'EB Garamond', 'Times New Roman', serif; + font-family: 'Atkinson Hyperlegible', 'Helvetica Neue', Arial, sans-serif; font-size: 28px; - letter-spacing: 1px; + letter-spacing: 0.2px; line-height: 1.4; /* Text behavior */ @@ -57,11 +104,21 @@ section { word-wrap: break-word; } -/* Just change the color and styling of Marp's default pagination */ +/* ============================================================================ + PAGINATION + + Marp renders slide numbers as section::after pseudo-elements. + Positioned absolutely in the bottom-right corner using CSS variables + to ensure consistency across all layout types. + ============================================================================ */ + section::after { + position: absolute; + bottom: var(--page-bottom); + right: var(--page-right); color: #888888 !important; font-size: 18px !important; - font-family: 'EB Garamond', 'Times New Roman', serif !important; + font-family: 'Atkinson Hyperlegible', 'Helvetica Neue', Arial, sans-serif !important; } /* Hide pagination on title slides */ @@ -69,7 +126,13 @@ section.title::after { display: none !important; } -/* Logo support - top right corner */ +/* ============================================================================ + LOGO SUPPORT + + Optional logo in top-right corner. Configure via CSS variables in your + markdown frontmatter or override in :root above. + ============================================================================ */ + section:not(.title)::before { content: ''; position: absolute; @@ -85,14 +148,17 @@ section:not(.title)::before { z-index: 1; } - - section:not([data-marpit-pagination])::after { display: none; } -/* Typography */ -/* Remove top margin from first element and last element */ +/* ============================================================================ + TYPOGRAPHY: MARGINS AND SPACING + + Remove default margins from first and last elements to maintain clean + spacing. Paragraphs and blockquotes use consistent 15px bottom margin. + ============================================================================ */ + section > *:first-child, section[data-header] > :nth-child(2) { margin-top: 0; @@ -103,49 +169,61 @@ section[data-footer] > :nth-last-child(2) { margin-bottom: 0; } -/* Paragraph and blockquote spacing */ -section p, section blockquote { +section p, +section blockquote { margin: 0 0 15px; } -/* Heading spacing and sizing */ -section h1, section h2, section h3, section h4, section h5, section h6 { +/* ============================================================================ + TYPOGRAPHY: LISTS + + Use right-pointing angle bracket (›) as list marker for a more + academic, minimal appearance. + ============================================================================ */ + +section ul { + list-style-type: '› '; +} + +/* ============================================================================ + TYPOGRAPHY: HEADINGS + + Headings use consistent spacing and sizing. Bold text in headings + is highlighted with the accent color for emphasis. + ============================================================================ */ + +section :is(h1, h2, h3, h4, h5, h6) { margin: 15px 0 30px; } -/* Highlight styling for bold text in headings */ -section h1 strong, section h2 strong, section h3 strong, -section h4 strong, section h5 strong, section h6 strong { +section :is(h1, h2, h3, h4, h5, h6) strong { color: var(--color-highlight-heading); font-weight: inherit; } -/* Auto-scaling constraint for headings */ -section h1::part(auto-scaling), -section h2::part(auto-scaling), -section h3::part(auto-scaling), -section h4::part(auto-scaling), -section h5::part(auto-scaling), -section h6::part(auto-scaling) { +section :is(h1, h2, h3, h4, h5, h6)::part(auto-scaling) { max-height: 660px; } -/* Heading font sizes */ -section h1 { font-size: 2.2em; } -section h2 { font-size: 1.8em; } -section h3 { font-size: 1.5em; } -section h4 { font-size: 1.3em; } -section h5 { font-size: 1.1em; letter-spacing: 1px; } -section h6 { font-size: 0.9em; letter-spacing: 1px; } +section h1 { font-size: 2em; } +section h2 { font-size: 1.6em; } +section h3 { font-size: 1.3em; } +section h4 { font-size: 1.1em; } +section h5 { font-size: 1.05em; letter-spacing: 0.2px; } +section h6 { font-size: 0.9em; letter-spacing: 0.2px; } + +/* ============================================================================ + CODE: INLINE CODE + + Inline code (backticks) gets a subtle background and border. + Font size is reduced to 85% to maintain visual balance. + ============================================================================ */ -/* Code and preformatted text */ -/* Inline code styling */ code { font-family: Monaco, monospace; letter-spacing: 0; } -/* Background for inline code */ section > code, section *:not(pre) > code { background: var(--color-background-code); @@ -159,7 +237,14 @@ section *:not(pre) > code { letter-spacing: -0.02em; } -/* Code block styling */ +/* ============================================================================ + CODE: CODE BLOCKS + + Code blocks (pre/code) use a subtle drop shadow and top accent bar. + Font size is reduced to 70% to fit more content. Overflow is handled + with horizontal scrolling. + ============================================================================ */ + pre { filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.2)); font-size: 70%; @@ -177,7 +262,7 @@ div[style*="max-width"] pre { overflow-x: hidden; } -/* Add subtle background pattern for code blocks */ +/* Add subtle accent bar at top of code blocks */ pre::before { content: ''; position: absolute; @@ -203,116 +288,45 @@ pre > code { border: 1px solid rgba(0, 0, 0, 0.1); } -/* Enhanced syntax highlighting for academic theme - override github theme */ -pre code .hljs-keyword, -.hljs-keyword { - color: #d73a49 !important; - font-weight: 600 !important; -} - -pre code .hljs-string, -.hljs-string { - color: #032f62 !important; -} - -pre code .hljs-comment, -.hljs-comment { - color: #6a737d !important; - font-style: italic; -} - -pre code .hljs-number, -.hljs-number { - color: #005cc5 !important; -} - -pre code .hljs-function, -.hljs-function { - color: #6f42c1 !important; -} - -pre code .hljs-variable, -.hljs-variable { - color: #24292e !important; -} - -pre code .hljs-class, -.hljs-class { - color: #6f42c1 !important; - font-weight: 600 !important; -} - -pre code .hljs-tag, -.hljs-tag { - color: #22863a !important; -} - -/* Language-specific highlights */ -pre code .hljs-built_in, -.hljs-built_in { - color: #e36209 !important; -} - -pre code .hljs-operator, -.hljs-operator { - color: #d73a49 !important; -} - -pre code .hljs-punctuation, -.hljs-punctuation { - color: #586069 !important; -} - -/* Additional syntax elements */ -pre code .hljs-title, -.hljs-title { - color: #6f42c1 !important; - font-weight: 600 !important; -} - -pre code .hljs-params, -.hljs-params { - color: #24292e !important; -} - -pre code .hljs-attr, -.hljs-attr { - color: #6f42c1 !important; -} - -pre code .hljs-name, -.hljs-name { - color: #22863a !important; -} - -/* Math formulas */ -math { - font-size: 1.1em; - display: block !important; - margin: 0.8em 0 0.8em 1.5em !important; - text-align: left !important; -} +/* ============================================================================ + MATH FORMULAS + + Math expressions (LaTeX) are displayed as block elements with + left indentation for visual hierarchy. + ============================================================================ */ -/* MathML and Marp equation rendering */ +math, section span[data-math], section .math { + font-size: 1.1em; display: block !important; - margin: 0.8em 1.5em !important; + margin: 0.8em 0 0.8em 1.5em !important; text-align: left !important; padding-left: 1.5em; } /* ============================================================================ UTILITY CLASSES + + Spacing utilities for fine-grained control over vertical spacing. + Use these classes to add consistent spacing between content blocks. ============================================================================ */ -/* Vertical spacing utilities */ +/* Vertical spacing utilities - add top margin */ +.vspace-tiny { margin-top: 0.5em !important; } .vspace-small { margin-top: 1em !important; } .vspace-medium { margin-top: 2em !important; } .vspace-large { margin-top: 3em !important; } .vspace-xlarge { margin-top: 4em !important; } +.vspace-xxlarge { margin-top: 5em !important; } +.vspace-6 { margin-top: 6em !important; } +.vspace-7 { margin-top: 7em !important; } +.vspace-8 { margin-top: 8em !important; } +.vspace-9 { margin-top: 9em !important; } +.vspace-10 { margin-top: 10em !important; } + -/* Spacing that works on any element */ +/* General spacing utilities */ .push-down { margin-bottom: 1.5em !important; } .push-up { margin-top: 1.5em !important; } @@ -327,20 +341,46 @@ section p > img:only-child { margin: 0 auto; } -/* Citation utility - bottom left corner */ -.cite { - position: absolute; - bottom: 30px; - left: var(--padding); - font-size: 0.7em; - color: #888888; - opacity: 0.9; +/* ============================================================================ + CITATION HELPER + + Position citations in the bottom-left corner. Use the .cite class + on a div or span to add a citation to your slide. + ============================================================================ */ + +section .cite, +div.cite { + position: absolute !important; + bottom: var(--page-bottom) !important; + left: var(--padding) !important; + font-size: 18px !important; + color: #888888 !important; + opacity: 0.9 !important; + white-space: normal !important; + margin-bottom: 0 !important; + width: calc(100% - var(--padding) - var(--page-right) - 150px) !important; + max-width: calc(100% - var(--padding) - var(--page-right) - 150px) !important; + box-sizing: border-box !important; + overflow-wrap: break-word !important; + word-break: break-word !important; + display: block !important; } /* ============================================================================ LAYOUT: title - Centered title slide for cover pages. + Title slide layout - centered content with flexbox. + + Usage: + + # Main Title + ## Subtitle + + Features: + - Centered vertically and horizontally + - Hides pagination + - Supports multiple heading levels + - Images scale to 80% width ============================================================================ */ section.title { @@ -356,37 +396,49 @@ section.title { position: relative; } -/* Wrapper for title content to ensure proper centering */ section.title > * { flex: 0 0 auto; } section.title > h1 { - font-size: 64px; + font-size: 2em !important; margin: 0; padding: 0; } section.title > h2 { - font-size: 24px; + font-size: 1.2em !important; color: #666; margin: 0.5em 0 0 0; padding: 0; font-weight: normal; - letter-spacing: 1px; + letter-spacing: 0.2px; +} + +section.title > h3 { + font-size: 0.9em !important; + font-weight: normal !important; + color: #666; + margin: 0.5em 0 0 0; + padding: 0; +} + +section.title > h4 { + font-size: 0.8em !important; + font-weight: normal !important; + color: #888; + margin: 0.3em 0 0 0; + padding: 0; + letter-spacing: 0.2px; } -/* Images in title slides behave normally */ section.title > img { margin: 2em 0; max-width: 80%; height: auto; } -/* Ensure proper title slide alignment in fullscreen mode */ -div.marpit > svg > foreignObject > section.title, -svg.marpit > foreignObject > section.title, -.marpit svg > foreignObject > section.title { +:is(div.marpit, svg.marpit, .marpit svg) > foreignObject > section.title { width: 100%; height: 100%; display: grid; @@ -396,58 +448,76 @@ svg.marpit > foreignObject > section.title, /* ============================================================================ LAYOUT: layout-2col - Two-column layout: left and right columns with title at top. + Two-column layout with title at top. - Grid contract: + Grid structure: ┌─────────────────────────────┐ │ title │ ├──────────────┬──────────────┤ │ │ │ │ left-col │ right-col │ │ │ │ - ├──────────────┴──────────────┤ - │ pagination │ - └─────────────────────────────┘ + └──────────────┴──────────────┘ + + Usage: + + # Title - Grid areas: title, left, right, footer - Default gap: 2em - Columns: 1fr 1fr (equal) +