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: <Icon component /> remove fill="currentColor" #670

Merged
merged 9 commits into from
Sep 15, 2024
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
8 changes: 4 additions & 4 deletions packages/icons-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@
"glob": "^7.1.6",
"history": "^4.9.0",
"lodash": "^4.17.21",
"mobx": "^5.1.0",
"mobx-react": "^6.1.3",
"pkg-dir": "4.0.0",
"prettier": "^2.2.1",
"rc-test": "^7.0.15",
Expand All @@ -75,12 +73,14 @@
"react": ">=16.0.0",
"react-dom": ">=16.0.0"
},
"resolutions": {
"cheerio": "1.0.0-rc.12"
},
"engines": {
"node": ">=8"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
},
"gitHead": "225d4d2189720ee3b7e4a4d7a6d80e076fa15cbc"
}
}
2 changes: 1 addition & 1 deletion packages/icons-react/src/components/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface IconBaseProps extends React.HTMLProps<HTMLSpanElement> {
export interface CustomIconComponentProps {
width: string | number;
height: string | number;
fill: string;
fill?: string;
viewBox?: string;
className?: string;
style?: React.CSSProperties;
Expand Down
1 change: 0 additions & 1 deletion packages/icons-react/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export function normalizeTwoToneColors(
export const svgBaseProps = {
width: '1em',
height: '1em',
fill: 'currentColor',
'aria-hidden': 'true',
focusable: 'false',
};
Expand Down
29 changes: 0 additions & 29 deletions packages/icons-react/tests/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ exports[`Icon \`component\` prop can access to svg defs if has children 1`] = `
<svg
aria-hidden="true"
class=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand Down Expand Up @@ -583,15 +582,13 @@ exports[`Icon should support event listeners 2`] = `
<SvgComponent
aria-hidden="true"
className=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
>
<svg
aria-hidden="true"
className=""
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 24 24"
Expand Down Expand Up @@ -628,15 +625,13 @@ exports[`Icon should support event listeners 3`] = `
<SvgComponent
aria-hidden="true"
className=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
>
<svg
aria-hidden="true"
className=""
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 24 24"
Expand Down Expand Up @@ -672,7 +667,6 @@ exports[`Icon should support event listeners when passing svg paths as children
<svg
aria-hidden="true"
className=""
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 24 24"
Expand All @@ -697,7 +691,6 @@ exports[`Icon should support pass svg paths as children 1`] = `
<svg
aria-hidden="true"
class=""
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 24 24"
Expand All @@ -721,7 +714,6 @@ exports[`Icon should support svg react component 1`] = `
<svg
aria-hidden="true"
class=""
fill="currentColor"
focusable="false"
height="1em"
viewBox="0 0 24 24"
Expand Down Expand Up @@ -824,7 +816,6 @@ exports[`Icon.createFromIconfontCN() extraCommonProps should works fine and can
<svg
aria-hidden="true"
class=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand All @@ -841,7 +832,6 @@ exports[`Icon.createFromIconfontCN() extraCommonProps should works fine and can
<svg
aria-hidden="true"
class=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand All @@ -858,7 +848,6 @@ exports[`Icon.createFromIconfontCN() extraCommonProps should works fine and can
<svg
aria-hidden="true"
class=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand Down Expand Up @@ -890,7 +879,6 @@ exports[`Icon.createFromIconfontCN() should support event listeners 1`] = `
<svg
aria-hidden="true"
className=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand All @@ -915,7 +903,6 @@ exports[`Icon.createFromIconfontCN() should support event listeners 1`] = `
<svg
aria-hidden="true"
className=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand Down Expand Up @@ -943,7 +930,6 @@ exports[`Icon.createFromIconfontCN() should support event listeners 1`] = `
<svg
aria-hidden="true"
className=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand Down Expand Up @@ -973,7 +959,6 @@ exports[`Icon.createFromIconfontCN() should support event listeners 1`] = `
<svg
aria-hidden="true"
className="anticon-spin"
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand All @@ -999,7 +984,6 @@ exports[`Icon.createFromIconfontCN() should support iconfont.cn 1`] = `
<svg
aria-hidden="true"
class=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand All @@ -1016,7 +1000,6 @@ exports[`Icon.createFromIconfontCN() should support iconfont.cn 1`] = `
<svg
aria-hidden="true"
class=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand All @@ -1033,7 +1016,6 @@ exports[`Icon.createFromIconfontCN() should support iconfont.cn 1`] = `
<svg
aria-hidden="true"
class=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand All @@ -1057,7 +1039,6 @@ exports[`Icon.createFromIconfontCN({scriptUrl:[]}) extraCommonProps should works
<svg
aria-hidden="true"
class=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand All @@ -1074,7 +1055,6 @@ exports[`Icon.createFromIconfontCN({scriptUrl:[]}) extraCommonProps should works
<svg
aria-hidden="true"
class=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand All @@ -1091,7 +1071,6 @@ exports[`Icon.createFromIconfontCN({scriptUrl:[]}) extraCommonProps should works
<svg
aria-hidden="true"
class=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand Down Expand Up @@ -1146,7 +1125,6 @@ exports[`Icon.createFromIconfontCN({scriptUrl:[]}) should support event listener
<svg
aria-hidden="true"
className=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand All @@ -1171,7 +1149,6 @@ exports[`Icon.createFromIconfontCN({scriptUrl:[]}) should support event listener
<svg
aria-hidden="true"
className=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand Down Expand Up @@ -1199,7 +1176,6 @@ exports[`Icon.createFromIconfontCN({scriptUrl:[]}) should support event listener
<svg
aria-hidden="true"
className=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand Down Expand Up @@ -1229,7 +1205,6 @@ exports[`Icon.createFromIconfontCN({scriptUrl:[]}) should support event listener
<svg
aria-hidden="true"
className="anticon-spin"
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand All @@ -1255,7 +1230,6 @@ exports[`Icon.createFromIconfontCN({scriptUrl:[]}) should support iconfont.cn 1`
<svg
aria-hidden="true"
class=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand All @@ -1272,7 +1246,6 @@ exports[`Icon.createFromIconfontCN({scriptUrl:[]}) should support iconfont.cn 1`
<svg
aria-hidden="true"
class=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand All @@ -1289,7 +1262,6 @@ exports[`Icon.createFromIconfontCN({scriptUrl:[]}) should support iconfont.cn 1`
<svg
aria-hidden="true"
class=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand All @@ -1310,7 +1282,6 @@ exports[`Icon.createFromIconfontCN({scriptUrl:[]}) should support ignore load er
<svg
aria-hidden="true"
class=""
fill="currentColor"
focusable="false"
height="1em"
width="1em"
Expand Down
File renamed without changes.