mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
fix: Layout.Sider content overflow when collapsedWidth={0} (#52862)
This commit is contained in:
@@ -56,6 +56,10 @@ const genSiderStyle: GenerateStyle<LayoutToken, CSSObject> = (token) => {
|
||||
},
|
||||
},
|
||||
|
||||
[`&-zero-width ${componentCls}-children`]: {
|
||||
overflow: 'hidden',
|
||||
},
|
||||
|
||||
[`${componentCls}-trigger`]: {
|
||||
position: 'fixed',
|
||||
bottom: 0,
|
||||
@@ -69,44 +73,38 @@ const genSiderStyle: GenerateStyle<LayoutToken, CSSObject> = (token) => {
|
||||
transition: `all ${motionDurationMid}`,
|
||||
},
|
||||
|
||||
[`${componentCls}-zero-width`]: {
|
||||
'> *': {
|
||||
overflow: 'hidden',
|
||||
[`${componentCls}-zero-width-trigger`]: {
|
||||
position: 'absolute',
|
||||
top: headerHeight,
|
||||
insetInlineEnd: token.calc(zeroTriggerWidth).mul(-1).equal(),
|
||||
zIndex: 1,
|
||||
width: zeroTriggerWidth,
|
||||
height: zeroTriggerHeight,
|
||||
color: triggerColor,
|
||||
fontSize: token.fontSizeXL,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
background: siderBg,
|
||||
borderRadius: `0 ${unit(borderRadiusLG)} ${unit(borderRadiusLG)} 0`,
|
||||
cursor: 'pointer',
|
||||
transition: `background ${motionDurationSlow} ease`,
|
||||
|
||||
'&::after': {
|
||||
position: 'absolute',
|
||||
inset: 0,
|
||||
background: 'transparent',
|
||||
transition: `all ${motionDurationSlow}`,
|
||||
content: '""',
|
||||
},
|
||||
|
||||
'&-trigger': {
|
||||
position: 'absolute',
|
||||
top: headerHeight,
|
||||
insetInlineEnd: token.calc(zeroTriggerWidth).mul(-1).equal(),
|
||||
zIndex: 1,
|
||||
width: zeroTriggerWidth,
|
||||
height: zeroTriggerHeight,
|
||||
color: triggerColor,
|
||||
fontSize: token.fontSizeXL,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
background: siderBg,
|
||||
borderRadius: `0 ${unit(borderRadiusLG)} ${unit(borderRadiusLG)} 0`,
|
||||
cursor: 'pointer',
|
||||
transition: `background ${motionDurationSlow} ease`,
|
||||
'&:hover::after': {
|
||||
background: `rgba(255, 255, 255, 0.2)`,
|
||||
},
|
||||
|
||||
'&::after': {
|
||||
position: 'absolute',
|
||||
inset: 0,
|
||||
background: 'transparent',
|
||||
transition: `all ${motionDurationSlow}`,
|
||||
content: '""',
|
||||
},
|
||||
|
||||
'&:hover::after': {
|
||||
background: `rgba(255, 255, 255, 0.2)`,
|
||||
},
|
||||
|
||||
'&-right': {
|
||||
insetInlineStart: token.calc(zeroTriggerWidth).mul(-1).equal(),
|
||||
borderRadius: `${unit(borderRadiusLG)} 0 0 ${unit(borderRadiusLG)}`,
|
||||
},
|
||||
'&-right': {
|
||||
insetInlineStart: token.calc(zeroTriggerWidth).mul(-1).equal(),
|
||||
borderRadius: `${unit(borderRadiusLG)} 0 0 ${unit(borderRadiusLG)}`,
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user