Skip to content

Commit

Permalink
[Core] Fixed not applying intent color for icon inside tree node (#3355)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacek Jagiełło authored and adidahiya committed Feb 25, 2019
1 parent 221926f commit 7816c70
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/core/src/common/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ $pt-dark-intent-text-colors: (
"danger" : $red5,
) !default;

@mixin intent-color($intentName) {
color: map-get($pt-intent-colors, $intentName);
}

@mixin position-all($position, $value) {
position: $position;
top: $value;
Expand Down
6 changes: 6 additions & 0 deletions packages/core/src/components/tree/_tree.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ $tree-icon-spacing: ($tree-row-height - $pt-icon-size-standard) / 2 !default;
.#{$ns}-tree {
#{$icon-classes} {
color: $pt-icon-color;

@each $intent, $colors in $pt-intent-colors {
&.#{$ns}-intent-#{$intent} {
@include intent-color($intent);
}
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/docs-app/src/examples/core-examples/treeExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import * as React from "react";

import { Classes, Icon, ITreeNode, Position, Tooltip, Tree } from "@blueprintjs/core";
import { Classes, Icon, Intent, ITreeNode, Position, Tooltip, Tree } from "@blueprintjs/core";
import { Example, IExampleProps } from "@blueprintjs/docs-theme";

export interface ITreeExampleState {
Expand Down Expand Up @@ -93,7 +93,7 @@ const INITIAL_STATE: ITreeNode[] = [
},
{
id: 3,
icon: "tag",
icon: <Icon icon="tag" intent={Intent.PRIMARY} className={Classes.TREE_NODE_ICON} />,
label: "Organic meditation gluten-free, sriracha VHS drinking vinegar beard man.",
},
{
Expand Down

1 comment on commit 7816c70

@blueprint-bot
Copy link

Choose a reason for hiding this comment

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

[Core] Fixed not applying intent color for icon inside tree node (#3355)

Previews: documentation | landing | table

Please sign in to comment.