Simao
Simao

Reputation: 581

How to change margin based on display/breakpoint in Vuetify

I know it is possible to set the margin on Vuetify based on the display/breakpoints.

How can I change the following class in a way that margin-top will be 0 when the breakpoint/display is "s" or "xs" :

<v-text-field class="mt-5" field> </v-text-field>

Upvotes: 0

Views: 1039

Answers (2)

Ananda Vj
Ananda Vj

Reputation: 181

In addition of Romalex answer, here's a full list of Breakpoint in Vuetify

I know it's not the answer you want to, but I want to share another way to set the behaviour on screen using class conditional. Here's an example:

:class="[$vuetify.breakpoint.smAndDown?'class-1':'class-2']"

Cheers~

Upvotes: 3

Romalex
Romalex

Reputation: 1829

class="mt-sm-5 mt-0"

you can read it like this: use mt-5 if screen is wider than sm breakpoint, else use mt-0

Upvotes: 3

Related Questions