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

[Bug Report][3.0.0-beta.10] size not working for v-rating #15746

Closed
LeoTuet opened this issue Sep 7, 2022 · 2 comments
Closed

[Bug Report][3.0.0-beta.10] size not working for v-rating #15746

LeoTuet opened this issue Sep 7, 2022 · 2 comments
Assignees
Labels
C: VBtn C: VChip T: bug Functionality that does not work as intended/expected
Milestone

Comments

@LeoTuet
Copy link

LeoTuet commented Sep 7, 2022

Environment

Vuetify Version: 3.0.0-beta.10
Vue Version: 3.2.38
Browsers: Chrome 104.0.0.0
OS: Linux x86_64

Steps to reproduce

Add the size prop to the Rating component and set it to any numeric string value.

Expected Behavior

The stars of the Rating component adapt to the set size.

Actual Behavior

The stars format to a fixed size with no spacing whatsoever.

Reproduction Link

https://codepen.io/leotuet/pen/bGMVYqg?editors=101

@KaelWD KaelWD added T: bug Functionality that does not work as intended/expected C: VBtn C: VIcon C: VChip and removed S: triage labels Sep 8, 2022
@KaelWD KaelWD added this to the v3.0.0-beta milestone Sep 8, 2022
@KaelWD KaelWD self-assigned this Sep 8, 2022
@KaelWD KaelWD removed the C: VIcon label Sep 8, 2022
@KaelWD
Copy link
Member

KaelWD commented Sep 8, 2022

Buttons and chips have some pretty complex css to generate the correct sizes:

@mixin chip-sizes {
@each $sizeName, $multiplier in settings.$size-scales {
$size: map.get($chip-sizes, "font-size") + math.div(2 * $multiplier, 16);
$height: map.get($chip-sizes, "height") + (6 * $multiplier);
$padding: math.round(math.div($height, $chip-padding-ratio));
.v-chip.v-chip--size-#{$sizeName} {
--v-chip-size: #{$size};
--v-chip-height: #{$height};
font-size: $size;
padding: 0 $padding;
.v-avatar {
--v-avatar-height: #{$height - 6};
@at-root #{selector.append('.v-chip--pill', &)} {
--v-avatar-height: #{$height};
}
}
.v-chip__filter,
.v-chip__prepend,
> .v-avatar--start,
> .v-icon--start {
margin-inline-end: $padding * .5;
}
.v-chip__filter,
.v-chip__prepend,
.v-icon--start {
margin-inline-start: -$padding * .5;
}
.v-avatar--start {
margin-inline-start: -$padding * .7;
@at-root #{selector.append('.v-chip--pill', &)} {
margin-inline-start: -$padding;
}
}
.v-chip__append,
.v-chip__close,
> .v-avatar--end,
> .v-icon--end {
margin-inline-start: $padding * .5;
margin-inline-end: -$padding * .5;
}
.v-avatar--end,
.v-icon--end {
@at-root #{selector.append('.v-chip--pill', &)} {
margin-inline-end: -$padding;
+ .v-chip__close {
margin-inline-start: $padding;
}
}
}
}
}
}
@mixin chip-density($properties, $densities) {
@each $density, $multiplier in $densities {
$value: calc(var(--v-chip-height) + #{$multiplier * settings.$spacer});
&.v-chip--density-#{$density} {
@if meta.type-of($properties) == "list" {
@each $property in $properties {
#{$property}: $value;
}
} @else {
#{$properties}: $value;
}
}
}
}

I've made buttons work with just a basic width/height for now, but that needs to be refactored to be based off a single value to be able to set font size too.

@KaelWD KaelWD modified the milestones: v3.0.0-beta, v3.0.x Sep 8, 2022
KaelWD added a commit that referenced this issue Sep 8, 2022
see #15746, needs more work to set font-size too
@KaelWD
Copy link
Member

KaelWD commented Sep 15, 2022

Follow #15515 for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VBtn C: VChip T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

No branches or pull requests

2 participants