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

[Feature Request][3.0.0] Ability to add custom sizes (or just add xx-small) #14406

Open
glen-84 opened this issue Nov 16, 2021 · 5 comments
Open
Assignees
Labels
E: size Size composable T: feature A new feature

Comments

@glen-84
Copy link

glen-84 commented Nov 16, 2021

Problem to solve

It allows developers to add custom sizes for components like VAvatar.

Proposed solution

Some way to extend predefinedSizes here.

It's possible to adjust $size-scales via Sass, but the above code prevents the CSS class from being applied.

I'd like to add an xx-small size, which would render a 16px avatar. The alternative is for this to just be hard-coded as well, for others to use. If that's the case, then I can send a PR.

@glen-84 glen-84 added E: size Size composable T: feature A new feature and removed S: triage labels Nov 16, 2021
@johnleider
Copy link
Member

Is this still an issue?

@glen-84
Copy link
Author

glen-84 commented Jul 29, 2022

Is this still an issue?

I'm not currently working on the same project (or the front end at all right now), but it still seems like this could be useful to others. I don't see any changes to the code.

@KaelWD
Copy link
Member

KaelWD commented Jul 29, 2022

Did you actually have a requirement for more than five unique sizes? It's pretty simple to just set xs to 16px and adjust the others accordingly.

@glen-84
Copy link
Author

glen-84 commented Jul 30, 2022

Did you actually have a requirement for more than five unique sizes? It's pretty simple to just set xs to 16px and adjust the others accordingly.

I just looked through the design, and I see example usages of 16, 24, 32, 40, and 48px. I didn't see usage of 56px (although there was something at 52px, which we may have rounded up or down), but I didn't spend too much time looking.

I suppose we could have set x-large to 48px and dropped the 56px option. It's difficult to say.

If you'd prefer to close this issue now, I can re-open (or request re-opening) if I run into this in future.

@KaelWD
Copy link
Member

KaelWD commented Jul 31, 2022

We aren't using predefinedSizes for typescript or prop validation so it would be pretty simple to inject it instead, not sure where that should be configured though. Another option would be to flip the condition so if it's a valid number it gets used as a number and anything else just gets passed straight to ${name}--size-${props.size}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E: size Size composable T: feature A new feature
Projects
None yet
Development

No branches or pull requests

3 participants