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] Better support for custom icon size in VAlert #20636

Open
J-Sek opened this issue Oct 29, 2024 · 2 comments · May be fixed by #20700
Open

[Feature Request] Better support for custom icon size in VAlert #20636

J-Sek opened this issue Oct 29, 2024 · 2 comments · May be fixed by #20700
Labels
C: VAlert VAlert S: has PR The issue has a pending Pull Request T: enhancement Functionality that enhances existing features

Comments

@J-Sek
Copy link
Contributor

J-Sek commented Oct 29, 2024

Problem to solve

Changing default icon size in VAlert is not convenient.

  • does not adapt to $alert-title-font-size
  • ignores defaults and requires #prepend slot to override size
  • requires spacing tweaks to align in VAlert without title

Demo

My current workaround: custom wrapper component that abstracts fixes

Proposed solution

  • respect defaults (e.g. VAlert: { VIcon: { size: 24 } })
  • or introduce new icon-size prop
  • properly align with text when there is no title
    • min-height: 32px; for .v-alert__prepend
    • and padding-block: 4px for .v-alert__content:not(:has(.v-alert-title))
  • (nice to have) support new SASS variable $alert-prepend-icon-size

See example with style adjustments

@MatthewAry MatthewAry added T: enhancement Functionality that enhances existing features C: VAlert VAlert and removed S: triage labels Nov 14, 2024
@MatthewAry
Copy link
Contributor

You could try using the prepend slot to work around this for now.

@J-Sek
Copy link
Contributor Author

J-Sek commented Nov 14, 2024

You could try using the prepend slot to work around this for now.

Not really, it requires full wrapper around VAlert and a way to recognize when the lines wrap.

In v2 icons were 24px in size, and this was not an issue (Codepen is slightly unstable, but maybe it loads for you - example)

All I want to say is that there is a room for improvement and I wish to know which solution would be preferred so I can move on and create a PR.

BTW. I just noticed another case when using clearable, title and no text - title is shifted down and misaligned with the icon, so I took another look and refined CSS changes (playground).

@J-Sek J-Sek linked a pull request Nov 14, 2024 that will close this issue
@MatthewAry MatthewAry added the S: has PR The issue has a pending Pull Request label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VAlert VAlert S: has PR The issue has a pending Pull Request T: enhancement Functionality that enhances existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants