Skip to content

Commit

Permalink
fix(button): ensure icons with multiple paths render properly (#6230)
Browse files Browse the repository at this point in the history
* fix(button): ensure icons with multiple paths render properly

* fix(button): target inner path directly

Co-authored-by: Josh Black <josh@josh.black>
  • Loading branch information
tw15egan and joshblack authored Jun 18, 2020
1 parent aaf3766 commit c84041f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/components/src/components/button/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@
}
}

.#{$prefix}--btn path[data-icon-path='inner-path'] {
fill: none;
}

.#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--btn--ghost
.#{$prefix}--btn__icon,
.#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--btn--ghost:hover
Expand Down
4 changes: 3 additions & 1 deletion packages/react/src/components/Button/Button-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { action } from '@storybook/addon-actions';
import { withKnobs, boolean, select, text } from '@storybook/addon-knobs';
import { settings } from 'carbon-components';
import { iconAddSolid, iconSearch } from 'carbon-icons';
import { Add16, Search16 } from '@carbon/icons-react';
import { Add16, AddFilled16, Search16 } from '@carbon/icons-react';
import Button from '../Button';
import ButtonSkeleton from '../Button/Button.Skeleton';

Expand All @@ -20,13 +20,15 @@ const { prefix } = settings;
const icons = {
None: 'None',
'Add (Add16 from `@carbon/icons-react`)': 'Add16',
'Add (Filled) (AddFilled16 from `@carbon/icons-react`)': 'AddFilled16',
'Search (Search16 from `@carbon/icons-react`)': 'Search16',
};

const iconMap = {
iconAddSolid,
iconSearch,
Add16,
AddFilled16,
Search16,
};

Expand Down

0 comments on commit c84041f

Please sign in to comment.