ant-design [RFC] Divider custom gutter margin

ddrv8njm  于 3个月前  发布在  其他
关注(0)|答案(2)|浏览(38)

What problem does this feature solve?

My team uses Ant Design for our component library. We use the Divider component in many places and we tend to override the gutter margin quite a bit using the style prop. As a team we've all mentioned that it would be nice and seems intuitive that the Divider component would have a prop similar to the orientationMargin prop that would adjust the gutter margin.

What does the proposed API look like?

I propose adding a property to the Divider component called gutterMargin

This property would set the margin-inline for vertical dividers and the margin for horizontal dividers

s4n0splo

s4n0splo1#

Use className or style directly. We only add style related prop when have not other way. Or recommend to use classNamesclassNamerootClassNamestylesstylerootStyle instead.

5sxhfpxr

5sxhfpxr2#

Thanks for the reply!

I think that is a great standard to have. I would argue that given that the functionality of the Divider component is the margin that it provides, I would argue that this could be an exception to that rule.

If not however, what would you think about exposing a component token for controlling the default gutter margin?

I see that we have two tokens in the styling for the horizontal Divider margin.

dividerHorizontalWithTextGutterMargin and dividerHorizontalGutterMargin

We could expose these like we do the verticalMarginInline token for the vertical Divider in the documentation.

相关问题