mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 09:26:06 +08:00
chore: set default value for style (#38689)
* fix: set default value for style * Update components/tooltip/util.ts Co-authored-by: afc163 <afc163@gmail.com> Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
parent
4f3b257521
commit
9dc33bda54
@ -11,13 +11,13 @@ export function parseColor(prefixCls: string, color?: string) {
|
|||||||
[`${prefixCls}-${color}`]: color && PresetColorRegex.test(color),
|
[`${prefixCls}-${color}`]: color && PresetColorRegex.test(color),
|
||||||
});
|
});
|
||||||
|
|
||||||
let overlayStyle: React.CSSProperties | undefined;
|
const overlayStyle: React.CSSProperties = {};
|
||||||
let arrowStyle: React.CSSProperties | undefined;
|
const arrowStyle: React.CSSProperties = {};
|
||||||
|
|
||||||
if (color && !PresetColorRegex.test(color)) {
|
if (color && !PresetColorRegex.test(color)) {
|
||||||
overlayStyle = { background: color };
|
overlayStyle.background = color;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
arrowStyle = { '--antd-arrow-background-color': color };
|
arrowStyle['--antd-arrow-background-color'] = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
return { className, overlayStyle, arrowStyle };
|
return { className, overlayStyle, arrowStyle };
|
||||||
|
Loading…
Reference in New Issue
Block a user