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(button): ignore fill="none" paths on icon svgs #8585

Merged
Merged
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
2 changes: 1 addition & 1 deletion packages/components/src/components/button/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@

.#{$prefix}--btn--ghost.#{$prefix}--btn--icon-only
.#{$prefix}--btn__icon
path:not([data-icon-path]),
path:not([data-icon-path]):not([fill='none']),
.#{$prefix}--btn--ghost.#{$prefix}--btn--icon-only .#{$prefix}--btn__icon {
fill: $icon-primary;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/button/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
}

.#{$prefix}--btn__icon,
.#{$prefix}--btn__icon path:not([data-icon-path]) {
.#{$prefix}--btn__icon path:not([data-icon-path]):not([fill='none']) {
fill: $icon-color;
}
}
Expand Down
14 changes: 13 additions & 1 deletion packages/react/src/components/Button/Button-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ import React from 'react';
import { action } from '@storybook/addon-actions';
import { withKnobs, boolean, select, text } from '@storybook/addon-knobs';
import { iconAddSolid, iconSearch } from 'carbon-icons';
import { Add16, AddFilled16, Search16 } from '@carbon/icons-react';
import {
Add16,
AddFilled16,
Search16,
PlayOutlineFilled32,
PlayOutlineFilled16,
} from '@carbon/icons-react';
import Button from '../Button';
import ButtonSkeleton from '../Button/Button.Skeleton';
import ButtonSet from '../ButtonSet';
Expand All @@ -20,6 +26,10 @@ const icons = {
'Add (Add16 from `@carbon/icons-react`)': 'Add16',
'Add (Filled) (AddFilled16 from `@carbon/icons-react`)': 'AddFilled16',
'Search (Search16 from `@carbon/icons-react`)': 'Search16',
'PlayOutlineFilled16 (PlayOutlineFilled16 from `@carbon/icons-react`)':
'PlayOutlineFilled16',
'PlayOutlineFilled32 (PlayOutlineFilled32 from `@carbon/icons-react`)':
'PlayOutlineFilled32',
};

const iconMap = {
Expand All @@ -28,6 +38,8 @@ const iconMap = {
Add16,
AddFilled16,
Search16,
PlayOutlineFilled16,
PlayOutlineFilled32,
};

const kinds = {
Expand Down