Skip to content

Commit

Permalink
fix: form-item line-height (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyunwan authored May 8, 2023
1 parent 967a72f commit 71bc893
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions packages/components/src/form-item/style/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import { getGridStyle } from './grid'
import { genOtherStyle } from './other'

const genSmallStyle: GenerateStyle = (token) => {
const { componentCls, antCls, controlHeightSM, marginLG, fontSizeSM } = token
const {
componentCls,
antCls,
controlHeightSM,
marginLG,
fontSizeSM,
lineHeightSM,
} = token
return {
fontSize: fontSizeSM,
lineHeight: controlHeightSM,
Expand All @@ -20,7 +27,7 @@ const genSmallStyle: GenerateStyle = (token) => {
[`${componentCls}-control-content`]: {
' &-component': {
minHeight: controlHeightSM - 4,
lineHeight: `${controlHeightSM}px`,
lineHeight: lineHeightSM,
},
},

Expand Down Expand Up @@ -147,6 +154,7 @@ const genLargeStyle: GenerateStyle = (token) => {
controlHeightLG,
controlHeightSM,
marginLG,
lineHeightLG,
} = token
return {
fontSize: fontSizeLG,
Expand All @@ -163,7 +171,7 @@ const genLargeStyle: GenerateStyle = (token) => {
[`${componentCls}-control-content`]: {
' &-component': {
minHeight: controlHeightLG - 2,
lineHeight: `${controlHeightLG + 2}px`,
lineHeight: lineHeightLG,
},
},

Expand Down Expand Up @@ -302,8 +310,14 @@ const genLargeStyle: GenerateStyle = (token) => {
}

const genLableStyle: GenerateStyle = (token) => {
const { componentCls, controlHeight, controlHeightSM, marginLG, marginSM } =
token
const {
componentCls,
controlHeight,
controlHeightSM,
marginLG,
marginSM,
lineHeight,
} = token
return {
lineHeight: `${controlHeight}px`,
minHeight: controlHeight - 2,
Expand Down Expand Up @@ -364,7 +378,7 @@ const genLableStyle: GenerateStyle = (token) => {
'&-component': {
width: '100%',
minHeight: controlHeight - 2,
lineHeight: `${controlHeight}px`,
lineHeight: lineHeight,

'&-has-feedback-icon': {
flex: 1,
Expand Down

0 comments on commit 71bc893

Please sign in to comment.