@@ -26,36 +26,38 @@ type IProps = DividerProps & {
26
26
27
27
// TODO: enable type "vertical" https://ant.design/components/divider
28
28
29
- const StyledDivider = styled ( Divider ) < IProps > `
29
+ const StyledDivider = styled ( Divider ) < IProps > `
30
30
margin-top: 3.5px;
31
- rotate:${ props => props . $style . rotation } ;
31
+ rotate: ${ ( props ) => props . $style . rotation } ;
32
+
32
33
.ant-divider-inner-text {
33
34
height: 32px;
34
35
display: flex;
35
36
align-items: center;
36
37
font-size: ${ ( props ) => props . $style . textSize } ;
37
38
font-weight: ${ ( props ) => props . $style . textWeight } ;
38
39
font-family: ${ ( props ) => props . $style . fontFamily } ;
39
- text-transform:${ ( props ) => props . $style . textTransform } ;
40
- text-decoration: ${ ( props ) => props . $style . textDecoration } ;
41
- font-style:${ ( props ) => props . $style . fontStyle }
40
+ text-transform: ${ ( props ) => props . $style . textTransform } ;
41
+ ${ ( props ) => props . $style . textDecoration !== undefined ? `text-decoration: ${ props . $style . textDecoration } ;` : '' }
42
+ font-style: ${ ( props ) => props . $style . fontStyle } ;
42
43
}
43
- ${ props => props . $animationStyle }
44
+
45
+ ${ ( props ) => props . $animationStyle }
44
46
min-width: 1px;
45
- width: ${ ( props ) => {
46
- return widthCalculator ( props . $style . margin ) ;
47
- } } ;
48
- min-height: ${ ( props ) => {
49
- return heightCalculator ( props . $style . margin ) ;
50
- } } ;
51
- margin: ${ ( props ) => {
52
- return props . $style . margin ;
53
- } } ;
47
+ width: ${ ( props ) => widthCalculator ( props . $style . margin ) } ;
48
+ min-height: ${ ( props ) => heightCalculator ( props . $style . margin ) } ;
49
+ margin: ${ ( props ) => props . $style . margin } ;
54
50
padding: ${ ( props ) => props . $style . padding } ;
55
- border-radius:${ props => props . $style . radius } ;
56
- border-top: ${ ( props ) => ( props . $style . borderWidth && props . $style . borderWidth != "0px" ? props . $style . borderWidth : "1px" ) } ${ ( props ) => props . $style . borderStyle } ${ ( props ) => props . $style . border } ;
57
- .ant-divider-inner-text::before, .ant-divider-inner-text::after {
58
- border-block-start: ${ ( props ) => ( props . $style . borderWidth && props . $style . borderWidth != "0px" ? props . $style . borderWidth : "1px" ) } ${ ( props ) => ( props . dashed ? "dashed" : "solid" ) } ${ ( props ) => props . $style . border } !important;
51
+ border-radius: ${ ( props ) => props . $style . radius } ;
52
+ border-top: ${ ( props ) => props . $style . borderWidth && props . $style . borderWidth !== "0px" ? props . $style . borderWidth : "1px" }
53
+ ${ ( props ) => props . $style . borderStyle }
54
+ ${ ( props ) => props . $style . border } ;
55
+
56
+ .ant-divider-inner-text::before,
57
+ .ant-divider-inner-text::after {
58
+ border-block-start: ${ ( props ) => props . $style . borderWidth && props . $style . borderWidth !== "0px" ? props . $style . borderWidth : "1px" }
59
+ ${ ( props ) => props . dashed ? "dashed" : "solid" }
60
+ ${ ( props ) => props . $style . border } !important;
59
61
border-block-start-color: inherit;
60
62
border-block-end: 0;
61
63
border-block-start-radius: inherit;
@@ -66,11 +68,14 @@ const StyledDivider = styled(Divider) <IProps>`
66
68
border-top-color: ${ ( props ) => props . $style . color } ;
67
69
color: ${ ( props ) => props . $style . text } ;
68
70
}
71
+
69
72
&.ant-divider-horizontal.ant-divider-with-text::before,
70
- &.ant-divider-horizontal.ant-divider-with-text::after {
73
+ &.ant-divider-horizontal.ant-divider-with-text::after {
71
74
border-top-color: ${ ( props ) => props . $style . color } ;
72
- border-radius:${ props => props . $style . radius } ;
73
- border-top: ${ ( props ) => ( props . $style . borderWidth && props . $style . borderWidth != "0px" ? props . $style . borderWidth : "1px" ) } ${ ( props ) => props . $style . borderStyle } ${ ( props ) => props . $style . border } ;
75
+ border-radius: ${ ( props ) => props . $style . radius } ;
76
+ border-top: ${ ( props ) => props . $style . borderWidth && props . $style . borderWidth !== "0px" ? props . $style . borderWidth : "1px" }
77
+ ${ ( props ) => props . $style . borderStyle }
78
+ ${ ( props ) => props . $style . border } ;
74
79
}
75
80
` ;
76
81
0 commit comments