-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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(vfield): standardize descendants to fix spacing #16132
Changes from 1 commit
e99b484
9e68331
44dab12
3d76117
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -3,7 +3,6 @@ | |||
@use '../../styles/settings' | ||||
@use '../../styles/tools' | ||||
@use './variables' as * | ||||
@use '../VInput/variables' as * | ||||
|
||||
/* region INPUT */ | ||||
.v-field | ||||
|
@@ -25,12 +24,20 @@ | |||
|
||||
--v-field-padding-start: #{$field-control-padding-start} | ||||
--v-field-padding-end: #{$field-control-padding-end} | ||||
--v-field-padding-top: #{$field-control-padding-top} | ||||
--v-field-padding-bottom: #{$field-control-padding-bottom} | ||||
|
||||
/* endregion */ | ||||
/* region MODIFIERS */ | ||||
.v-field | ||||
@at-root | ||||
@include tools.density('v-input', $field-control-density) using ($modifier) | ||||
--v-field-prepend-append-padding-top: #{$field-control-padding-top + $modifier} | ||||
// --v-field-padding-bottom: #{$field-control-padding-bottom + $modifier} | ||||
--v-field-padding-top: #{$field-control-padding-top + $modifier} | ||||
--v-field-padding-bottom: #{$field-control-padding-bottom + $modifier} | ||||
&.v-textarea .v-field:not(.v-field--no-label) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was trying to avoid using |
||||
--v-field-padding-top: #{$field-control-padding-top + $modifier + 8px} | ||||
--v-field-padding-bottom: #{$field-control-padding-bottom + $modifier - 8px} | ||||
|
||||
&--prepended | ||||
padding-inline-start: $field-control-affixed-padding | ||||
|
||||
|
@@ -48,27 +55,6 @@ | |||
border-bottom-left-radius: 0 | ||||
border-bottom-right-radius: 0 | ||||
|
||||
&--variant-solo, | ||||
&--variant-filled | ||||
$root: & | ||||
|
||||
@at-root | ||||
@include tools.density('v-input', $input-density) using ($modifier) | ||||
@at-root #{selector.nest(&, $root)} | ||||
--v-input-control-height: #{$field-control-height + $modifier} | ||||
--v-field-padding-bottom: #{$field-control-padding-bottom + $modifier * .5} | ||||
|
||||
&--variant-outlined, | ||||
&--single-line, | ||||
&--no-label | ||||
--v-field-padding-top: 0px | ||||
$root: & | ||||
|
||||
@at-root | ||||
@include tools.density('v-input', $input-density) using ($modifier) | ||||
@at-root #{selector.nest(&, $root)} | ||||
--v-field-padding-bottom: #{16px + $modifier * .5} | ||||
|
||||
&--variant-plain, | ||||
&--variant-underlined | ||||
$root: & | ||||
|
@@ -78,13 +64,24 @@ | |||
&.v-field | ||||
--v-field-padding-start: 0px | ||||
--v-field-padding-end: 0px | ||||
--v-field-padding-top: 6px | ||||
--v-field-padding-bottom: 2px | ||||
|
||||
&:not(&--variant-outlined, &--single-line) | ||||
&:not(.v-field--no-label) | ||||
$root: & | ||||
@at-root | ||||
@include tools.density('v-input', $field-control-density) using ($modifier) | ||||
&:not(.v-textarea) #{$root} | ||||
--v-field-padding-top: #{$field-control-padding-top + $modifier + 10px} | ||||
--v-field-padding-bottom: #{$field-control-padding-bottom + $modifier - 10px} | ||||
|
||||
&--variant-outlined | ||||
$root: & | ||||
@at-root | ||||
@include tools.density('v-input', $input-density) using ($modifier) | ||||
@at-root #{selector.nest(&, $root)} | ||||
--v-input-control-height: #{$field-control-underlined-height + $modifier} | ||||
@include tools.density('v-input', $field-control-density) using ($modifier) | ||||
@at-root #{selector.nest(&, $root, '.v-field__field')} | ||||
--v-field-padding-top: #{$field-control-padding-top + $modifier + 2px} | ||||
--v-field-padding-bottom: #{$field-control-padding-bottom + $modifier - 2px} | ||||
|
||||
|
||||
// These are separate so they can override the default variant styles | ||||
&.v-field | ||||
|
@@ -102,11 +99,11 @@ | |||
flex-wrap: wrap | ||||
letter-spacing: $field-letter-spacing | ||||
opacity: $field-input-opacity | ||||
min-height: var(--v-input-control-height, $input-control-height) | ||||
min-height: var(--v-input-control-height) | ||||
padding-inline-start: var(--v-field-padding-start) | ||||
padding-inline-end: var(--v-field-padding-end) | ||||
padding-top: calc(var(--v-field-padding-top, $field-control-padding-top) + var(--v-input-padding-top, 0)) | ||||
padding-bottom: var(--v-field-padding-bottom, $field-control-padding-bottom) | ||||
padding-top: var(--v-field-padding-top) | ||||
padding-bottom: var(--v-field-padding-bottom) | ||||
width: 100% | ||||
|
||||
input | ||||
|
@@ -123,6 +120,29 @@ | |||
&:active | ||||
outline: none | ||||
|
||||
@at-root | ||||
@include tools.density('v-input', $field-control-density) using ($modifier) | ||||
.v-field--variant-plain, | ||||
.v-field--variant-underlined | ||||
&.v-field--single-line, | ||||
&:not(.v-field--no-label) | ||||
--v-field-padding-top: #{$field-control-padding-top + $modifier - 2px} | ||||
--v-field-padding-bottom: #{$field-control-padding-bottom + $modifier + 2px} | ||||
$root: & | ||||
@at-root | ||||
@include tools.density('v-input', $field-chips-margin-top) using ($modifier) | ||||
@at-root #{selector.nest(&, $root)} | ||||
--v-field-chips-margin-top: #{$modifier * .25} | ||||
@include tools.density('v-input', $field-chips-margin-bottom) using ($modifier) | ||||
@at-root #{selector.nest(&, $root)} | ||||
--v-field-chips-margin-bottom: #{$modifier * .25} | ||||
|
||||
|
||||
.v-chip.v-chip--size-small | ||||
margin-top: var(--v-field-chips-margin-top) | ||||
margin-bottom: var(--v-field-chips-margin-bottom) | ||||
height: #{$field-chip-height} | ||||
|
||||
// Remove Firefox red outline | ||||
&:invalid | ||||
box-shadow: none | ||||
|
@@ -152,7 +172,7 @@ | |||
.v-field__clearable | ||||
align-items: flex-start | ||||
display: flex | ||||
padding-top: var(--v-input-padding-top, $field-control-padding-top) | ||||
padding-top: var(--v-prepend-append-padding-top) | ||||
|
||||
.v-field__prepend-inner, | ||||
.v-field__append-inner | ||||
|
@@ -193,13 +213,20 @@ | |||
/* endregion */ | ||||
/* region LABEL */ | ||||
.v-label.v-field-label | ||||
$root: & | ||||
@at-root | ||||
@include tools.density('v-input', $field-control-density) using ($modifier) | ||||
& #{$root}:not(#{$root}--floating) | ||||
--v-field-label-padding-top: #{$field-control-padding-top + $modifier} | ||||
--v-field-label-padding-bottom: #{$field-control-padding-bottom + $modifier} | ||||
|
||||
contain: layout paint | ||||
margin-inline-start: var(--v-field-padding-start) | ||||
margin-inline-end: var(--v-field-padding-end) | ||||
max-width: calc(100% - var(--v-field-padding-start) - var(--v-field-padding-end)) | ||||
pointer-events: none | ||||
position: absolute | ||||
top: var(--v-input-padding-top, $field-control-padding-top) | ||||
top: var(--v-field-label-padding-top) | ||||
transform-origin: left center | ||||
transition: $field-transition-timing | ||||
transition-property: opacity, transform | ||||
|
@@ -213,7 +240,7 @@ | |||
|
||||
.v-field--error:not(.v-field--disabled) & | ||||
color: rgb(var(--v-theme-error)) | ||||
|
||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
&--floating | ||||
--v-field-label-scale: #{$field-label-floating-scale}em | ||||
font-size: var(--v-field-label-scale) | ||||
|
@@ -223,19 +250,15 @@ | |||
.v-field.v-field--active & | ||||
visibility: visible | ||||
|
||||
.v-field--variant-solo &, | ||||
.v-field--variant-filled & | ||||
$root: & | ||||
|
||||
@at-root | ||||
@include tools.density('v-input', $input-density) using ($modifier) | ||||
@at-root #{selector.nest(&, $root)} | ||||
top: 7px + $modifier * .25 | ||||
|
||||
.v-field--variant-plain &, | ||||
.v-field--variant-underlined & | ||||
transform: translateY(-16px) | ||||
margin: 0 | ||||
$root: & | ||||
@at-root .v-field--variant-plain, .v-field--variant-underlined | ||||
&.v-field--prepended | ||||
#{$root} | ||||
padding-left: var(--v-field-padding-start) | ||||
|
||||
#{$root} | ||||
transform: translateY(-25%) | ||||
margin: 0 | ||||
|
||||
.v-field--variant-outlined & | ||||
transform: translateY(-50%) | ||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -21,16 +21,19 @@ $field-control-solo-elevation: 2 !default; | |||||
$field-control-filled-background: rgba(var(--v-theme-on-surface), var(--v-idle-opacity)) !default; | ||||||
$field-control-padding-start: 16px !default; | ||||||
$field-control-padding-end: 16px !default; | ||||||
$field-control-padding-top: 10px !default; | ||||||
$field-control-padding-bottom: 6px !default; | ||||||
$field-control-padding-top: 16px !default; | ||||||
$field-control-padding-bottom: 16px !default; | ||||||
$field-control-affixed-padding: 12px !default; | ||||||
$field-control-affixed-inner-padding: 6px !default; | ||||||
$field-control-underlined-height: 48px !default; | ||||||
$field-control-underlined-padding-bottom: 2px !default; | ||||||
$field-control-height: 56px !default; | ||||||
$field-control-density: ('default': 0, 'comfortable': -1, 'compact': -2) !default; | ||||||
$field-chips-margin-top: ('default': 1, 'comfortable': 0, 'compact': 0) !default; | ||||||
$field-chips-margin-bottom: ('default': 3, 'comfortable': 3, 'compact': 2) !default; | ||||||
$field-chip-height: 20px; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
// INPUT | ||||||
$field-input-padding-top: 32px !default; | ||||||
$field-input-opacity: var(--v-high-emphasis-opacity) !default; | ||||||
|
||||||
// LABEL | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// Defaults | ||
$file-input-chip-margin-inline-end: 4px !default; | ||
$file-input-chips-margin-top: 2px !default; | ||
$file-input-chips-margin-bottom: ('default': 0, 'comfortable': 1, 'compact': 2) !default; | ||
$file-input-chips-margin-top: ('default': 1, 'comfortable': 2, 'compact': 1) !default; | ||
$file-input-chips-margin-bottom: ('default': 3, 'comfortable': 1, 'compact': 1) !default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.