mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
fix: Divider horizontal line align (#39339)
* fix: divider hor align * test: Update snapshot
This commit is contained in:
parent
a2305aa291
commit
37c83beeca
@ -33,6 +33,21 @@ Array [
|
||||
role="separator"
|
||||
style="height:60px;border-color:#7cb305"
|
||||
/>,
|
||||
<div
|
||||
style="display:flex;flex-direction:column;height:50px;box-shadow:0 0 1px red"
|
||||
>
|
||||
<div
|
||||
class="ant-divider ant-divider-horizontal ant-divider-with-text ant-divider-with-text-left"
|
||||
role="separator"
|
||||
style="background:rgba(0,255,0,0.05)"
|
||||
>
|
||||
<span
|
||||
class="ant-divider-inner-text"
|
||||
>
|
||||
Text
|
||||
</span>
|
||||
</div>
|
||||
</div>,
|
||||
]
|
||||
`;
|
||||
|
||||
|
@ -33,6 +33,21 @@ Array [
|
||||
role="separator"
|
||||
style="height:60px;border-color:#7cb305"
|
||||
/>,
|
||||
<div
|
||||
style="display:flex;flex-direction:column;height:50px;box-shadow:0 0 1px red"
|
||||
>
|
||||
<div
|
||||
class="ant-divider ant-divider-horizontal ant-divider-with-text ant-divider-with-text-left"
|
||||
role="separator"
|
||||
style="background:rgba(0,255,0,0.05)"
|
||||
>
|
||||
<span
|
||||
class="ant-divider-inner-text"
|
||||
>
|
||||
Text
|
||||
</span>
|
||||
</div>
|
||||
</div>,
|
||||
]
|
||||
`;
|
||||
|
||||
|
@ -10,6 +10,12 @@ const App: React.FC = () => (
|
||||
</Divider>
|
||||
<Divider type="vertical" style={{ height: 60, borderColor: '#7cb305' }} />
|
||||
<Divider type="vertical" style={{ height: 60, borderColor: '#7cb305' }} dashed />
|
||||
|
||||
<div style={{ display: 'flex', flexDirection: 'column', height: 50, boxShadow: '0 0 1px red' }}>
|
||||
<Divider style={{ background: 'rgba(0,255,0,0.05)' }} orientation="left">
|
||||
Text
|
||||
</Divider>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
|
@ -45,6 +45,7 @@ const genSharedDividerStyle: GenerateStyle<DividerToken> = (token): CSSObject =>
|
||||
|
||||
'&-horizontal&-with-text': {
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
margin: `${token.dividerHorizontalWithTextGutterMargin}px 0`,
|
||||
color: token.colorTextHeading,
|
||||
fontWeight: 500,
|
||||
@ -55,7 +56,6 @@ const genSharedDividerStyle: GenerateStyle<DividerToken> = (token): CSSObject =>
|
||||
|
||||
'&::before, &::after': {
|
||||
position: 'relative',
|
||||
top: '50%',
|
||||
width: '50%',
|
||||
borderBlockStart: `${lineWidth}px solid transparent`,
|
||||
// Chrome not accept `inherit` in `border-top`
|
||||
@ -68,24 +68,20 @@ const genSharedDividerStyle: GenerateStyle<DividerToken> = (token): CSSObject =>
|
||||
|
||||
'&-horizontal&-with-text-left': {
|
||||
'&::before': {
|
||||
top: '50%',
|
||||
width: '5%',
|
||||
},
|
||||
|
||||
'&::after': {
|
||||
top: '50%',
|
||||
width: '95%',
|
||||
},
|
||||
},
|
||||
|
||||
'&-horizontal&-with-text-right': {
|
||||
'&::before': {
|
||||
top: '50%',
|
||||
width: '95%',
|
||||
},
|
||||
|
||||
'&::after': {
|
||||
top: '50%',
|
||||
width: '5%',
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user