com.wallstop-studios.unity-helpers
Version:
Treasure chest of Unity developer tools
1,176 lines (1,030 loc) • 29.3 kB
CSS
/* Unity Helpers - Theme Styles */
/* Default: Dark mode (Unity Editor-inspired) */
/*
* ARCHITECTURE NOTE: !important declarations
* -----------------------------------------
* This stylesheet overrides GitHub Pages' "minimal" Jekyll theme which is loaded
* as a remote theme. Since we cannot modify the source theme CSS and it loads
* before our custom styles, !important is required to ensure our theme variables
* take precedence. This is a standard pattern for remote theme customization.
*
* If you need to override these styles in the future, you have two options:
* 1. Use !important with higher specificity selectors (e.g., body.custom-class)
* 2. Inline styles on specific elements (not recommended for maintainability)
*
* The CSS custom properties (--bg-primary, etc.) allow theme switching without
* !important conflicts since the values change, not the declarations.
*/
/* Global box-sizing for consistent sizing */
*,
*::before,
*::after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
:root {
/* Light theme colors */
--light-bg-primary: #f5f5f5;
--light-bg-secondary: #ffffff;
--light-bg-code: #f0f0f0;
--light-text-primary: #222222;
--light-text-secondary: #555555;
--light-text-muted: #777777;
--light-border: #d0d0d0;
--light-link: #0969da;
--light-link-hover: #0550ae;
--light-accent: #3e8ed0;
--light-code-bg: #f6f8fa;
--light-inline-code-bg: #eff1f3;
--light-selection: #b4d5fe;
/* Dark theme colors (Unity Editor-inspired) */
--dark-bg-primary: #1e1e1e;
--dark-bg-secondary: #252526;
--dark-bg-code: #2d2d2d;
--dark-text-primary: #d4d4d4;
--dark-text-secondary: #b0b0b0;
--dark-text-muted: #808080;
--dark-border: #3c3c3c;
--dark-link: #569cd6;
--dark-link-hover: #9cdcfe;
--dark-accent: #4ec9b0;
--dark-code-bg: #1e1e1e;
--dark-inline-code-bg: #3c3c3c;
--dark-selection: #264f78;
/* Unity-specific accent colors */
--unity-blue: #00aaff;
--unity-orange: #f5a623;
--unity-green: #7fc97f;
--unity-purple: #b48ead;
/* Default theme variables (dark) - applied before data-theme is set */
--bg-primary: var(--dark-bg-primary);
--bg-secondary: var(--dark-bg-secondary);
--bg-code: var(--dark-bg-code);
--text-primary: var(--dark-text-primary);
--text-secondary: var(--dark-text-secondary);
--text-muted: var(--dark-text-muted);
--border-color: var(--dark-border);
--link-color: var(--dark-link);
--link-hover: var(--dark-link-hover);
--accent-color: var(--dark-accent);
--code-bg: var(--dark-code-bg);
--inline-code-bg: var(--dark-inline-code-bg);
--selection-bg: var(--dark-selection);
}
/* Dark theme (default) */
[data-theme="dark"] {
--bg-primary: var(--dark-bg-primary);
--bg-secondary: var(--dark-bg-secondary);
--bg-code: var(--dark-bg-code);
--text-primary: var(--dark-text-primary);
--text-secondary: var(--dark-text-secondary);
--text-muted: var(--dark-text-muted);
--border-color: var(--dark-border);
--link-color: var(--dark-link);
--link-hover: var(--dark-link-hover);
--accent-color: var(--dark-accent);
--code-bg: var(--dark-code-bg);
--inline-code-bg: var(--dark-inline-code-bg);
--selection-bg: var(--dark-selection);
}
/* Light theme */
[data-theme="light"] {
--bg-primary: var(--light-bg-primary);
--bg-secondary: var(--light-bg-secondary);
--bg-code: var(--light-bg-code);
--text-primary: var(--light-text-primary);
--text-secondary: var(--light-text-secondary);
--text-muted: var(--light-text-muted);
--border-color: var(--light-border);
--link-color: var(--light-link);
--link-hover: var(--light-link-hover);
--accent-color: var(--light-accent);
--code-bg: var(--light-code-bg);
--inline-code-bg: var(--light-inline-code-bg);
--selection-bg: var(--light-selection);
}
/*
* Automatic theme detection based on OS preference.
* This applies when no data-theme attribute is set (before JS loads).
* Once JS sets data-theme, those selectors take precedence.
*/
@media (prefers-color-scheme: light) {
:root:not([data-theme]) {
--bg-primary: var(--light-bg-primary);
--bg-secondary: var(--light-bg-secondary);
--bg-code: var(--light-bg-code);
--text-primary: var(--light-text-primary);
--text-secondary: var(--light-text-secondary);
--text-muted: var(--light-text-muted);
--border-color: var(--light-border);
--link-color: var(--light-link);
--link-hover: var(--light-link-hover);
--accent-color: var(--light-accent);
--code-bg: var(--light-code-bg);
--inline-code-bg: var(--light-inline-code-bg);
--selection-bg: var(--light-selection);
}
}
/* Respect user's motion preferences (WCAG 2.1 SC 2.3.3) */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
-webkit-animation-duration: 0s ;
animation-duration: 0s ;
-webkit-animation-iteration-count: 1 ;
animation-iteration-count: 1 ;
-webkit-transition-duration: 0s ;
transition-duration: 0s ;
scroll-behavior: auto ;
}
}
/* Apply theme to body */
body {
/* Fallback for browsers without CSS custom properties */
background-color: #1e1e1e ;
background-color: var(--bg-primary) ;
color: #d4d4d4 ;
color: var(--text-primary) ;
-webkit-transition:
background-color 0.3s ease,
color 0.3s ease;
-moz-transition:
background-color 0.3s ease,
color 0.3s ease;
-o-transition:
background-color 0.3s ease,
color 0.3s ease;
transition:
background-color 0.3s ease,
color 0.3s ease;
}
/* Main content wrapper */
.wrapper {
background-color: var(--bg-primary) ;
}
/* Comprehensive Minimal theme overrides - ensure no background boxes */
.wrapper,
.wrapper > *,
.inner,
header,
header *,
section,
section *,
footer,
footer * {
background-color: transparent ;
box-shadow: none ;
}
/* Re-apply backgrounds only to root containers */
body {
background-color: var(--bg-primary) ;
}
header {
background-color: var(--bg-primary) ;
border: none ;
}
header h1 {
background-color: transparent ;
}
section {
background-color: var(--bg-primary) ;
}
footer {
background-color: var(--bg-primary) ;
border: none ;
}
/* Minimal theme logo/banner specific overrides */
header ul {
background-color: transparent ;
}
header li {
background-color: transparent ;
}
/* Downloads buttons - hidden via style.scss, no styling needed */
/* Headers */
h1,
h2,
h3,
h4,
h5,
h6 {
color: var(--text-primary) ;
}
/* Paragraphs and general text */
p,
li,
td,
th {
color: var(--text-secondary) ;
}
/* Links */
a {
color: var(--link-color) ;
transition: color 0.2s ease;
}
a:hover {
color: var(--link-hover) ;
}
/* Code blocks */
/* Note: Inline code wrapping for :not(pre) > code is handled in style.scss (Issue #130) */
pre {
background-color: var(--code-bg) ;
border: 1px solid var(--border-color) ;
border-radius: 6px;
padding: 16px ;
overflow-x: auto ;
/* Prevent premature word-wrapping - code should scroll horizontally */
white-space: pre ;
word-wrap: normal ;
overflow-wrap: normal ;
word-break: normal ;
}
pre code {
background-color: transparent ;
color: var(--text-primary) ;
/* Ensure code inside pre doesn't wrap */
white-space: pre ;
word-wrap: normal ;
overflow-wrap: normal ;
word-break: normal ;
}
/* Inline code */
code {
background-color: var(--inline-code-bg) ;
color: var(--text-primary) ;
padding: 2px 6px;
border-radius: 4px;
font-size: 0.9em;
}
/* Tables */
table {
border-collapse: collapse;
width: 100%;
margin: 1em 0;
}
th,
td {
border: 1px solid var(--border-color) ;
padding: 8px 12px;
}
th {
background-color: var(--bg-secondary) ;
}
tr:nth-child(even) {
background-color: var(--bg-secondary) ;
}
/* Blockquotes */
blockquote {
border-left: 4px solid var(--accent-color) ;
/* RTL support with logical properties (with fallback) */
border-inline-start: 4px solid var(--accent-color) ;
background-color: var(--bg-secondary) ;
color: var(--text-secondary) ;
padding: 10px 20px;
/* RTL support for padding */
padding-inline-start: 20px;
padding-inline-end: 20px;
margin: 1em 0;
}
/* Horizontal rules - styled in style.scss with full reset */
/* Selection */
::selection {
background-color: var(--selection-bg);
color: var(--text-primary);
}
/* Focus styles for accessibility - visible keyboard focus indicators */
a:focus,
button:focus,
.theme-toggle:focus,
summary:focus,
[tabindex]:focus {
outline: 2px solid var(--accent-color) ;
outline-offset: 2px ;
}
/* Remove focus outline for mouse users, keep for keyboard */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
.theme-toggle:focus:not(:focus-visible),
summary:focus:not(:focus-visible),
[tabindex]:focus:not(:focus-visible) {
outline: none ;
}
/* Enhanced focus-visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
.theme-toggle:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
outline: 2px solid var(--accent-color) ;
outline-offset: 2px ;
}
/* Scrollbar (webkit browsers) */
[data-theme="dark"] ::-webkit-scrollbar {
width: 10px;
height: 10px;
}
[data-theme="dark"] ::-webkit-scrollbar-track {
background: var(--dark-bg-secondary);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
background: var(--dark-border);
border-radius: 5px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
background: var(--dark-text-muted);
}
/* Theme toggle button */
.theme-toggle {
position: fixed;
top: 16px;
right: 16px;
/* RTL support with logical properties (with fallback) */
inset-inline-end: 16px;
z-index: 1000;
background-color: var(--bg-secondary);
/* Fallback for browsers without CSS custom properties */
background-color: #252526;
background-color: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 8px 12px;
cursor: pointer;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
gap: 8px;
font-size: 14px;
color: var(--text-primary) ;
-webkit-transition:
background-color 0.2s ease,
border-color 0.2s ease;
-moz-transition:
background-color 0.2s ease,
border-color 0.2s ease;
-o-transition:
background-color 0.2s ease,
border-color 0.2s ease;
transition:
background-color 0.2s ease,
border-color 0.2s ease;
-webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
/* Ensure clickable on touch devices */
-webkit-tap-highlight-color: transparent;
touch-action: manipulation;
}
.theme-toggle:hover {
background-color: var(--border-color);
}
.theme-toggle svg {
width: 18px;
height: 18px;
fill: currentColor;
}
.theme-toggle .sun-icon {
display: none;
}
.theme-toggle .moon-icon {
display: block;
}
[data-theme="light"] .theme-toggle .sun-icon {
display: block;
}
[data-theme="light"] .theme-toggle .moon-icon {
display: none;
}
/* Header section styling */
/* Issue #127: Sticky header support - ensure solid background and visual separation */
header {
background-color: var(--bg-primary) ;
border: none ;
padding-bottom: 20px;
margin-bottom: 20px;
/* Subtle shadow for visual separation when sticky (works with both themes) */
-webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) ;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) ;
}
header h1 {
color: var(--unity-blue) ;
}
/* Section wrapper */
section {
background-color: var(--bg-primary) ;
}
/* Footer */
footer {
background-color: var(--bg-primary) ;
border: none ;
color: var(--text-muted) ;
}
footer small {
color: var(--text-muted) ;
}
/* Navigation links in header */
header a {
color: var(--link-color) ;
}
/* Strong/bold text */
strong,
b {
color: var(--text-primary) ;
}
/* Emphasis */
em,
i {
color: var(--text-secondary) ;
}
/* Details/summary elements */
details {
background-color: var(--bg-secondary) ;
border: 1px solid var(--border-color) ;
border-radius: 6px;
padding: 10px;
margin: 1em 0;
}
summary {
cursor: pointer;
color: var(--text-primary) ;
font-weight: 600;
}
/* Syntax highlighting adjustments for dark mode */
[data-theme="dark"] .highlight .c,
[data-theme="dark"] .highlight .c1,
[data-theme="dark"] .highlight .cm {
color: #6a9955 ;
} /* Comments */
[data-theme="dark"] .highlight .k,
[data-theme="dark"] .highlight .kd,
[data-theme="dark"] .highlight .kn {
color: #569cd6 ;
} /* Keywords */
[data-theme="dark"] .highlight .s,
[data-theme="dark"] .highlight .s1,
[data-theme="dark"] .highlight .s2 {
color: #ce9178 ;
} /* Strings */
[data-theme="dark"] .highlight .n,
[data-theme="dark"] .highlight .na,
[data-theme="dark"] .highlight .nb {
color: #9cdcfe ;
} /* Names */
[data-theme="dark"] .highlight .nf {
color: #dcdcaa ;
} /* Function names */
[data-theme="dark"] .highlight .nc {
color: #4ec9b0 ;
} /* Class names */
[data-theme="dark"] .highlight .m,
[data-theme="dark"] .highlight .mi,
[data-theme="dark"] .highlight .mf {
color: #b5cea8 ;
} /* Numbers */
[data-theme="dark"] .highlight .o,
[data-theme="dark"] .highlight .p {
color: #d4d4d4 ;
} /* Operators, punctuation */
/* Image styling */
img {
max-width: 100%;
border-radius: 6px;
}
/* SVG banner styling - ensure transparency and proper blending */
img[src*="banner.svg"],
img[alt*="Banner"] {
background: transparent ;
border: none ;
box-shadow: none ;
border-radius: 12px;
}
/* Light mode banner - subtle shadow for depth on light backgrounds */
[data-theme="light"] img[src*="banner.svg"],
[data-theme="light"] img[alt*="Banner"] {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) ;
}
/* Dark mode banner - no shadow needed */
[data-theme="dark"] img[src*="banner.svg"],
[data-theme="dark"] img[alt*="Banner"] {
box-shadow: none ;
}
/*
* Banner container centering for Jekyll pages
* Note: HTML uses <p align="center"> which handles centering natively.
* These styles provide additional sizing constraints.
* Using :first-of-type to target only the banner, not other centered paragraphs (e.g., badges).
*/
section p[align="center"]:first-of-type {
margin: 1rem auto 2rem;
max-width: 800px;
}
/* Responsive banner sizing - tablet */
@media (max-width: 960px) {
section p[align="center"]:first-of-type {
max-width: 100%;
margin: 0.75rem auto 1.5rem;
padding: 0 1rem;
}
}
/* Responsive banner sizing - small tablet */
@media (max-width: 768px) {
section p[align="center"]:first-of-type {
margin: 0.5rem auto 1.25rem;
padding: 0 0.75rem;
}
img[src*="banner.svg"],
img[alt*="Banner"] {
border-radius: 10px;
}
}
/* Responsive banner sizing - mobile */
@media (max-width: 600px) {
section p[align="center"]:first-of-type {
margin: 0.5rem auto 1rem;
padding: 0 0.5rem;
}
img[src*="banner.svg"],
img[alt*="Banner"] {
border-radius: 8px;
}
}
/* Print media query - hide banner for cleaner print output */
@media print {
section p[align="center"]:first-of-type,
img[src*="banner.svg"],
img[alt*="Banner"] {
display: none ;
}
}
/* Ensure mermaid diagrams respect theme */
.mermaid {
background-color: transparent ;
}
/* Responsive adjustments */
@media (max-width: 768px) {
.theme-toggle {
top: 8px;
right: 8px;
inset-inline-end: 8px;
padding: 6px 10px;
font-size: 12px;
}
.theme-toggle span {
display: none;
}
}
/* Print styles - always use light theme */
@media print {
body {
background-color: #ffffff ;
color: #000000 ;
}
.theme-toggle {
display: none ;
}
/* Ensure all text is black for printing */
h1,
h2,
h3,
h4,
h5,
h6,
p,
li,
td,
th,
span,
a {
color: #000000 ;
}
/* Links should show URL in print */
a[href]::after {
content: " (" attr(href) ")";
font-size: 0.8em;
color: #666666 ;
}
/* Don't show URL for internal links */
a[href^="#"]::after,
a[href^="javascript:"]::after {
content: "";
}
/* Code blocks should have visible borders */
pre {
background-color: #f5f5f5 ;
border: 1px solid #cccccc ;
page-break-inside: avoid ;
overflow-x: visible ;
white-space: pre-wrap ;
word-wrap: break-word ;
}
pre code {
color: #000000 ;
white-space: pre-wrap ;
}
/* Inline code styling for print */
code {
background-color: #eeeeee ;
color: #000000 ;
}
/* Tables should have visible borders */
table {
border-collapse: collapse ;
}
th,
td {
border: 1px solid #000000 ;
background-color: transparent ;
}
th {
background-color: #eeeeee ;
}
/* Avoid page breaks inside elements */
img,
table,
figure {
page-break-inside: avoid ;
}
/* Ensure headings stay with following content */
h1,
h2,
h3,
h4,
h5,
h6 {
page-break-after: avoid ;
}
}
/* =============================================================================
LAYOUT OVERRIDES - Transform minimal theme from sidebar to top banner layout
============================================================================= */
/*
* The Jekyll minimal theme uses a fixed two-column layout:
* - Wrapper: 860px max-width, centered
* - Header: 270px sidebar on the left
* - Section: 500px content on the right
*
* These overrides transform it into a responsive single-column layout with
* a compact top banner header and full-width content area.
*/
/* Expand the wrapper to use available screen width */
.wrapper {
max-width: 1400px ;
width: 95% ;
margin: 0 auto ;
padding: 20px ;
}
/* Transform header from sidebar to compact top banner */
/* Issue #127: Using sticky positioning for persistent header during scroll */
header {
float: none ;
width: 100% ;
position: -webkit-sticky ;
position: sticky ;
top: 0 ;
z-index: 100 ;
text-align: center ;
padding: 15px 20px ;
margin-bottom: 30px ;
border-bottom: 1px solid var(--border-color) ;
/* Ensure solid background so content scrolls underneath cleanly */
background-color: var(--bg-primary) ;
}
/* Compact header title with overflow handling */
header h1 {
font-size: 1.75rem ;
margin: 0 0 8px 0 ;
display: inline-block ;
max-width: 100% ;
overflow: hidden ;
text-overflow: ellipsis ;
white-space: nowrap ;
}
/* Compact header description */
header p {
font-size: 0.95rem ;
margin: 0 ;
color: var(--text-muted) ;
}
/* Header links/buttons in horizontal layout */
header ul {
display: -webkit-box ;
display: -webkit-flex ;
display: -ms-flexbox ;
display: flex ;
-webkit-flex-wrap: wrap ;
-ms-flex-wrap: wrap ;
flex-wrap: wrap ;
-webkit-box-pack: center ;
-webkit-justify-content: center ;
-ms-flex-pack: center ;
justify-content: center ;
gap: 10px ;
/* Fallback for browsers without gap support */
margin: 15px -5px 0 -5px ;
padding: 0 ;
list-style: none ;
}
/* Gap fallback for older browsers */
header ul > li {
margin: 5px ;
}
header li {
display: inline-block ;
width: auto ;
height: auto ;
margin: 0 ;
padding: 0 ;
}
/* Style header download/action buttons */
header ul a,
header .downloads a {
display: inline-block ;
padding: 8px 16px ;
font-size: 0.85rem ;
border-radius: 6px ;
text-decoration: none ;
background-color: var(--bg-secondary) ;
border: 1px solid var(--border-color) ;
transition:
background-color 0.2s ease,
border-color 0.2s ease ;
}
header ul a:hover,
header .downloads a:hover {
background-color: var(--border-color) ;
}
/* Expand section (main content) to use available width */
section {
float: none ;
width: 100% ;
max-width: 1200px ;
margin: 0 auto ;
padding: 0 20px ;
}
/* Footer - compact and centered */
footer {
float: none ;
width: 100% ;
text-align: center ;
padding: 20px ;
margin-top: 40px ;
border-top: 1px solid var(--border-color) ;
position: relative ;
bottom: auto ;
left: auto ;
}
/* Clear floats properly */
.wrapper::after {
content: "" ;
display: table ;
clear: both ;
}
/* =============================================================================
CODE BLOCK IMPROVEMENTS - Ensure adequate width and readability
============================================================================= */
/* Code blocks should use full available width */
pre {
max-width: 100% ;
width: 100% ;
overflow-x: auto ;
-webkit-overflow-scrolling: touch ; /* Smooth scrolling on iOS */
font-size: 0.875rem ;
line-height: 1.5 ;
/* Prevent text selection issues during scroll */
-webkit-user-select: text ;
-moz-user-select: text ;
-ms-user-select: text ;
user-select: text ;
}
/* Ensure code inside pre doesn't wrap unnecessarily */
pre code {
display: block ;
white-space: pre ;
word-wrap: normal ;
overflow-wrap: normal ;
overflow-x: auto ;
/* Handle very long strings without breaking layout */
word-break: normal ;
}
/* Syntax highlighted code blocks */
.highlight {
max-width: 100% ;
overflow-x: auto ;
margin: 1em 0 ;
}
.highlight pre {
margin: 0 ;
/* Ensure syntax highlighted code doesn't wrap */
white-space: pre ;
word-wrap: normal ;
overflow-wrap: normal ;
word-break: normal ;
}
.highlight code,
.highlight pre code {
/* Ensure code inside highlight blocks doesn't wrap */
white-space: pre ;
word-wrap: normal ;
overflow-wrap: normal ;
word-break: normal ;
}
/* =============================================================================
RESPONSIVE DESIGN - Adapt to all screen sizes
============================================================================= */
/* Large screens (1400px+) - maximize content width */
@media (min-width: 1400px) {
.wrapper {
max-width: 1600px ;
width: 90% ;
}
section {
max-width: 1400px ;
}
}
/* Extra large screens (2000px+) - ultrawide support */
@media (min-width: 2000px) {
.wrapper {
max-width: 1800px ;
}
section {
max-width: 1600px ;
}
}
/* Medium screens (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
.wrapper {
width: 95% ;
padding: 15px ;
}
section {
max-width: 100% ;
padding: 0 15px ;
}
}
/* Tablet screens (481px - 768px) */
@media (max-width: 768px) {
.wrapper {
width: 100% ;
padding: 10px ;
}
header {
padding: 12px 15px ;
margin-bottom: 20px ;
}
header h1 {
font-size: 1.5rem ;
}
header p {
font-size: 0.9rem ;
}
header ul {
gap: 8px ;
}
header ul a,
header .downloads a {
padding: 6px 12px ;
font-size: 0.8rem ;
}
section {
padding: 0 10px ;
}
pre {
padding: 12px ;
font-size: 0.8rem ;
}
footer {
padding: 15px 10px ;
margin-top: 30px ;
}
}
/* Mobile screens (320px - 480px) */
@media (max-width: 480px) {
.wrapper {
width: 100% ;
padding: 8px ;
}
header {
padding: 10px ;
margin-bottom: 15px ;
}
header h1 {
font-size: 1.25rem ;
}
header p {
font-size: 0.85rem ;
}
header ul {
-webkit-box-orient: vertical ;
-webkit-box-direction: normal ;
-webkit-flex-direction: column ;
-ms-flex-direction: column ;
flex-direction: column ;
-webkit-box-align: center ;
-webkit-align-items: center ;
-ms-flex-align: center ;
align-items: center ;
gap: 6px ;
}
header ul a,
header .downloads a {
width: 100% ;
max-width: 200px ;
text-align: center ;
padding: 8px 12px ;
}
section {
padding: 0 8px ;
}
pre {
padding: 10px ;
font-size: 0.75rem ;
border-radius: 4px ;
}
/* Tables scroll horizontally on mobile */
table {
display: block ;
overflow-x: auto ;
-webkit-overflow-scrolling: touch ;
/* Remove white-space: nowrap to allow text wrapping within cells */
}
table td,
table th {
/* Allow text to wrap in cells, but set minimum width */
min-width: 100px ;
white-space: normal ;
}
footer {
padding: 12px 8px ;
margin-top: 25px ;
}
footer small {
font-size: 0.75rem ;
}
/* Adjust theme toggle for mobile */
.theme-toggle {
top: 6px ;
right: 6px ;
inset-inline-end: 6px ;
padding: 5px 8px ;
}
}
/* Very small screens (below 320px) */
@media (max-width: 320px) {
header h1 {
font-size: 1.1rem ;
}
header p {
font-size: 0.8rem ;
}
pre {
font-size: 0.7rem ;
padding: 8px ;
}
}
/* =============================================================================
CONTENT READABILITY IMPROVEMENTS
============================================================================= */
/* Ensure readable line lengths for prose content */
section p,
section li {
max-width: 75ch ;
}
/* But allow tables, code, and other elements to use full width */
section table,
section pre,
section .highlight,
section img {
max-width: 100% ;
}
/* Improve heading spacing */
section h1,
section h2,
section h3,
section h4,
section h5,
section h6 {
margin-top: 1.5em ;
margin-bottom: 0.5em ;
}
section h1:first-child,
section h2:first-child {
margin-top: 0 ;
}
/* Better spacing for lists */
section ul,
section ol {
padding-left: 2em ;
margin: 1em 0 ;
}
/* Nested list spacing */
section ul ul,
section ol ol,
section ul ol,
section ol ul {
margin: 0.5em 0 ;
}