mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 19:19:57 +08:00
fix(Tree): Checkbox and title do not align (#41920)
This commit is contained in:
parent
cdb5968558
commit
40fb753349
@ -63,9 +63,16 @@ type TreeToken = DerivativeToken & {
|
||||
};
|
||||
|
||||
export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject => {
|
||||
const { treeCls, treeNodeCls, treeNodePadding, treeTitleHeight } = token;
|
||||
|
||||
const treeCheckBoxMarginVertical = (treeTitleHeight - token.fontSizeLG) / 2;
|
||||
const {
|
||||
treeCls,
|
||||
treeNodeCls,
|
||||
controlInteractiveSize: checkboxSize,
|
||||
treeNodePadding,
|
||||
treeTitleHeight,
|
||||
} = token;
|
||||
// Ref: https://github.com/ant-design/ant-design/issues/41564
|
||||
const checkBoxOffset = (token.lineHeight * token.fontSize) / 2 - checkboxSize / 2;
|
||||
const treeCheckBoxMarginVertical = (treeTitleHeight - token.fontSizeLG) / 2 - checkBoxOffset;
|
||||
const treeCheckBoxMarginHorizontal = token.paddingXS;
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user