-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix copy path button #124041
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
Fix copy path button #124041
Conversation
Could not assign reviewer from: |
@GuillaumeGomez: no appropriate reviewer found, use |
Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @jsha |
This comment has been minimized.
This comment has been minimized.
|
||
#copy-path:before { | ||
#copy-path.clicked { | ||
font-size: 26px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems pretty fragile. It's dependent on font metrics to avoid making the button jump around, so you can easily mess it up and get layout jank.
Instead of using a text checkmark, could you use the SVG checkmark? That way, the .clicked
class can change the content: url
and nothing else, so it's obvious that it won't change the layout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I did originally but the checkmark svg is pretty ugly in this context. I'll look for another one instead.
8a69956
to
1ebc9ef
Compare
Changed the checkmark to svg. The CSS is much simpler now. :) |
@bors r+ rollup |
…n, r=notriddle Fix copy path button Currently, on all nightly docs, clicking on the "copy path" button triggers a JS error. It's because changes in rust-lang#123706 forgot to update the JS (it contained an image before but not anymore). I had to make some small changes in the CSS to fix the display when the button was clicked as well. r? `@notriddle`
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#124041 (Fix copy path button) - rust-lang#124047 (Match ergonomics 2024: miscellaneous code cleanups) - rust-lang#124064 (Move confusing comment about otherwise blocks in `lower_match_tree`) - rust-lang#124072 (Remove libc from more tests) - rust-lang#124090 (llvm: update riscv target feature to match LLVM 19) - rust-lang#124100 (fix: make `str::from_raw_parts_mut` `mut`) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#124041 (Fix copy path button) - rust-lang#124047 (Match ergonomics 2024: miscellaneous code cleanups) - rust-lang#124064 (Move confusing comment about otherwise blocks in `lower_match_tree`) - rust-lang#124090 (llvm: update riscv target feature to match LLVM 19) - rust-lang#124100 (fix: make `str::from_raw_parts_mut` `mut`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#124041 - GuillaumeGomez:fix-copy-path-button, r=notriddle Fix copy path button Currently, on all nightly docs, clicking on the "copy path" button triggers a JS error. It's because changes in rust-lang#123706 forgot to update the JS (it contained an image before but not anymore). I had to make some small changes in the CSS to fix the display when the button was clicked as well. r? ``@notriddle``
Currently, on all nightly docs, clicking on the "copy path" button triggers a JS error. It's because changes in #123706 forgot to update the JS (it contained an image before but not anymore).
I had to make some small changes in the CSS to fix the display when the button was clicked as well.
r? @notriddle