Skip to content

fix(plugins): render inspector fact cards and chips using os-icon inside shadow DOM - #1057

Merged
epeicher merged 2 commits into
WordPress:trunkfrom
KarunyaChavan:fix/plugins-inspector-shadow-icons
Oct 30, 2026
Merged

epeicher merged 2 commits into
WordPress:trunkfrom
KarunyaChavan:fix/plugins-inspector-shadow-icons

Conversation

@KarunyaChavan

@KarunyaChavan KarunyaChavan commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

The plugin details inspector lives inside a Shadow DOM, which isolates it from WordPress's global Dashicons stylesheet. As a result, icons created using standard Dashicons spans were invisible because their :before pseudo-element styles were not available inside the shadow root.

Closes #1056

This PR replaces those spans with the <os-icon> web component, which renders the Dashicons glyph directly as text. This ensures icons display correctly inside the inspector.

Before After
Before: Inspector icons not rendering After: Inspector icons rendering correctly

What Changed

  • Fact cards and chips: Added a reusable detailIcon() helper and migrated fact card icons, status chips, and the hero fallback icon to <os-icon>.
  • Styling: Updated the relevant CSS selectors to support <os-icon> while maintaining backward compatibility with existing Dashicons elements.
  • Tests: Added unit test coverage to verify that fact card icons, status chip icons, and the hero fallback icon render correctly inside the inspector's shadow root, with the expected sizes.

Steps to Test

  1. Launch OpenStation and open the Plugins app.
  2. In the Installed view, click Details on any plugin, such as Akismet or Create Block Theme.
  3. Open the Details tab and verify that icons appear beside the fact cards, including Version, Plugin file, and Size on disk.
  4. Open the Overview tab and verify that requirement and status chips display their leading icons.
  5. Check a plugin without a custom icon and verify that the hero tile displays the admin-plugins fallback icon.

Use of AI

AI Used: Yes
Tool: Antigravity
Model: Gemini 3.8 Flash
Used For: Confirming the root cause and adding tests for the updated patch

Open WordPress Playground Preview

- Replace bare Dashicons spans with <os-icon> in fact cards, hero status chips, and the fallback icon.
- Add os-icon selectors alongside .dashicons in styles.ts to ensure proper sizing and color.
- Fix blank icons caused by global dashicons.min.css stylesheets being inaccessible inside the inspector's shadow DOM.
- Add unit tests to verify that icons inside the plugin inspector's shadow DOM render using <os-icon>.
- Verify that fact card icons for tag and media-document render with the expected size attributes.
- Verify that hero status chip icons for wordpress render with the expected size attributes.
- Verify that the hero fallback icon for admin-plugins renders with the expected size attributes.
- Ensure icon rendering is consistent across fact cards, hero status chips, and the hero fallback UI.
@KarunyaChavan
KarunyaChavan marked this pull request as ready for review October 28, 2026 12:17

@epeicher epeicher left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @KarunyaChavan for fixing this! I have reviewed and tested the changes and they LGTM!

@epeicher
epeicher merged commit 8e5da0d into WordPress:trunk Oct 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugins App: Dashicons fail to render inside the plugin inspector shadow root

2 participants