Skip to content

Commit

Permalink
fix(button): ignore fill="none" paths on icon svgs (#8585)
Browse files Browse the repository at this point in the history
* fix(button): ignore fill="none" paths on icon svgs

* docs(Button): add temporary icon test

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
emyarod and kodiakhq[bot] authored May 7, 2021
1 parent 56a7430 commit dc447cb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
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

0 comments on commit dc447cb

Please sign in to comment.