Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add customization to v-dialog overlay 2.0 #8301

Closed
martinszeltins opened this issue Aug 5, 2019 · 2 comments · May be fixed by ajesse11x/ethereumbook#1 or ajesse11x/vuetify#2
Closed
Labels
maybe Functionality that we are considering T: feature A new feature

Comments

@martinszeltins
Copy link

Problem to solve

Right now the v-dialog component has a fixed and unchangable overlay color that is set to "opacity: 0.46; background-color: rgb(33, 33, 33);". That is the v-overlay__scrim element. The problem is that users cannot change the opacity of the background overlay for the dialogs.

The only way right now to change the opacity of the overlay is to manually override the class. But it still doesn't work if there are multiple dialogs on a single page.

Proposed solution

The solution is to simply add a background (or overlay) property to the v-dialog component. This allows a user to change both the opacity and the color of dialog's overlay:

<v-dialog
   background="rgba(33, 33, 33, 0.50)"
   v-model="dialog"
>
@ghost ghost added the S: triage label Aug 5, 2019
@martinszeltins martinszeltins changed the title [Feature Request] Add customization to v-dialog overlay [Feature Request] Add customization to v-dialog overlay 2.0 Aug 5, 2019
@johnleider johnleider added maybe Functionality that we are considering T: feature A new feature and removed S: triage labels Aug 5, 2019
@Thys-Smit
Copy link

+1 for this.

My workaround :

<v-overlay :opacity="0.8">
        <v-dialog 
            v-model="dialog" 
            persistent 
            hide-overlay
        >
        </v-dialog>
</v-overlay>

Depending on your implementation of the dialog, you might need to use the v-model="dialog" on v-overlay aswel.

MajesticPotatoe pushed a commit that referenced this issue Sep 27, 2019
There was no way to control the opacity or color of the overlay on VBottomSheet, VDialog and
VNavigationDrawer and the overlayable mixin was apparently only used for the hide-overlay prop. This
adds overlay-color and overlay-opacity props. Also added the translation strings file for the mixin
and adjusted component props on the docs.

fix #8301
@ghost
Copy link

ghost commented May 24, 2022

Old issue but still relevant. Here is my workaround if anyone runs across this.

There's no way to override the .v-overlay__scrim class styling. So what I do is:

Set opacity to 0, give it an ID <v-overlay id="myoverlay" absolute opacity="0" />

Then customize the styling

#myoverlay {
  background-color: rgba(150, 0, 0, 0.95);
}

This makes the .v-overlay__scrim class invisible, and gives you full control over the actual overlay. You can add background images, custom colors, whatever.


If you're trying to customize the navigation drawer overlay.. then set the hide-overlay prop on the nav drawer and add your own custom v-overlay that shares the nav-drawer's v-model

for example...

<v-overlay v-if="drawer" id="myoverlay" absolute opacity="0" />
<v-navigation-drawer v-model="drawer" hide-overlay ... />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maybe Functionality that we are considering T: feature A new feature
Projects
None yet
3 participants