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

fix(NcCounterBubble): make it perfectly aligned circle #5948

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

ShGKme
Copy link
Contributor

@ShGKme ShGKme commented Aug 9, 2024

☑️ Resolves

  • With 1 digit in NcUserBubble the digit is not exactly in the middle
  • The problem is that 1em line height is bigger than actual digit height
  • Usually it is not a problem, but with a circle it looks better than it's perfectly in the middle
  • Using cap fixes the problem
  • cap is not well supported, so using 1em as a fallback

🖼️ Screenshots

🏚️ Before 🏡 After
image image
image image
Top padding is bigger than the bottom Padding is almost equal

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable
  • 3️⃣ Backport to next requested with a Vue 3 upgrade

Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
@ShGKme ShGKme added bug Something isn't working 3. to review Waiting for reviews design Design, UX, interface and interaction design labels Aug 9, 2024
@ShGKme ShGKme added this to the 8.16.1 milestone Aug 9, 2024
@ShGKme ShGKme self-assigned this Aug 9, 2024
@susnux
Copy link
Contributor

susnux commented Aug 9, 2024

Just to note: 1cap is the height of the capital letters. But digits often have an interleave (they are slightly bigger).

Can we not just make it min-width min-height 1em and center it? Then it is always perfect?

Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works, but see comment :)

@ShGKme
Copy link
Contributor Author

ShGKme commented Aug 9, 2024

and center it?

How?

@ShGKme
Copy link
Contributor Author

ShGKme commented Aug 9, 2024

To center it, you need to know the size and the position of the character relative to the container

@susnux susnux merged commit 93d1413 into master Aug 9, 2024
19 checks passed
@susnux susnux deleted the fix/NcCounterBubble--pixel-perfect branch August 9, 2024 18:17
@susnux
Copy link
Contributor

susnux commented Aug 9, 2024

/backport to next

@ShGKme ShGKme changed the title fix(NcUserBubble): make it perfectly aligned circle fix(NcCounterBubble): make it perfectly aligned circle Aug 19, 2024
@ShGKme ShGKme mentioned this pull request Aug 19, 2024
3 tasks
@susnux susnux mentioned this pull request Aug 20, 2024
@susnux susnux modified the milestones: 8.16.1, 8.17.0 Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working design Design, UX, interface and interaction design
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants