naive-ui icon indicating copy to clipboard operation
naive-ui copied to clipboard

Padding class helper as vuetify has

Open AntonyOnScript opened this issue 3 years ago • 4 comments

This function solves the problem (这个功能解决的问题)

like pl-2 for padding left, pr-2 for padding right... the same for margins

Expected API (期望的 API)

like pl-2 for padding left, pr-2 for padding right... the same for margins

AntonyOnScript avatar May 07 '22 17:05 AntonyOnScript

I'm not sure this should be added. Since if we don't provide many classes, it would be very easy for user to create some needed classes by themselves. However if we provide many classes, tailwind or bootstrap is the best choice.

07akioni avatar May 08 '22 16:05 07akioni

I'm not sure this should be added. Since if we don't provide many classes, it would be very easy for user to create some needed classes by themselves. However if we provide many classes, tailwind or bootstrap is the best choice.

so, do you recommend bootstrap be used within naive, in this case?

AntonyOnScript avatar May 15 '22 14:05 AntonyOnScript

I'm not sure this should be added. Since if we don't provide many classes, it would be very easy for user to create some needed classes by themselves. However if we provide many classes, tailwind or bootstrap is the best choice.

so, do you recommend bootstrap be used within naive, in this case?

Any relevant library is okay. I just don't think it will fit most users' demand if there's no convincing scene.

07akioni avatar May 15 '22 14:05 07akioni

As a Vuetify user i can attest to the fact that these types of classes are better when linked to the UI library because you can use the same variables used in the components.

For example (forced to prove the point): If i have a n-list with a n-list-item inside and would like to align an element outside the list with the n-list-item, i would have to to inspect the list, see that the left padding is 20px and add a style to the element. It would be much easier if i had a ml-<global padding step> class knowing that the classes have the same padding steps used in the component.

A workaround would be to modify Tailwind to have the same variables as the components but that would be kind of tedious.

I didn't use Naive UI long enough to know if the paddings and margins used in components are equivalent to Tailwind for example. If that is true i think it should be stated in the documentation to reduce confusion.

racedaemon avatar May 22 '22 11:05 racedaemon

This issue does not have any recent activity. If you are still experiencing similar problems, open a new error, including a minimal copy of the problem

jahnli avatar Mar 12 '24 13:03 jahnli