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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 8 additions & 6 deletions packages/vuetify/src/components/VSwitch/VSwitch.sass
Expand Up @@ -7,10 +7,6 @@
.v-label
padding-inline-start: $switch-label-margin-inline-start

.v-switch__thumb
background-color: $switch-thumb-background
color: $switch-thumb-color

.v-switch__loader
display: flex

Expand Down Expand Up @@ -58,6 +54,8 @@

.v-switch__thumb
align-items: center
background-color: $switch-thumb-background
color: $switch-thumb-color
border-radius: $switch-thumb-radius
display: flex
font-size: .75rem
Expand All @@ -71,13 +69,17 @@

@include tools.elevation($switch-thumb-elevation)

.v-switch.v-switch--flat:not(.v-switch--inset) &
background: $switch-thumb-flat-background
color: $switch-thumb-flat-color

@include tools.elevation(0)

.v-switch--inset &
height: $switch-inset-thumb-height
width: $switch-inset-thumb-width
transform: scale(calc($switch-inset-thumb-off-height / $switch-inset-thumb-height))

@include tools.elevation(0)

&--filled
transform: none

Expand Down
1 change: 1 addition & 0 deletions packages/vuetify/src/components/VSwitch/VSwitch.tsx
Expand Up @@ -109,6 +109,7 @@ export const VSwitch = genericComponent<new <T>(
<VInput
class={[
'v-switch',
{ 'v-switch--flat': props.flat },
{ 'v-switch--inset': props.inset },
{ 'v-switch--indeterminate': indeterminate.value },
loaderClasses.value,
Expand Down
2 changes: 2 additions & 0 deletions packages/vuetify/src/components/VSwitch/_variables.scss
Expand Up @@ -19,6 +19,8 @@ $switch-loader-color: rgb(var(--v-theme-surface)) !default;

$switch-thumb-background: rgb(var(--v-theme-surface-bright)) !default;
$switch-thumb-color: rgb(var(--v-theme-on-surface-bright)) !default;
$switch-thumb-flat-background: rgb(var(--v-theme-surface-variant)) !default;
$switch-thumb-flat-color: rgb(var(--v-theme-on-surface-variant)) !default;
$switch-thumb-elevation: 4 !default;
$switch-thumb-height: 20px !default;
$switch-thumb-width: 20px !default;
Expand Down