Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Respect icon intent color passed to Dialog #6947

Merged
merged 7 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/core/changelog/@unreleased/pr-6947.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: fix
fix:
description: Respect icon intent color passed to Dialog
links:
- https://github.com/palantir/blueprint/pull/6947
18 changes: 14 additions & 4 deletions packages/core/src/components/dialog/_dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,17 @@ $dialog-header-padding: math.div($pt-grid-size, 2);

.#{$ns}-icon-large,
.#{$ns}-icon {
color: $pt-icon-color;
flex: 0 0 auto;
margin-left: -3px;
margin-right: $dialog-padding * 0.5;

// only apply light color to icons that are not intent-specific
:not([class*="#{$ns}-intent"]) {
&.#{$ns}-icon-large,
&.#{$ns}-icon {
color: $pt-icon-color;
}
}
}

.#{$ns}-heading {
Expand All @@ -127,9 +134,12 @@ $dialog-header-padding: math.div($pt-grid-size, 2);
background: $dark-gray3;
box-shadow: inset 0 0 0 1px $pt-dark-divider-white;

.#{$ns}-icon-large,
.#{$ns}-icon {
color: $pt-dark-icon-color;
// only apply dark color to icons that are not intent-specific
:not([class*="#{$ns}-intent"]) {
&.#{$ns}-icon-large,
&.#{$ns}-icon {
color: $pt-dark-icon-color;
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions packages/docs-app/changelog/@unreleased/pr-6947.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: fix
fix:
description: Respect icon intent color passed to Dialog
links:
- https://github.com/palantir/blueprint/pull/6947
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ import {
DialogFooter,
type DialogProps,
H5,
Icon,
Intent,
Switch,
Tooltip,
} from "@blueprintjs/core";
import { Example, type ExampleProps, handleBooleanChange } from "@blueprintjs/docs-theme";
import { IconNames } from "@blueprintjs/icons";

import type { BlueprintExampleData } from "../../tags/types";

Expand Down Expand Up @@ -75,23 +78,23 @@ export class DialogExample extends React.PureComponent<ExampleProps<BlueprintExa
/>
<ButtonWithDialog
className={this.props.data.themeName}
icon="info-sign"
icon={<Icon icon={IconNames.INFO_SIGN} intent={Intent.PRIMARY} />}
title="Palantir Foundry"
buttonText="Show dialog with title"
footerStyle="none"
{...this.state}
/>
<ButtonWithDialog
className={this.props.data.themeName}
icon="info-sign"
icon={IconNames.INFO_SIGN}
title="Palantir Foundry"
buttonText="Show dialog with title and footer"
footerStyle="default"
{...this.state}
/>
<ButtonWithDialog
className={this.props.data.themeName}
icon="info-sign"
icon={IconNames.INFO_SIGN}
title="Palantir Foundry"
buttonText="Show dialog with title and minimal footer"
footerStyle="minimal"
Expand Down