From b4a90c157c2329eba15e0468968b2a0bbeb592e1 Mon Sep 17 00:00:00 2001 From: Gregory Douglas Date: Thu, 22 Aug 2024 23:41:52 -0400 Subject: [PATCH 1/7] Prevent dialog from overriding icon intent color --- packages/core/src/components/dialog/_dialog.scss | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/core/src/components/dialog/_dialog.scss b/packages/core/src/components/dialog/_dialog.scss index 5372a11de2..6d86319461 100644 --- a/packages/core/src/components/dialog/_dialog.scss +++ b/packages/core/src/components/dialog/_dialog.scss @@ -110,6 +110,12 @@ $dialog-header-padding: math.div($pt-grid-size, 2); flex: 0 0 auto; margin-left: -3px; margin-right: $dialog-padding * 0.5; + + @each $intent, $color in $pt-intent-colors { + &.#{$ns}-intent-#{$intent} { + color: $color; + } + } } .#{$ns}-heading { @@ -130,6 +136,12 @@ $dialog-header-padding: math.div($pt-grid-size, 2); .#{$ns}-icon-large, .#{$ns}-icon { color: $pt-dark-icon-color; + + @each $intent, $color in $pt-intent-colors { + &.#{$ns}-intent-#{$intent} { + color: $color; + } + } } } From 95830140849748801ad91e90750b54bd451f64a7 Mon Sep 17 00:00:00 2001 From: Gregory Douglas Date: Fri, 23 Aug 2024 00:01:32 -0400 Subject: [PATCH 2/7] Update dialog example to include icon with intent --- .../src/examples/core-examples/dialogExample.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/docs-app/src/examples/core-examples/dialogExample.tsx b/packages/docs-app/src/examples/core-examples/dialogExample.tsx index 2c5d829fad..0e046bbf4f 100644 --- a/packages/docs-app/src/examples/core-examples/dialogExample.tsx +++ b/packages/docs-app/src/examples/core-examples/dialogExample.tsx @@ -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"; @@ -75,7 +78,7 @@ export class DialogExample extends React.PureComponent } title="Palantir Foundry" buttonText="Show dialog with title" footerStyle="none" @@ -83,7 +86,7 @@ export class DialogExample extends React.PureComponent Date: Fri, 23 Aug 2024 10:27:33 -0400 Subject: [PATCH 3/7] Use intent text colors for dark mode --- packages/core/src/components/dialog/_dialog.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/components/dialog/_dialog.scss b/packages/core/src/components/dialog/_dialog.scss index 6d86319461..3a91611fbe 100644 --- a/packages/core/src/components/dialog/_dialog.scss +++ b/packages/core/src/components/dialog/_dialog.scss @@ -137,7 +137,7 @@ $dialog-header-padding: math.div($pt-grid-size, 2); .#{$ns}-icon { color: $pt-dark-icon-color; - @each $intent, $color in $pt-intent-colors { + @each $intent, $color in $pt-dark-intent-text-colors { &.#{$ns}-intent-#{$intent} { color: $color; } From fb4b7ce606f764b92be9c9ac66ce3c0e32b47b65 Mon Sep 17 00:00:00 2001 From: svc-changelog Date: Fri, 23 Aug 2024 14:30:00 +0000 Subject: [PATCH 4/7] Add generated changelog entries --- packages/core/changelog/@unreleased/pr-6947.v2.yml | 5 +++++ packages/docs-app/changelog/@unreleased/pr-6947.v2.yml | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 packages/core/changelog/@unreleased/pr-6947.v2.yml create mode 100644 packages/docs-app/changelog/@unreleased/pr-6947.v2.yml diff --git a/packages/core/changelog/@unreleased/pr-6947.v2.yml b/packages/core/changelog/@unreleased/pr-6947.v2.yml new file mode 100644 index 0000000000..49b5f4f1d5 --- /dev/null +++ b/packages/core/changelog/@unreleased/pr-6947.v2.yml @@ -0,0 +1,5 @@ +type: fix +fix: + description: Respect icon intent color passed to Dialog + links: + - https://github.com/palantir/blueprint/pull/6947 diff --git a/packages/docs-app/changelog/@unreleased/pr-6947.v2.yml b/packages/docs-app/changelog/@unreleased/pr-6947.v2.yml new file mode 100644 index 0000000000..49b5f4f1d5 --- /dev/null +++ b/packages/docs-app/changelog/@unreleased/pr-6947.v2.yml @@ -0,0 +1,5 @@ +type: fix +fix: + description: Respect icon intent color passed to Dialog + links: + - https://github.com/palantir/blueprint/pull/6947 From 48ecd122255085690d8e36e999334a4eb7c25c97 Mon Sep 17 00:00:00 2001 From: Gregory Douglas Date: Fri, 23 Aug 2024 11:28:22 -0400 Subject: [PATCH 5/7] Use qualified selector to omit icons with intent from coloring --- .../core/src/components/dialog/_dialog.scss | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/core/src/components/dialog/_dialog.scss b/packages/core/src/components/dialog/_dialog.scss index 3a91611fbe..487741376f 100644 --- a/packages/core/src/components/dialog/_dialog.scss +++ b/packages/core/src/components/dialog/_dialog.scss @@ -106,14 +106,15 @@ $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; - @each $intent, $color in $pt-intent-colors { - &.#{$ns}-intent-#{$intent} { - color: $color; + // only apply light color to icons that are not intent-specific + .#{$ns}-icon:not([class*="#{$ns}-intent"]) { + &.#{$ns}-icon-large, + &.#{$ns}-icon { + color: $pt-icon-color; } } } @@ -133,14 +134,11 @@ $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; - - @each $intent, $color in $pt-dark-intent-text-colors { - &.#{$ns}-intent-#{$intent} { - color: $color; - } + // only apply dark color to icons that are not intent-specific + .#{$ns}-icon:not([class*="#{$ns}-intent"]) { + &.#{$ns}-icon-large, + &.#{$ns}-icon { + color: $pt-dark-icon-color; } } } From 3f710af985ab56268b3e61c6d3a0bb9e0baad5a3 Mon Sep 17 00:00:00 2001 From: Gregory Douglas Date: Fri, 23 Aug 2024 16:15:26 -0400 Subject: [PATCH 6/7] Remove unnecessary prefixed icon class --- packages/core/src/components/dialog/_dialog.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/components/dialog/_dialog.scss b/packages/core/src/components/dialog/_dialog.scss index 487741376f..c61b5b58db 100644 --- a/packages/core/src/components/dialog/_dialog.scss +++ b/packages/core/src/components/dialog/_dialog.scss @@ -111,7 +111,7 @@ $dialog-header-padding: math.div($pt-grid-size, 2); margin-right: $dialog-padding * 0.5; // only apply light color to icons that are not intent-specific - .#{$ns}-icon:not([class*="#{$ns}-intent"]) { + :not([class*="#{$ns}-intent"]) { &.#{$ns}-icon-large, &.#{$ns}-icon { color: $pt-icon-color; @@ -135,7 +135,7 @@ $dialog-header-padding: math.div($pt-grid-size, 2); box-shadow: inset 0 0 0 1px $pt-dark-divider-white; // only apply dark color to icons that are not intent-specific - .#{$ns}-icon:not([class*="#{$ns}-intent"]) { + :not([class*="#{$ns}-intent"]) { &.#{$ns}-icon-large, &.#{$ns}-icon { color: $pt-dark-icon-color; From 2d4ae487a3c6b54ca4894576e91b34a0218c39b0 Mon Sep 17 00:00:00 2001 From: Greg Douglas Date: Sat, 24 Aug 2024 17:33:45 -0400 Subject: [PATCH 7/7] Remove more duplicate nested classes --- packages/core/src/components/dialog/_dialog.scss | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/core/src/components/dialog/_dialog.scss b/packages/core/src/components/dialog/_dialog.scss index c61b5b58db..d9d77372ff 100644 --- a/packages/core/src/components/dialog/_dialog.scss +++ b/packages/core/src/components/dialog/_dialog.scss @@ -111,11 +111,8 @@ $dialog-header-padding: math.div($pt-grid-size, 2); 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; - } + &:not([class*="#{$ns}-intent"]) { + color: $pt-icon-color; } }