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.5] VBtn size as number does not affect font size #16288

Open
mcfarljw opened this issue Dec 18, 2022 · 3 comments
Open

[Bug Report][3.0.5] VBtn size as number does not affect font size #16288

mcfarljw opened this issue Dec 18, 2022 · 3 comments
Assignees
Labels
C: VBtn VBtn C: VRating VRating T: bug Functionality that does not work as intended/expected
Milestone

Comments

@mcfarljw
Copy link

mcfarljw commented Dec 18, 2022

Environment

Vuetify Version: 3.0.5
Vue Version: 3.2.45
Browsers: Chrome 108.0.0.0
OS: Mac OS 10.15.7

Steps to reproduce

Set the size property of the v-rating component to a numeric value. For example <v-rating :size="100" />.

Expected Behavior

The size of the icons increases to match the specified size.

Actual Behavior

The padding around the icon increases but the icon does not.

Reproduction Link

https://play.vuetifyjs.com/#eNqNkMtqAyEUhl/l9GymhWac0m4aTKC7vkEXNQuZmEHwhpohJOTdozgZkpCbLvTjP+dTzv8Og2/Jj3N1vxY4RRpaL12EIOLazZmR2lkfYQderGAPK281VKm0YoaZ1poQQYcOZjl/rX6FUhb+rFfLl+qNGUqKLokSRKGd4lEkAqD9hLv8AqSVQHNpBkq8lH3uiWWn2PMoTTenZLyWSoCxh5Sm+wYIcitmDBX3nWD4jHAwHGEIL4WbyU3lgx9eCqeD8aNpzm3XPDkeR5ehDJWSk2Hj/h0/66+6wXJ+4+IApYmbBw==

Other comments

#15746 seems to be the same issue but it doesn't seem like it was resolved by the mentioned VBtn fix #15515.

@johnleider johnleider added T: bug Functionality that does not work as intended/expected C: VRating VRating S: triage and removed S: triage labels Jan 22, 2023
@johnleider johnleider added this to the v3.x.x milestone Jan 22, 2023
@floroz
Copy link
Contributor

floroz commented Jan 30, 2023

I am taking a look at this one

@KaelWD KaelWD changed the title [Bug Report][3.0.5] VRating size property doesn't change the size of the icons [Bug Report][3.0.5] VBtn size as number does not affect font size Mar 18, 2023
@kappaflow
Copy link

kappaflow commented Mar 18, 2023

A possible temporary solution:

Setting font-size to v-btn helps to make the button ignore the parent font-size and to scale according to its own size and font-size: Example

In a similar way can be adjusted v-rating

@MetRonnie
Copy link
Contributor

MetRonnie commented Feb 27, 2024

Here is a function for scaling the icon according to the ratio of the default icon size relative to the default button size

function getFontSize (size) {
  return Number.isNaN(parseFloat(size))
    ? undefined
    : `${24 * size / 48 / 1.5 / 16}rem`
}

Playground

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

No branches or pull requests

6 participants