Skip to content

fix(alert): support static icon elements with correct intent and spacing#8069

Open
ggdouglas wants to merge 1 commit intodevelopfrom
gd/alert-static-icon-styling
Open

fix(alert): support static icon elements with correct intent and spacing#8069
ggdouglas wants to merge 1 commit intodevelopfrom
gd/alert-static-icon-styling

Conversation

@ggdouglas
Copy link
Copy Markdown
Contributor

@ggdouglas ggdouglas commented Apr 17, 2026

Summary

Element icons passed to <Alert icon={...}> were losing their intent color and alert-body spacing. Wrap element icons in a <span class="bp6-icon bp6-intent-*"> to preserve intent. Changes the .bp6-alert-body .bp6-icon selector to a direct-child selector to avoid double-applying margins when element icons render nested bp6-icon spans, and adds display: flex to the wrapper.

This was discovered during research on #8065

Code

import { Alert, Intent } from "@blueprintjs/core";

// dynamic
<Alert icon="trash" intent={Intent.DANGER} isOpen={true}>
    Are you sure you want to delete this item?
</Alert>
import { Alert, Intent } from "@blueprintjs/core";
import { Trash } from "@blueprintjs/icons";

// static
<Alert icon={<Trash />} intent={Intent.DANGER} isOpen={true}>
    Are you sure you want to delete this item?
</Alert>

Screenshots

Before After
alert-before alert-after

Diff

alert-diff

@changelog-app
Copy link
Copy Markdown

changelog-app Bot commented Apr 17, 2026

Generate changelog in packages/core/changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

fix(alert): support static icon elements with correct intent and spacing

Check the box to generate changelog(s)

  • Generate changelog entry

@changelog-app
Copy link
Copy Markdown

changelog-app Bot commented Apr 17, 2026

Successfully generated changelog entry!

Need to regenerate?

Simply interact with the changelog bot comment again to regenerate these entries.


📋Changelog Preview

🐛 Fixes

  • fix(alert): support static icon elements with correct intent and spacing (#8069)

@blueprint-previews
Copy link
Copy Markdown

fix(alert): support static icon elements with correct intent and spacing

Build artifact links for this commit: documentation | landing | table | demo | storybook

This is an automated comment from the deploy-preview CircleCI job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant