mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 05:05:48 +08:00
feat: add input hover and active backgroundColor (#44752)
Co-authored-by: PanYoYo <panyongyong@zuoshouyisheng.com>
This commit is contained in:
parent
09cd55a3f9
commit
1aa7183d68
@ -66,6 +66,16 @@ export interface SharedComponentToken {
|
||||
* @descEN Box-shadow when active in warning status
|
||||
*/
|
||||
warningActiveShadow: string;
|
||||
/**
|
||||
* @desc 输入框hover状态时背景颜色
|
||||
* @descEN Background color when the input box hovers
|
||||
*/
|
||||
hoverBg: string;
|
||||
/**
|
||||
* @desc 输入框激活状态时背景颜色
|
||||
* @descEN Background color when the input box is activated
|
||||
*/
|
||||
activeBg: string;
|
||||
}
|
||||
|
||||
export interface ComponentToken extends SharedComponentToken {}
|
||||
@ -92,12 +102,14 @@ export const genPlaceholderStyle = (color: string): CSSObject => ({
|
||||
|
||||
export const genHoverStyle = (token: InputToken): CSSObject => ({
|
||||
borderColor: token.hoverBorderColor,
|
||||
backgroundColor: token.hoverBg,
|
||||
});
|
||||
|
||||
export const genActiveStyle = (token: InputToken) => ({
|
||||
borderColor: token.activeBorderColor,
|
||||
boxShadow: token.activeShadow,
|
||||
outline: 0,
|
||||
backgroundColor: token.activeBg,
|
||||
});
|
||||
|
||||
export const genDisabledStyle = (token: InputToken): CSSObject => ({
|
||||
@ -201,7 +213,6 @@ export const genBasicInputStyle = (token: InputToken): CSSObject => ({
|
||||
borderRadius: token.borderRadius,
|
||||
transition: `all ${token.motionDurationMid}`,
|
||||
...genPlaceholderStyle(token.colorTextPlaceholder),
|
||||
|
||||
'&:hover': {
|
||||
...genHoverStyle(token),
|
||||
},
|
||||
@ -1048,6 +1059,8 @@ export const initComponentToken = (token: GlobalToken): SharedComponentToken =>
|
||||
activeShadow: `0 0 0 ${controlOutlineWidth}px ${controlOutline}`,
|
||||
errorActiveShadow: `0 0 0 ${controlOutlineWidth}px ${colorErrorOutline}`,
|
||||
warningActiveShadow: `0 0 0 ${controlOutlineWidth}px ${colorWarningOutline}`,
|
||||
hoverBg: 'transparent',
|
||||
activeBg: 'transparent',
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user