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

Custom Admonition Icon: Resize and Center Vertically #10263

Open
baur opened this issue Jul 3, 2024 · 5 comments
Open

Custom Admonition Icon: Resize and Center Vertically #10263

baur opened this issue Jul 3, 2024 · 5 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution domain: theme Related to the default theme components

Comments

@baur
Copy link

baur commented Jul 3, 2024

Description

Custom icon for Admonition too small and not centrated by vertical

Cutom:

image

Default:

image

Visual comparing

image

Your environment

  • Docusaurus version used: 3.4
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): Chrome, Node v20
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Win10
@baur baur added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Jul 3, 2024
@slorber
Copy link
Collaborator

slorber commented Jul 10, 2024

Agee there is something wrong happening here

If the icon is smaller, it should stay aligned

Apparently it's not the case:

CleanShot 2024-07-10 at 15 07 20

Note: we had a previously slightly related PR here: #8150

@slorber slorber removed the status: needs triage This issue has not been triaged by maintainers label Jul 10, 2024
@Josh-Cena Josh-Cena added the domain: theme Related to the default theme components label Jul 10, 2024
@malik-na
Copy link

malik-na commented Jul 14, 2024

I reviewed the code and here are my observations:

  1. Because the icons are SVGs, you can't always center them using CSS on their wrapper element.
  2. SVG's dimensions need to be defined properly, i.e, x-axis, y-axis in viewBox and height and width in viewPort

Screenshot 2024-07-16 at 2 28 01 AM

  1. If the SVG dimesions are fixed, we can even remove the additional margin at the bottom (if required).

Screenshot 2024-07-16 at 2 09 22 AM

I would like to fix this but unfortunately couldn't locate the custom Icons, you mentioned above, in the repository.

@baur
Copy link
Author

baur commented Jul 15, 2024

This was emoji 💡

<Admonition type="tip" icon="💡" title="Did you know...">
  Use plugins to introduce shorter syntax for the most commonly used JSX
  elements in your project.
</Admonition>

@SamuvelRaja
Copy link

is this issue open?

@Shahab-16
Copy link

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution domain: theme Related to the default theme components
Projects
None yet
Development

No branches or pull requests

6 participants