mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 20:19:44 +08:00
remove prop 'svgStyle' and i think it's really good
This commit is contained in:
parent
359191abeb
commit
b8b64f92c8
@ -24,8 +24,7 @@ ReactDOM.render(<IconDisplay />, mountNode);
|
||||
| --- | --- | --- | --- |
|
||||
| type | Type of the ant design icon | string | - |
|
||||
| style | Style properties of icon, like `fontSize` and `color` | CSSProperties | - |
|
||||
| theme | Theme of the ant design icon | 'filled' \| 'outlined' \| 'twoTone' | - |
|
||||
| svgStyle | Inline style to apply to the SVG element | CSSProperties | - |
|
||||
| theme | Theme of the ant design icon | 'filled' \| 'outlined' \| 'twoTone' | 'outlined' |
|
||||
| spin | Rotate icon with animation | boolean | false |
|
||||
| component | The component used for the root node. This will override the **`type`** property. | ComponentType<CustomIconComponentProps\> | - |
|
||||
| twoToneColor | Only support the two-tone icon. Specific the primary color. | string (hex color) | - |
|
||||
|
@ -34,8 +34,6 @@ export interface IconProps {
|
||||
viewBox?: string;
|
||||
spin?: boolean;
|
||||
style?: React.CSSProperties;
|
||||
svgStyle?: React.CSSProperties;
|
||||
svgClassName?: string;
|
||||
prefixCls?: string;
|
||||
}
|
||||
|
||||
@ -52,7 +50,6 @@ const Icon: React.SFC<IconProps> = (props) => {
|
||||
component: Component,
|
||||
viewBox,
|
||||
spin,
|
||||
svgStyle = {},
|
||||
|
||||
// children
|
||||
children,
|
||||
@ -81,7 +78,6 @@ const Icon: React.SFC<IconProps> = (props) => {
|
||||
const innerSvgProps: CustomIconComponentProps = {
|
||||
...svgBaseProps,
|
||||
className: svgClassString,
|
||||
style: svgStyle,
|
||||
viewBox,
|
||||
};
|
||||
if (!viewBox) {
|
||||
@ -106,7 +102,6 @@ const Icon: React.SFC<IconProps> = (props) => {
|
||||
const innerSvgProps: CustomIconComponentProps = {
|
||||
...svgBaseProps,
|
||||
className: svgClassString,
|
||||
style: svgStyle,
|
||||
};
|
||||
return (
|
||||
<i className={classString} title={title} style={style} onClick={onClick}>
|
||||
@ -132,7 +127,6 @@ const Icon: React.SFC<IconProps> = (props) => {
|
||||
<ReactIcon
|
||||
className={svgClassString}
|
||||
type={computedType}
|
||||
style={svgStyle}
|
||||
primaryColor={twoToneColor}
|
||||
/>
|
||||
</i>
|
||||
|
@ -29,8 +29,7 @@ ReactDOM.render(<IconDisplay />, mountNode);
|
||||
| --- | --- | --- | --- |
|
||||
| type | 图标类型。遵循图标的命名规范 | string | - |
|
||||
| style | 设置图标的样式,例如 `fontSize` 和 `color` | CSSProperties | - |
|
||||
| theme | 图标主题风格。可选实心、描线、双色等主题风格,适用于官方图标 | 'filled' \| 'outlined' \| 'twoTone' | - |
|
||||
| svgStyle | 设置图标本身`<svg>`标签的样式 | CSSProperties | - |
|
||||
| theme | 图标主题风格。可选实心、描线、双色等主题风格,适用于官方图标 | 'filled' \| 'outlined' \| 'twoTone' | 'outlined' |
|
||||
| spin | 是否有旋转动画 | boolean | false |
|
||||
| component | 控制如何渲染图标,通常是一个渲染根标签为 `<svg>` 的 `React` 组件,**会使 `type` 属性失效** | ComponentType<CustomIconComponentProps\> | - |
|
||||
| twoToneColor | 仅适用双色图标。设置双色图标的主要颜色。 | string (十六进制颜色) | - |
|
||||
|
@ -67,8 +67,7 @@ exports[`Input.Search should support suffix 1`] = `
|
||||
>
|
||||
<IconReact
|
||||
className=""
|
||||
style={Object {}}
|
||||
type="search"
|
||||
type="search-o"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@ -77,7 +76,6 @@ exports[`Input.Search should support suffix 1`] = `
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
key="svg-search"
|
||||
style={Object {}}
|
||||
viewBox="0 0 1024 1024"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
@ -35,8 +35,7 @@ exports[`Search should show cross icon when input value exists 1`] = `
|
||||
>
|
||||
<IconReact
|
||||
className=""
|
||||
style={Object {}}
|
||||
type="search"
|
||||
type="search-o"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@ -45,7 +44,6 @@ exports[`Search should show cross icon when input value exists 1`] = `
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
key="svg-search"
|
||||
style={Object {}}
|
||||
viewBox="0 0 1024 1024"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
@ -100,8 +98,7 @@ exports[`Search should show cross icon when input value exists 2`] = `
|
||||
>
|
||||
<IconReact
|
||||
className=""
|
||||
style={Object {}}
|
||||
type="close-circle"
|
||||
type="close-circle-o"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
@ -110,7 +107,6 @@ exports[`Search should show cross icon when input value exists 2`] = `
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
key="svg-close-circle"
|
||||
style={Object {}}
|
||||
viewBox="0 0 1024 1024"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
Loading…
Reference in New Issue
Block a user