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

Docs: Better alignment of icons #6421

Merged
merged 1 commit into from
Sep 14, 2022
Merged

Conversation

albertony
Copy link
Contributor

@albertony albertony commented Sep 4, 2022

What is the purpose of this change?

Better alignment of icons of different sizes

This reverts the changes from PR #5889 and #5701 and implements an alternative fix which is more "native" Font Awesome solution:

Font Awesome icons are designed on grid and share a consistent height. But they vary in
width depending on how wide or narrow each symbol is. If you prefer to work with icons
that have a consistent width, adding fa-fw will render each icon using the same width.

(https://fontawesome.com/docs/web/style/fixed-width)

The original solution had wrong css, as a result of misunderstanding the precedence of element,element and element element selectors, leading to an issue with icons in backend doc headers.

Before:

memory-before

After:

memory-after

As a bonus, it also gives slightly better results for the menu/dropdown icons which was the focus of the original PRs.

Before:

before

After:

after

Was the change discussed in an issue or in the forum before?

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

@albertony albertony self-assigned this Sep 4, 2022
@albertony albertony changed the title Docs: Align menu/dropdown items when icons have different sizes Docs: Better alignment of icons Sep 4, 2022
Fixes issue with spacing between icon and text in backend docs headers.

This reverts the changes from PR rclone#5889 and rclone#5701, which aligned menu/dropdown items when
icons have different sizes, and implements an alternative fix which gives slightly better
results, and also is more of a native Font Awesome solution:

Font Awesome icons are designed on grid and share a consistent height. But they vary in
width depending on how wide or narrow each symbol is. If you prefer to work with icons
that have a consistent width, adding fa-fw will render each icon using the same width.
@ncw
Copy link
Member

ncw commented Sep 6, 2022

On first glance this seems like a lot of repetition instead of a few lines of css?

If only you could include other css classes into a css class...

@albertony
Copy link
Contributor Author

I see what you mean, but... :) I think there are already repetition with all the fa fa-book etc. And I think it is just as clean with the fa-fw, letting it be handled by Font Awesome css, than the css width, alignment setting - which although more centralized, feels a bit like a hack (although I'm not a css guru, so it all feels a bit hacky at times... :)

Copy link
Member

@ncw ncw left a comment

Choose a reason for hiding this comment

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

OK I agree!

Let's merge :-)

@ncw ncw merged commit 6ce0168 into rclone:master Sep 14, 2022
@albertony albertony deleted the docs-icon-styling branch September 14, 2022 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants