mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
fix(input-number): the number input radius style in different size (#43875)
* fix: the number input radius style in different size * fix: make style token as a function --------- Co-authored-by: yee.wang <yee.wang@lazada.com> Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
parent
41d0a775c1
commit
59342fbfb9
@ -40,6 +40,27 @@ export interface ComponentToken {
|
||||
|
||||
type InputNumberToken = InputToken<FullToken<'InputNumber'>>;
|
||||
|
||||
export const genRadiusStyle = (
|
||||
{ componentCls, borderRadiusSM, borderRadiusLG }: InputNumberToken,
|
||||
size: 'lg' | 'sm',
|
||||
) => {
|
||||
const borderRadius = size === 'lg' ? borderRadiusLG : borderRadiusSM;
|
||||
return {
|
||||
[`&-${size}`]: {
|
||||
[`${componentCls}-handler-wrap`]: {
|
||||
borderStartEndRadius: borderRadius,
|
||||
borderEndEndRadius: borderRadius,
|
||||
},
|
||||
[`${componentCls}-handler-up`]: {
|
||||
borderStartEndRadius: borderRadius,
|
||||
},
|
||||
[`${componentCls}-handler-down`]: {
|
||||
borderEndEndRadius: borderRadius,
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const genInputNumberStyles: GenerateStyle<InputNumberToken> = (token: InputNumberToken) => {
|
||||
const {
|
||||
componentCls,
|
||||
@ -275,6 +296,9 @@ const genInputNumberStyles: GenerateStyle<InputNumberToken> = (token: InputNumbe
|
||||
borderEndEndRadius: borderRadius,
|
||||
},
|
||||
|
||||
...genRadiusStyle(token, 'lg'),
|
||||
...genRadiusStyle(token, 'sm'),
|
||||
|
||||
// Disabled
|
||||
'&-disabled, &-readonly': {
|
||||
[`${componentCls}-handler-wrap`]: {
|
||||
|
Loading…
Reference in New Issue
Block a user