Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to change theme default text color in nuxt.config.js or by defining sass variable?

I have Nuxt / Vuetify app with following configuration (nuxt.config.js)

vuetify: {
    customVariables: ['~/assets/sass/vuetify.sass'],

    theme: {
      themes: {
        light: {
          primary: '#e85730',          
        }
      }
    }
  }

So I can change primary color (applied eg. to button background). I am also able to change Vuetify variables in ~/assets/sass/vuetify.sass, eg.

$body-font-family: 'Poppins', sans-serif

But I am unable to change theme text color there. For light theme color is compiled to .theme--light.v-application with default value rgba(0, 0, 0, 0.87)

I can override it with CSS rule and same selector, but I don't like it much. I would rather keep theme changes at one place together (ideally in Nuxt config file or at least as sass variable). Is it even possible.

like image 566
farincz Avatar asked Jun 03 '20 12:06

farincz


1 Answers

This can be changed via the sass variables $material-light and $material-dark (https://vuetifyjs.com/en/api/vuetify/#sass-variables). But for the following button colors it will use always dark; primary, secondary, accent, success, error, warning and info.

$material-light: (
  'text': (
    'primary': 'yellow'
  )
);
$material-dark: (
  'text': (
    'primary': 'blue'
  )
);
like image 167
Victor Perez Avatar answered Nov 09 '22 02:11

Victor Perez