vuetify icon indicating copy to clipboard operation
vuetify copied to clipboard

[Feature Request] Add my-auto and ma-auto

Open mdartic opened this issue 8 years ago • 5 comments

Problem to solve

This feature could help center elements, vertically and horizontally + vertically.

Maybe there is another way to center elements with existing features, but I didn't find them.

Proposed solution

Write these two spacing helpers that could be implemented like this :

.ma-auto {
  margin: auto;
}
.my-auto {
  margin: auto 0 auto 0;
}

mdartic avatar Mar 31 '18 13:03 mdartic

If you think it's a good idea, I could propose a PR. But, like I said, maybe there is another way to do it with existing features.

mdartic avatar Mar 31 '18 13:03 mdartic

Vuetify uses Flexbox to align elements. You can wrap your element within a v-layout and apply necessary attributes to align the item as shown below.

<v-layout justify-center align-center>
    <!-- Element to be centered -->
    <div>Element</div>
</v-layout>

nikhilem avatar Apr 07 '18 07:04 nikhilem

Thanks @nikhilem I discover https://vuetifyjs.com/examples/layouts/centered and understand better how container / layout / flex are orchestrated. It's a bit difficult for me to understand which component is responsible for what, but you help me understand better ! Thank you.

mdartic avatar Apr 07 '18 13:04 mdartic

Glad to help

nikhilem avatar Apr 07 '18 15:04 nikhilem

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please direct any non-bug questions to our Discord

lock[bot] avatar Apr 14 '19 09:04 lock[bot]