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

Add opacity to Ferris when hovering the code block #3755

Closed
wants to merge 3 commits into from

Conversation

RafaelKr
Copy link
Contributor

@RafaelKr RafaelKr commented Oct 25, 2023

Fixes #2893

This PR fixes an issue which can be experienced especially on mobile devices. In some cases Ferris overlays the code as it can be seen here:

photo_2023-10-25_09-05-36

This PR adds an opacity to Ferris as soon as the wrapper element (<pre>) is hovered.
On mobile the hover state is also given when the user taps an element. So if the user taps on the code, the container receives hover focus and Ferris becomes a little transparent. Then the user can see the code below.

photo_2023-10-25_09-47-35

When hovering Ferris itself (or clicking it on mobile) the transparency is removed and it becomes "solid" again.

If this PR will be accepted it would make sense to add a little notice explaining this behavior to the introduction chapter where Ferris is introduced. Edit: I added the note.

Touchscreen better describes what we actually mean. This also aligns it with the note in ch04-02-references-and-borrowing ("You can hover your mouse over the circles (or tap on a touchscreen)...")
@chriskrycho
Copy link
Contributor

Thanks! I agree that this is an issue, but I am not sure this is the right solution for it—among other things, because it will still get in the way of selecting the code under it—for example, to copy it. I am going to close this, but we would be happy to think about other possible solutions over on #2893! Let's discuss there before trying to implement further.

@chriskrycho chriskrycho closed this Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symbols can cover up code on smartphones.
2 participants