Skip to content

Commit 579ed31

Browse files
authored
Fix visibility of VS Code and DevTools icons in dark mode (#12366)
On the pages https://docs.flutter.dev/tools/vs-code#advanced-debugging and https://docs.flutter.dev/tools/devtools/inspector#debugging-layout-issues-visually, the icons are not properly visible in dark mode. Added some css to make it visible in both dark and light mode. Fixes #12365 **Before:** <img width="400" alt="Screenshot 2025-08-28 at 12 53 11 PM" src="https://github.com/user-attachments/assets/f661892d-dfb4-42fb-b0d1-d5380fab5938" /> <img width="500" alt="image" src="https://github.com/user-attachments/assets/e4f91f9c-e542-4e02-9d58-44a2988e9300" /> --- **After:** <img width="500" alt="Screenshot 2025-08-28 at 5 51 11 PM" src="https://github.com/user-attachments/assets/ef0e9fa6-1b4b-49f8-a673-e672dfe06cfe" /> <img width="500" alt="image" src="https://github.com/user-attachments/assets/e1c23e85-2cd5-4f7a-908c-00b960ec6994" /> _PS: No changes have been made for the light theme_
1 parent de3d1f4 commit 579ed31

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

src/_sass/components/_icons.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.theme-icon {
2+
@at-root body.dark-mode & {
3+
filter: invert(1) brightness(0.8);
4+
}
5+
}

src/_sass/site.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
@use 'components/expansion-list';
2424
@use 'components/footer';
2525
@use 'components/header';
26+
@use 'components/icons';
2627
@use 'components/misc';
2728
@use 'components/next-prev-nav';
2829
@use 'components/os-selector';

src/content/tools/devtools/inspector.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,35 +41,35 @@ The following is a guide to the features available in the
4141
inspector's toolbar. When space is limited, the icon is
4242
used as the visual version of the label.
4343

44-
![Select widget mode button](/assets/images/docs/tools/devtools/select-widget-mode-button.png){:width="20px"}
44+
![Select widget mode button](/assets/images/docs/tools/devtools/select-widget-mode-button.png)
4545
**Select widget mode**
4646
: Enable this button in order to select
4747
a widget on the device to inspect it. To learn more,
4848
check out [Inspecting a widget](#inspecting-a-widget).
4949

50-
![Show implementation widgets button](/assets/images/docs/tools/devtools/show-implementation-widgets-button.png){:width="20px"}
50+
![Show implementation widgets button](/assets/images/docs/tools/devtools/show-implementation-widgets-button.png)
5151
**Show implementation widgets**
5252
: Enable this button in to show implementation widgets in the widget tree. To learn more,
5353
check out [Use the Widget Tree](#use-the-widget-tree).
5454

55-
![Refresh tree icon](/assets/images/docs/tools/devtools/refresh-tree-icon.png){:width="20px"} **Refresh tree**
55+
![Refresh tree icon](/assets/images/docs/tools/devtools/refresh-tree-icon.png){:.theme-icon width="20px"} **Refresh tree**
5656
: Reload the current widget info.
5757

58-
![Slow animations icon](/assets/images/docs/tools/devtools/slow-animations-icon.png){:width="20px"} **[Slow animations][]**
58+
![Slow animations icon](/assets/images/docs/tools/devtools/slow-animations-icon.png){:.theme-icon width="20px"} **[Slow animations][]**
5959
: Run animations 5 times slower to help fine-tune them.
6060

61-
![Show guidelines mode icon](/assets/images/docs/tools/devtools/debug-paint-mode-icon.png){:width="20px"} **[Show guidelines][]**
61+
![Show guidelines mode icon](/assets/images/docs/tools/devtools/debug-paint-mode-icon.png){:.theme-icon width="20px"} **[Show guidelines][]**
6262
: Overlay guidelines to assist with fixing layout issues.
6363

64-
![Show baselines icon](/assets/images/docs/tools/devtools/paint-baselines-icon.png){:width="20px"} **[Show baselines][]**
64+
![Show baselines icon](/assets/images/docs/tools/devtools/paint-baselines-icon.png){:.theme-icon width="20px"} **[Show baselines][]**
6565
: Show baselines, which are used for aligning text.
6666
Can be useful for checking if text is aligned.
6767

68-
![Highlight repaints icon](/assets/images/docs/tools/devtools/repaint-rainbow-icon.png){:width="20px"} **[Highlight repaints][]**
68+
![Highlight repaints icon](/assets/images/docs/tools/devtools/repaint-rainbow-icon.png){:.theme-icon width="20px"} **[Highlight repaints][]**
6969
: Show borders that change color when elements repaint.
7070
Useful for finding unnecessary repaints.
7171

72-
![Highlight oversized images icon](/assets/images/docs/tools/devtools/invert_oversized_images_icon.png){:width="20px"} **[Highlight oversized images][]**
72+
![Highlight oversized images icon](/assets/images/docs/tools/devtools/invert_oversized_images_icon.png){:.theme-icon width="20px"} **[Highlight oversized images][]**
7373
: Highlights images that are using too much memory
7474
by inverting colors and flipping them.
7575

src/content/tools/vs-code.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,13 @@ several additional debugging commands are added to the
267267
When space is limited, the icon is used as the visual
268268
version of the label.
269269

270-
**Toggle Baseline Painting** ![Baseline painting icon](/assets/images/docs/tools/devtools/paint-baselines-icon.png){:width="20px"}
270+
**Toggle Baseline Painting** ![Baseline painting icon](/assets/images/docs/tools/devtools/paint-baselines-icon.png){:.theme-icon width="20px"}
271271
: Causes each RenderBox to paint a line at each of its baselines.
272272

273-
**Toggle Repaint Rainbow** ![Repaint rainbow icon](/assets/images/docs/tools/devtools/repaint-rainbow-icon.png){:width="20px"}
273+
**Toggle Repaint Rainbow** ![Repaint rainbow icon](/assets/images/docs/tools/devtools/repaint-rainbow-icon.png){:.theme-icon width="20px"}
274274
: Shows rotating colors on layers when repainting.
275275

276-
**Toggle Slow Animations** ![Slow animations icon](/assets/images/docs/tools/devtools/slow-animations-icon.png){:width="20px"}
276+
**Toggle Slow Animations** ![Slow animations icon](/assets/images/docs/tools/devtools/slow-animations-icon.png){:.theme-icon width="20px"}
277277
: Slows down animations to enable visual inspection.
278278

279279
**Toggle Debug Mode Banner** ![Debug mode banner icon](/assets/images/docs/tools/devtools/debug-mode-banner-icon.png){:width="20px"}

0 commit comments

Comments
 (0)