question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[@vuetify/vite-plugin] Unable to override some of the variables

See original GitHub issue

When using vite-plugin 1.0.0-alpha.3 with vuetify 3.0.0-alpha.11 and trying to override variables, some of them don’t seem to work (change is not applied) e.g.

@use 'vuetify/styles' with (
  $body-font-family: 'monospace', // this works fine
  $typography: ( // as well as this
    'h1': (
      'size': 1rem,
      'weight': 900,
      'line-height': 1rem,
      'letter-spacing': -.015625em,
      'text-transform': none
    ),
  ),
  $grid-breakpoints: ( // this doesn't work
    'xs': 0,
    'sm': 1000px,
    'md': 1200px,
    'lg': 1400px,
    'xl': 1600px,
    'xxl': 1800px,
  ),
  $container-max-widths: ( // nor does this
    'md': 1199px,
    'lg': 1399px,
    'xl': 1599px,
    'xxl': 1799px,
  ),
);

working $body-font-family: image

not working breakpoints: image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:29 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
KaelWDcommented, Sep 24, 2021

There was a vite bug: https://github.com/vitejs/vite/issues/4957

There’s also #206 which I’m looking into

1reaction
BreizhReloadedcommented, Oct 7, 2021

Hello, I’m reopening that discussion, because I still experience some issues. Here is my setup:

// main.scss
@use 'vuetify/styles' with (
  $typography: (
    'button': (
      'text-transform': none
    ),
  )
);
// vuetify.js
import '../main.scss';
import { createVuetify } from 'vuetify';
export default createVuetify({});
// vite.config.ts
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import vuetify from '@vuetify/vite-plugin';

export default defineConfig({
  plugins: [
    vue(),
    vuetify({ styles: 'expose' })
  ],
});

My buttons are not written with the regular case. The .v-btn still contains text-transform: uppercase. The only workaround I found at the moment, is to manually add the .sass file of the component:

// main.scss
@use 'vuetify/lib/components/VBtn/VBtn';

Am I missing something, or is it a bug? Let me know for more details. Vuetify v3.0.0-alpha.11, Vue v3.2.6 and Vite plugin v1.0.0-alpha.4.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vue.js - Override Vuetify SASS variables - Stack Overflow
To override vuetify variables, just create a directory inside your src named scss and in there create a file called variables.scss.
Read more >
SASS variables - Vuetify
Utilizing the sass/scss data option of your vue.config.js file, you can optionally pass in custom variables to overwrite the global defaults ...
Read more >
Frequently asked questions — Vuetify
Vuetify is a Material Design component framework for Vue.js. It aims to provide all the tools necessary to create beautiful content rich ...
Read more >
Theme configuration — Vuetify
Disable theme. You can disable theme functionality by using the disable property with a value of true. This will prevent the creation of...
Read more >
Treeshaking — Vuetify
If you are using Vue CLI and the vue-cli-plugin-vuetify plugin, this is done for you automatically, and you can skip this section.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found