Skip to content

Make code buttons appear on hover (or tap on mobile)#1806

Merged
ehuss merged 2 commits into
rust-lang:masterfrom
ehuss:button-overlap
Jun 27, 2022
Merged

Make code buttons appear on hover (or tap on mobile)#1806
ehuss merged 2 commits into
rust-lang:masterfrom
ehuss:button-overlap

Conversation

@ehuss
Copy link
Copy Markdown
Contributor

@ehuss ehuss commented May 17, 2022

This changes it so that code buttons will appear on hover (similar to how many other sites like GitHub do it). This also has various tweaks to the overall spacing to give some more breathing room.

For implicit main, it no longer adds a blank line at top.

Closes #1322
Closes #1433

@ehuss ehuss force-pushed the button-overlap branch from 6be26f9 to 37d756a Compare May 17, 2022 02:27
@ehuss
Copy link
Copy Markdown
Contributor Author

ehuss commented May 17, 2022

Note that the ACE editor still has overlap (see comments for explanation).

I'd still consider hiding the buttons with a hover rule. It would also need a tap handler for mobile. I figure that is something that could possibly be added later. I kinda like the balanced vertical whitespace in this change regardless.

It still doesn't look great when the first line is long:

image

but I think this is a little bit of an improvement over the old.

@ehuss ehuss changed the title Adjust overlap of code buttons with code blocks. Make code buttons appear on hover (or tap on mobile) Jun 27, 2022
@ehuss
Copy link
Copy Markdown
Contributor Author

ehuss commented Jun 27, 2022

I'm going to go ahead and move forward with this. I haven't gotten much feedback, but I kinda like it overall.

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.

Stray spacing of code blocks containing injected main Buttons still overlap code

1 participant