-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[UI] Fix misalligned icons #25158
[UI] Fix misalligned icons #25158
Conversation
- On the pull request page, two icons were misaligned vertically with their text part. - This patch adds the simple flexbox trick with `align-items: center` to vertically center the children elements and adds `gt-ml-2` to the text, to add space between icon and text that would otherwise be removed because of `display: flex`.
Keeping adding "gt-df gt-ac" is not the right approach. If you search So, I do not think it's urgent to introduce this patch, I will propose a complete fix for SVG alignment. |
I'm okay with it. As I said earlier, SVG vertical centering with text has no univeral fix that works for every font and icon size. |
I think we can introduce a helper CSS class like this:
Then let the first "svg" get margin-right, the last "svg" get "margin-left", inside "svg" gets margin-left&margin-right. And we need to remove all "icon icon-oction" from code, it's a no-op IMO (IIRC the fomantic icon module had been removed) |
I don't mind the explicit
Agree, |
VS
I think the second one is better, and we can simply show it in the devtest page to let developers copy and reuse the code. And one more thing, there are still a lot of dropdowns, some of them still have problem with the arrow icon. |
I do believe this is not a complete fix for alle the messages that can appear in that box: @earl-warren can you give the other messages the same treatment? |
That's what I said "there are a lot" ..... I believe this problem needs a framework level support. |
I don't agree with introducing magical classes, they will hurt in the long run once requirements get more complex than "a button with an icon", just use the simple CSS helpers in these cases for now please. |
Sorry I don't understand the point"magical classes". If such design is called "magical", then every modern framework is full of magical classes. Are they all wrong? |
It depends, common classes can help when the use case can be clearly defined, but one must not make it excessive (like Fomantic). I do see a possibility of having a |
What do you think about: Use flex to align SVG and text #25163 ? |
Co-authored-by: silverwind <[email protected]>
Closing in favor of #25163 |
The complete fix is ready: Use flex to align SVG and text #25163 |
Fixes: https://codeberg.org/forgejo/forgejo/pulls/823