Skip to content

Commit

Permalink
fix: tree switch bg height (ant-design#50313)
Browse files Browse the repository at this point in the history
* fix: tree switch bg height

* fix: use before instead
  • Loading branch information
zombieJ authored and linxianxi committed Aug 14, 2024
1 parent faf03e6 commit 40891e0
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions components/tree/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,27 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject =>
cursor: 'pointer',
userSelect: 'none',
transition: `all ${token.motionDurationSlow}`,
borderRadius: token.borderRadius,

'&-noop': {
cursor: 'unset',
},

[`&:not(${treeCls}-switcher-noop):hover`]: {
'&:before': {
pointerEvents: 'none',
content: '""',
width: titleHeight,
height: titleHeight,
position: 'absolute',
left: {
_skip_check_: true,
value: 0,
},
top: 0,
borderRadius: token.borderRadius,
transition: `all ${token.motionDurationSlow}`,
},

[`&:not(${treeCls}-switcher-noop):hover:before`]: {
backgroundColor: token.colorBgTextHover,
},

Expand Down

0 comments on commit 40891e0

Please sign in to comment.