Skip to content

fix(VSnackbar): opaque background for transparent variants#22646

Merged
J-Sek merged 4 commits intovuetifyjs:masterfrom
Timur000101:fix/18871-snackbar-transparent-variants
Feb 24, 2026
Merged

fix(VSnackbar): opaque background for transparent variants#22646
J-Sek merged 4 commits intovuetifyjs:masterfrom
Timur000101:fix/18871-snackbar-transparent-variants

Conversation

@Timur000101
Copy link
Copy Markdown
Contributor

resolves #18871

Description

This PR resolves an issue where the outlined and tonal variants of the [VSnackbar] component were too transparent. Because these variants used a transparent background by default, the snackbar content was difficult to read when placed over other rendered layout elements.

To fix this, I added a solid background (background: rgb(var(--v-theme-surface))) specifically for these variants in [VSnackbar.sass]. This ensures the snackbar blocks out the content underneath it while perfectly preserving the variant's colored text and borders.

Markup

<template>
  <v-app>
    <v-container>
      <v-sheet
        theme="dark"
        class="d-flex flex-column"
      >
        <v-snackbar
          :timeout="2000"
          color="primary"
          variant="tonal"
        >
          <template v-slot:activator="{ props }">
            <v-btn class="ma-2" color="primary" variant="tonal" v-bind="props">open</v-btn>
          </template>

          Snackbar with <strong>tonal</strong> variant.
        </v-snackbar>

        <v-snackbar
          :timeout="2000"
          color="success"
          variant="outlined"
        >
          <template v-slot:activator="{ props }">
            <v-btn class="ma-2" color="success" variant="outlined" v-bind="props">open</v-btn>
          </template>

          Snackbar with <strong>outlined</strong> variant.
        </v-snackbar>

        <v-snackbar
          :timeout="2000"
          color="success"
          variant="text"
        >
          <template v-slot:activator="{ props }">
            <v-btn class="ma-2" color="success" variant="text" v-bind="props">open</v-btn>
          </template>

          Snackbar with <strong>text</strong> variant.
        </v-snackbar>
      </v-sheet>
    </v-container>
  </v-app>
</template>
```‎

@J-Sek J-Sek added T: bug Functionality that does not work as intended/expected C: VSnackbar labels Feb 24, 2026
@J-Sek J-Sek enabled auto-merge (squash) February 24, 2026 17:09
@J-Sek J-Sek merged commit e83fa88 into vuetifyjs:master Feb 24, 2026
9 checks passed
@KaelWD KaelWD added this to the v4.0.x milestone Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: VSnackbar T: bug Functionality that does not work as intended/expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report][3.4.7] V3 Snackbar variants are too transparent

3 participants