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

Fix global audio rtl close placement #780

Merged
merged 1 commit into from
Feb 2, 2022
Merged

Conversation

zackkrida
Copy link
Member

Fixes

Fixes #779 by @sarayourfriend

Description

Switches from using end-0, which doesn't seem to work correctly, to explicitly using rtl:left-0 ltr:right-0.

I think the end-0 css logic looks for any parent element that doesn't have a dir applied, so both of these styles are applied at once and specificity wins:

:not([dir="rtl"]) .end-0 {
    right: 0;
}

[dir="rtl"] .end-0 {
    left: 0;
}

Testing Instructions

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.

@zackkrida zackkrida requested a review from a team as a code owner February 1, 2022 20:07
@sarayourfriend
Copy link
Contributor

This should be fixed in the tailwindcss-rtl library once 20lives/tailwindcss-rtl#44 is closed I think?

In any case, using the built in Tailwind RTL/LTR utilities (even though they're experimental and liable to change) seems like a good way to fix this for now.

Copy link
Contributor

@sarayourfriend sarayourfriend left a comment

Choose a reason for hiding this comment

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

LGTM! Tested locally in both RTL and LTR modes and it works great. Will pair very nicely with #773.

@sarayourfriend sarayourfriend added 🕹 aspect: interface Concerns end-users' experience with the software 🛠 goal: fix Bug fix 🟨 priority: medium Not blocking but should be addressed soon labels Feb 1, 2022
@zackkrida
Copy link
Member Author

20lives/tailwindcss-rtl#44

Yep, that's exactly it, nice find! Glad to have it referenced here.

@zackkrida zackkrida requested a review from krysal February 2, 2022 00:39
@zackkrida zackkrida enabled auto-merge (squash) February 2, 2022 00:39
Copy link
Member

@dhruvkb dhruvkb left a comment

Choose a reason for hiding this comment

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

Why wouldn't end-0 work?!

@zackkrida zackkrida merged commit 271b5ed into main Feb 2, 2022
@zackkrida zackkrida deleted the global-audio-button-rtl-fix branch February 2, 2022 11:44
@zackkrida
Copy link
Member Author

@dhruvkb it's this issue: 20lives/tailwindcss-rtl#44

The basics are, given this html:

<html dir="rtl">
	<div>
		<span class="end-0"></span>
	</div>
</html

Our span has any parent element without a dir attribute, so both of the generated rules apply:

:not([dir="rtl"]) .end-0 {
    right: 0;
}

[dir="rtl"] .end-0 {
    left: 0;
}

rbadillap added a commit that referenced this pull request Feb 2, 2022
* main: (73 commits)
  Make audio/image pages without ids show a 404 (#768)
  Fix logo button paddings and simplify implementation (#767)
  Fix global audio rtl close placement (#780)
  Check for `null` localStorage explicitly (#763)
  Truncate global audio text to two lines (#773)
  New image details page (#682)
  Switch to path-based i18n routing (#701)
  Enable source maps in production (#755)
  Remove Jamendo and Wikimedia Commons from audio meta sources (#747)
  Use jed1x json format to correctly handle pluralization (#753)
  Fix logo color on error page layout (#752)
  Add homepage content switcher for mobile screens (#716)
  Add inline-start border to filters on desktop (#748)
  Fix header items not fitting in (#718)
  Expose `close` to popover content via slot props (#736)
  Truncate row layout audio titles (#735)
  Stop blocking on analytics requests (#715)
  Style links globally (#727)
  Refactor the usage of i18n result count computation (#707)
  Use `VPopover` for the content report form (#719)
  ...
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: medium Not blocking but should be addressed soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Global audio player RTL is slightly broken
3 participants