bootstrap-vue-next / bootstrap-vue-next

Early (but lovely) implementation of Vue 3, Bootstrap 5 and Typescript
https://bootstrap-vue-next.github.io/bootstrap-vue-next/
MIT License
1.13k stars 117 forks source link

Adding attrs and class props for items that need it #1776

Open VividLemon opened 9 months ago

VividLemon commented 9 months ago

https://github.com/bootstrap-vue-next/bootstrap-vue-next/issues/756

Throughout the library, there are places where it would be beneficial to add an $attrs and $attrs.class "like" prop onto other HTML elements that aren't the "main" element. For a 'complete' example (minus the attrs)

In BOffcanvas, the central div inherits the $attrs https://github.com/bootstrap-vue-next/bootstrap-vue-next/blob/main/packages/bootstrap-vue-next/src/components/BOffcanvas/BOffcanvas.vue#L26

However, What if you want to change the offcanvas-body behavior?

To fix this, we add the bodyClass and bodyAttrs props https://github.com/bootstrap-vue-next/bootstrap-vue-next/blob/main/packages/bootstrap-vue-next/src/components/BOffcanvas/BOffcanvas.vue#L45

(This one does NOT have the attrs, but it SHOULD)

By adding these two props we can give people the ability to influence elements that they otherwise wouldn't have been able to affect. This allows for greater customization on the downstream developers part.

Like mentioned, BOffcanvas does not provide attrs for these elements, to fix it, it should include those props. However, for some, they don't even have the luxury of a class prop. For example, BCarousel is almost completely unable to be modified besides it's root component.

All components should be evaluated for these candidates. Some elements are small and do not need these values, so it is left to the discretion of the implementer.

github-actions[bot] commented 7 months ago

This issue is stale because it has been open for 30 days with no activity. It will not be auto-closed