Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do I change font-size in vuetify component

I use v-text-field, and v-select, with vue-loader.
I tried to change font-size, but I could not. How Do I change font-size?

My code likes this.

<template lang="pug">
p label-1
v-text-field(...)

p label-1
v-text-field(...)
</template>

<stylelang="sass">
.input-group .input-group__input
  font-size: 12px !important
</style>

<stylelang="sass"scoped>
.p
  font-size: 12px
</style>

developer tool screenshot

like image 341
tomlla Avatar asked Oct 27 '17 04:10

tomlla


People also ask

How do I change the font in Vuetify?

To change the default font in Vuetify, we can set the font-family CSS property in the global styles. to set the font-family value to $font-family , which is set to 'Ubuntu' . Now our Vuetify app will use Ubuntu as the default font.

What font does Vuetify use?

Vuetify. js uses the Material Design spec Roboto Font. Each heading size also has a corresponding helper class to style other elements the same.

Is Vuetify customizable?

Customizing. By default, Vuetify has a standard theme applied for all components. This can be easily changed. Simply pass a theme property to the Vuetify constructor.

How do I wrap text in Vuetify?

You can use text-wrap / text-no-wrap class. Show activity on this post. The solution for my scenario was adding word-break: break-word; to my class. The built in classnames did not do what I needed.


1 Answers

To change the font size for a single component, such as a text field, application-wide:

<style>
  .v-text-field input {
    font-size: 1.2em;
  }
</style>

To change the font size within another component, use a scoped style:

<style scoped>
  .v-text-field input {
    font-size: 1.2em;
  }
</style>

For a more generic approach, you can also target multiple component types using .v-input

.v-input {
    font-size: 1.2em;
}

or

.v-input input {
    font-size: 1.2em;
}

Finally, you can also target the labels as well.

.v-input .v-label {
    font-size: 1.2em;
}
like image 50
Steven Spungin Avatar answered Sep 19 '22 21:09

Steven Spungin