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.

Change background colors for light and dark themes

See original GitHub issue

What problem does this feature solve?

I want to use a different tone of color for dark and light theme in my theme-able application. But today, there’s no way to set that.

What is your proposed solution?

Based on #1599, it should be nice to have a theme setup like this:

Vue.use(Vuetify, {
  theme: {
    light: {
      background: '#cccccc',
      primary: '#3f51b5',
      secondary: '#b0bec5',
      accent: '#8c9eff',
      error: '#b71c1c'
    },
    dark: {
      background: '#555555',
      primary: '#3f51b5',
      secondary: '#b0bec5',
      accent: '#8c9eff',
      error: '#b71c1c'
    }
})

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:13
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
loomchildcommented, Feb 18, 2021

I wrote a short article combining above solutions and defining a custom background color: Changing Background Color in Vuetify.js and Nuxt.js - I thought someone might find it interesting.

6reactions
mtermoulcommented, Oct 28, 2019

I tried to change the light/dark theme default background color using the method above, however it does not work!!! here is what I did

add new style file under ./src/scss/main.scss

// src/scss/main.scss
@import '~vuetify/src/styles/styles.sass'
$new-colors: (
    'app-bar': map-get($red, 'lighten-4') !important,
    'background': map-get($red, 'lighten-4') !important,
    'cards': map-get($red, 'lighten-4') !important,
    'bg-color': map-get($red, 'lighten-4') !important,
    'fg-color': map-get($red, 'lighten-4') !important,
    'text-color': map-get($red, 'lighten-4') !important,
    'buttons': (
      'disabled': map-get($red, 'lighten-4') !important,
      'focused': map-get($red, 'lighten-4') !important,
      'focused-alt': map-get($red, 'lighten-4') !important,
      'pressed': map-get($red, 'lighten-4') !important,
    ),
);
$material-light: map-merge($material-light, $new-colors);
$material-dark: map-merge($material-dark, $new-colors);
@debug $material-light;

@import '~vuetify/src/styles/main.sass';
@import '~vuetify/src/components/VBtn/_variables.scss';

Then I imported this file from ./src/main.js like this:

// ./src/main.js 
import Vue from 'vue';
import vuetify from './plugins/vuetify';
import './scss/main.scss';

new Vue({
    vuetify,
    beforeCreate() {
        console.log('Before our APP is created');
    },
    mounted() {
        console.log('Our APP is being mounted now.');
    },
    render: function(h) {
        return h(App);
    }
}).$mount('#app');

I am using vue 2.6.7 and vuetify 2.1.7

Read more comments on GitHub >

github_iconTop Results From Across the Web

Light & Dark Color Modes in Design Systems - Medium
To create a system for light & dark, you must model the range of CSS properties you'll control, from backgrounds and text to...
Read more >
Dark theme - Material Design
A dark theme displays dark surfaces across the majority of a UI. It's designed to be a supplemental mode to a default (or...
Read more >
Create switchable styles from light to dark mode in Figma
In the main background section, there are two primary colors: Primary and Secondary. They change color depending on the light or dark version....
Read more >
Introducing Light and Dark Themes | Learn BeFunky
In the Settings menu, you will see options for Theme Color and Canvas Background color. You can choose between Dark or Light for...
Read more >
Dark Mode to Change Color Schemes and CSS Properties
When developing a dark theme, you may notice that certain system UI components are not adjusting to dark mode properly. To fix this...
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