From d3c858ed320cd94c61ad6221e68752e5e567004f Mon Sep 17 00:00:00 2001 From: Yuval Tassa Date: Mon, 1 Dec 2025 06:12:40 -0800 Subject: [PATCH] Make table shadows visible in dark theme, add a table type with smaller text. Add a light box-shadow to docutils tables (excluding mjcf-attributes) when in dark mode or auto mode with dark preference, so that the table boundaries are visible against the dark background. PiperOrigin-RevId: 838741947 Change-Id: Ic788f9669ea65d290f927927b389fcb51227a55a --- doc/css/theme_overrides.css | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/doc/css/theme_overrides.css b/doc/css/theme_overrides.css index 48e4e951..3c52d089 100644 --- a/doc/css/theme_overrides.css +++ b/doc/css/theme_overrides.css @@ -28,6 +28,16 @@ body[data-theme="dark"] { } } +/* Make table shadows visible in dark theme. */ +body[data-theme="dark"] table.docutils:not(.mjcf-attributes) { + box-shadow: 0 0.2rem 0.5rem rgba(255, 255, 255, 0.15); +} +@media (prefers-color-scheme: dark) { + body[data-theme="auto"] table.docutils:not(.mjcf-attributes) { + box-shadow: 0 0.2rem 0.5rem rgba(255, 255, 255, 0.15); + } +} + .schema-small { font-size: 93%; } @@ -36,6 +46,15 @@ body[data-theme="dark"] { font-size: 85%; } +.small-centered { + font-size: 93%; +} + +.small-centered td, .small-centered th { + text-align: center !important; + vertical-align: middle !important; +} + .sidebar-brand-text { display: none; } @@ -193,10 +212,15 @@ table.aligntop > tbody { /* Alternate row colors. */ -table.docutils:not(.mjcf-attributes) > tbody > tr.row-odd { +table.docutils:not(.mjcf-attributes):not(.no-stripes) > tbody > tr.row-odd { background-color: var(--row-odd-background-color); } +/* Disable alternating colors for tables with .no-stripes class */ +table.docutils.no-stripes > tbody > tr { + background-color: transparent !important; +} + /* MJCF attributes table. */ table.mjcf-attributes { border-style: none;