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

[Core] Fixed not applying intent color for icon inside menu component #3597

Closed
Show file tree
Hide file tree
Changes from all 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
18 changes: 18 additions & 0 deletions packages/core/src/components/menu/_menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ Styleguide menu
@include menu-item();
@include menu-item-intent();

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

&::before {
// support pt-icon-* classes directly on this element
@include pt-icon();
Expand Down Expand Up @@ -153,6 +162,15 @@ Styleguide menu-header
.#{$ns}-menu-item {
@include menu-item-intent($pt-dark-intent-text-colors);

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

&::before,
> .#{$ns}-icon {
color: $pt-dark-icon-color;
Expand Down
4 changes: 2 additions & 2 deletions packages/docs-app/src/examples/core-examples/menuExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import * as React from "react";

import { Classes, Icon, Menu, MenuDivider, MenuItem } from "@blueprintjs/core";
import { Classes, Icon, Intent, Menu, MenuDivider, MenuItem } from '@blueprintjs/core'
import { Example, IExampleProps } from "@blueprintjs/docs-theme";

export class MenuExample extends React.PureComponent<IExampleProps, {}> {
Expand All @@ -30,7 +30,7 @@ export class MenuExample extends React.PureComponent<IExampleProps, {}> {
<MenuItem icon="new-object" text="New object" />
<MenuItem icon="new-link" text="New link" />
<MenuDivider />
<MenuItem icon="cog" labelElement={<Icon icon="share" />} text="Settings..." />
<MenuItem icon={<Icon icon="cog" intent={Intent.PRIMARY} />} labelElement={<Icon icon="share" />} text="Settings..." />
</Menu>
<Menu className={Classes.ELEVATION_1}>
<MenuDivider title="Edit" />
Expand Down