Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Fix homepage RTL #796

Merged
merged 4 commits into from
Feb 7, 2022
Merged

Fix homepage RTL #796

merged 4 commits into from
Feb 7, 2022

Conversation

sarayourfriend
Copy link
Contributor

Fixes

Fixes #765 by @sarayourfriend

Description

Fixes the homepage RTL problems.

  1. The logo and brand mark were in a single SVG making it impossible for them to re-order based on reading direction. Splitting them into two separate SVGs makes this possible. It does make using them a little bit more of a hassle, but this shouldn't be something we're using in a bespoke manner more than a few times, so I don't see this as a maintainability problem. If these logos or brand marks ever change it'll require careful manual positioning fixes anyway regardless of if it's a single or two SVGs.
  2. Some non-RTL compliant positioning classes were being used, so this switches them to use the relative margin/padding classes.

Testing Instructions

Load up this branch and run pnpm dev.

  1. Visit / and verify that the homepage looks good at all screen widths
  2. Visit /ar and verify that the homepage looks good at all screen widths and that text is aligned
  3. Visit /404 and verify that the logo and brand mark look good
  4. Visit /ar/404 and verify that the logo and brand mark look good

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@sarayourfriend sarayourfriend added 🟧 priority: high Stalls work on the project or its dependents 🛠 goal: fix Bug fix 🕹 aspect: interface Concerns end-users' experience with the software labels Feb 3, 2022
@sarayourfriend sarayourfriend requested a review from a team as a code owner February 3, 2022 14:26
@@ -6,20 +6,29 @@
<header
class="flex-grow w-full lg:w-auto lg:min-w-[32rem] xl:min-w-[64rem] box-border flex flex-col justify-between lg:justify-center"
>
<VLogoButton class="lg:hidden ms-3" :auto-resize-logo="false" />
<VLogoButton
Copy link
Contributor

Choose a reason for hiding this comment

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

Neither header nor VLogoButton have a color class, so the color of the logo becomes black instead of dark charcoal.

@obulat
Copy link
Contributor

obulat commented Feb 7, 2022

Do we really need to change the logo direction? I couldn't find anything specifically on this, but Ahmad Shadeed's RTL-styling blog uses the same logomark for RTL, without changing direction, for Smashing Magazine: https://rtlstyling.com/posts/rtl-styling#3.-differences-in-word-sizes-between-languages .

@sarayourfriend
Copy link
Contributor Author

@obulat I don't think we necessary do, but in the case of the homepage, the LTR design looks very unbalanced and awkward with out a flipped logo mark. There's no sensible way to have the logo mark "hang" off the leading edge of the page like it does on the LTR version.

If @panchovm has any ideas of how to do this without flipping the logo and brand mark, then we can implement that. But as it stands I couldn't come up with anything that looked decent.

@obulat
Copy link
Contributor

obulat commented Feb 7, 2022

@obulat I don't think we necessary do, but in the case of the homepage, the LTR design looks very unbalanced and awkward with out a flipped logo mark. There's no sensible way to have the logo mark "hang" off the leading edge of the page like it does on the LTR version.

Oh, I didn't realize that this is mainly a solution to fix the "hanging" part of the large screen logo, thank you for explaining!

By the way, the color of the logo in the homepage header on screens smaller than lg is still black.

@fcoveram
Copy link

fcoveram commented Feb 7, 2022

I love ❤️ @sarayourfriend's solution of flipping the logo. It embraces the RTL logic as the most prominent use of Openverse will be through the symbol rather than symbol and wordmark. Therefore, switching positions is a great idea.

The reading logic is tricky as the openverse word still follows a LTR logic, but the symbol is directional-agnostic and can be placed without any word.

@sarayourfriend
Copy link
Contributor Author

@obulat thanks for catching that. How are you able to tell by the way? I can't figure out any way to determine the fill color of the SVG and visually I can't tell the difference between the dark-charcoal color and plain black.

@obulat
Copy link
Contributor

obulat commented Feb 7, 2022

I can see the difference in colors. I guess working closely with @panchovm on the header fixes helped me learn to pay more attention to colors and spacings 😀

@sarayourfriend
Copy link
Contributor Author

I envy your eyes then! I looked very hard and close and really couldn't tell the difference 😆 Thanks for lending your eyes 🙏

@fcoveram
Copy link

fcoveram commented Feb 7, 2022

Although let me say that @obulat's eagle eyes date longer than the header work.

@zackkrida
Copy link
Member

Monitor color profiles could also play a major role here 😆

Copy link
Member

@zackkrida zackkrida left a comment

Choose a reason for hiding this comment

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

This looks great, I do see one visual regression. Probably as a consequence of separating the logo text and icon, the logo text is no longer aligned with the rest of the content:

after

CleanShot 2022-02-07 at 12 40 37@2x

before

CleanShot 2022-02-07 at 12 45 42@2x

The simplest fix might be for the logo text to be in the same container as the other content, and for the logo icon to be absolutely positioned relative to that container.

@sarayourfriend
Copy link
Contributor Author

Ah, that's a much wider browser window configuration than I'm able to achieve with my current set up 😅 I definitely ran into similar problems but didn't realize the margins would keep moving as the view got even larger.

I'll try the absolute positioning trick you recomended.

@sarayourfriend
Copy link
Contributor Author

@zackkrida updated, please let me know if this works for you!

Copy link
Member

@zackkrida zackkrida left a comment

Choose a reason for hiding this comment

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

Looks perfect!

@sarayourfriend sarayourfriend merged commit 31ba457 into main Feb 7, 2022
@sarayourfriend sarayourfriend deleted the fix/homepage-rtl branch February 7, 2022 21:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🕹 aspect: interface Concerns end-users' experience with the software 🛠 goal: fix Bug fix 🟧 priority: high Stalls work on the project or its dependents
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RTL broken on homepage
4 participants