From 0861ba00889641932f992a3f9776a4d4e6a2292c Mon Sep 17 00:00:00 2001 From: Aditya Bidwai Date: Tue, 23 Jun 2026 23:20:57 -0500 Subject: [PATCH] fix(docs): invert vectorized diagram SVGs in dark mode (#27574) * fix(docs): invert vectorized diagram SVGs in dark mode * docs(docs): Apply fix as a class * Add yarn lock to fix CI --------- Co-authored-by: Hamish Willee --- docs/.vitepress/theme/style.css | 12 ++++++++++++ docs/en/companion_computer/index.md | 2 +- docs/en/concept/pwm_limit.md | 2 +- docs/en/concept/px4_systems_architecture.md | 4 ++-- docs/package.json | 2 +- docs/yarn.lock | 8 ++++---- 6 files changed, 21 insertions(+), 9 deletions(-) diff --git a/docs/.vitepress/theme/style.css b/docs/.vitepress/theme/style.css index 04abf7943cc..6e7595bba27 100644 --- a/docs/.vitepress/theme/style.css +++ b/docs/.vitepress/theme/style.css @@ -218,3 +218,15 @@ html { } } + + +/** + * Dark mode: invert vectorized diagram SVGs (Google Drawings exports where all + * text and arrows are black paths — invisible on a dark background without this). + * hue-rotate(180deg) keeps blue tones from turning orange after the invert. + * Apply class="diagram-invert" to any image that needs this treatment. + * -------------------------------------------------------------------------- */ + +.dark .diagram-invert { + filter: invert(1) hue-rotate(180deg); +} diff --git a/docs/en/companion_computer/index.md b/docs/en/companion_computer/index.md index 0418c7de2c8..080da731d67 100644 --- a/docs/en/companion_computer/index.md +++ b/docs/en/companion_computer/index.md @@ -4,7 +4,7 @@ Companion computers ("mission computers"), are separate on-vehicle computers tha The diagram below shows a possible architecture for an unmanned vehicle architecture that includes a flight controller and companion computer. -![PX4 architecture - FC + Companion Computer](../../assets/diagrams/px4_companion_computer_simple.svg) +PX4 architecture - FC + Companion Computer diff --git a/docs/en/concept/pwm_limit.md b/docs/en/concept/pwm_limit.md index 9e9f4d6d425..f72aae5f7d9 100644 --- a/docs/en/concept/pwm_limit.md +++ b/docs/en/concept/pwm_limit.md @@ -24,4 +24,4 @@ Provides a delay between assertion of "armed" and a ramp-up of throttle on asser ## State Transition Diagram -![PWM Limit state machine diagram](../../assets/diagrams/pwm_limit_state_diagram.svg) +PWM Limit state machine diagram diff --git a/docs/en/concept/px4_systems_architecture.md b/docs/en/concept/px4_systems_architecture.md index a8fd0a2b44d..d00302dc886 100644 --- a/docs/en/concept/px4_systems_architecture.md +++ b/docs/en/concept/px4_systems_architecture.md @@ -11,7 +11,7 @@ Offboard APIs are covered in [ROS](../ros/index.md) and [MAVSDK](https://mavsdk. The diagram below provides a high level overview of a typical "simple" PX4 system based around a flight controller. -![PX4 architecture - FC only system](../../assets/diagrams/px4_arch_fc.svg) +PX4 architecture - FC only system @@ -34,7 +34,7 @@ The left hand side of the diagram shows the software stack, which is horizontall The diagram below shows a PX4 system that includes both a flight controller and a companion computer (here referred to as a "mission computer"). -![PX4 architecture - FC + Companion Computer](../../assets/diagrams/px4_arch_fc_companion.svg) +PX4 architecture - FC + Companion Computer diff --git a/docs/package.json b/docs/package.json index dc6d4843b3a..293b5797566 100644 --- a/docs/package.json +++ b/docs/package.json @@ -28,7 +28,7 @@ }, "devDependencies": { "prettier": "^3.8.3", - "markdown_link_checker_sc": "^0.0.144" + "markdown_link_checker_sc": "^0.0.145" }, "resolutions": { "markdown-it": "^14.1.1", diff --git a/docs/yarn.lock b/docs/yarn.lock index 70c39c8551d..98735b2be09 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -1259,10 +1259,10 @@ markdown-it@^13.0.1, markdown-it@^14.1.1: punycode.js "^2.3.1" uc.micro "^2.1.0" -markdown_link_checker_sc@^0.0.144: - version "0.0.144" - resolved "https://registry.npmjs.org/markdown_link_checker_sc/-/markdown_link_checker_sc-0.0.144.tgz" - integrity sha512-8gt9nTvFrg8aIBwvd3uVYBmt0NNQyBIknzrNpaeYXQBs91jM1DtEJIELmVwOsUAilIxu2gI3NzLIoBG3dXkPcQ== +markdown_link_checker_sc@^0.0.145: + version "0.0.145" + resolved "https://registry.yarnpkg.com/markdown_link_checker_sc/-/markdown_link_checker_sc-0.0.145.tgz#b4849df81c9fdb437fc2edb87ee3b8d5afaf199f" + integrity sha512-IH3AVF1pcc5PaBIce9ZhU0cEqNhwtcRrEAS2w1CjFk4WVD2YJfyLeOsUfeYqlE53lHn5a1pditHPjOKWrYdHow== dependencies: commander "^10.0.0" normalize-path "^3.0.0"