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

fix(VSwitch): remove elevation with flat props #19324

Merged

Conversation

SonTT19
Copy link
Contributor

@SonTT19 SonTT19 commented Mar 4, 2024

Description

fixes #19307

Markup:

<template>
  <v-app>
    <v-container>
      <v-switch />
      <v-switch flat />
    </v-container>
  </v-app>
</template>

<script setup></script>

Copy link
Member

@yuwu9145 yuwu9145 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inset needs elevation to be 0 as well, can you try to combine flat "elevation 0" logic with inset together?

Something like

&:not(.v-switch--flat):not(.v-switch--inset)
    @include tools.elevation($switch-thumb-elevation)

@SonTT19
Copy link
Contributor Author

SonTT19 commented Mar 4, 2024

inset needs elevation to be 0 as well, can you try to combine flat "elevation 0" logic with inset together?

Something like

&:not(.v-switch--flat):not(.v-switch--inset)
    @include tools.elevation($switch-thumb-elevation)

This is not working because .v-switch--inset is in parent DOM, not for .v-switch__thumb
Screenshot 2024-03-04 at 13 55 59

And we already have the reset elevation for inset
image
https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/components/VSwitch/VSwitch.sass#L79

@yuwu9145
Copy link
Member

yuwu9145 commented Mar 4, 2024

@SonTT19 #19307 (comment)

@MajesticPotatoe MajesticPotatoe added T: bug Functionality that does not work as intended/expected C: VSwitch VSwitch labels Mar 4, 2024
johnleider
johnleider previously approved these changes Mar 4, 2024
@johnleider
Copy link
Member

I made an update to how the colors are applied, and added surface-variant as default when using flat, which looks great.

@johnleider johnleider merged commit 1b4b0ce into vuetifyjs:master Mar 4, 2024
4 of 5 checks passed
VIXI0 pushed a commit to VIXI0/vuetify that referenced this pull request Mar 13, 2024
fixes vuetifyjs#19307

Co-authored-by: Son Tran <stt@cct-technology.com>
Co-authored-by: Yuchao Wu <yuchao.sydneyuni@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VSwitch VSwitch 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.5.6] VSwitch - flat prop doesn't remove elevation
4 participants