mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 14:13:37 +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),
|
||||
});
|
||||
|
||||
let overlayStyle: React.CSSProperties | undefined;
|
||||
let arrowStyle: React.CSSProperties | undefined;
|
||||
const overlayStyle: React.CSSProperties = {};
|
||||
const arrowStyle: React.CSSProperties = {};
|
||||
|
||||
if (color && !PresetColorRegex.test(color)) {
|
||||
overlayStyle = { background: color };
|
||||
overlayStyle.background = color;
|
||||
// @ts-ignore
|
||||
arrowStyle = { '--antd-arrow-background-color': color };
|
||||
arrowStyle['--antd-arrow-background-color'] = color;
|
||||
}
|
||||
|
||||
return { className, overlayStyle, arrowStyle };
|
||||
|
Loading…
Reference in New Issue
Block a user