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

Use an SVG image for clipboard instead of unicode character #85118

Merged
merged 1 commit into from
May 10, 2021

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: Rustdoc UI (generated HTML) labels May 9, 2021
@rust-highfive
Copy link
Collaborator

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 9, 2021
@notriddle
Copy link
Contributor

fill=currentColor isn’t going to work correctly with the IMG tag.

We should really switch to using an SVG sprite sheet for rustdoc icons, so all three icons can be loaded from one file, and so that we can inherit theme colors.

@GuillaumeGomez
Copy link
Member Author

They currently keep their color, whatever the theme.

@Nemo157
Copy link
Member

Nemo157 commented May 10, 2021

They currently keep their color, whatever the theme.

That's a problem

image

@Nemo157
Copy link
Member

Nemo157 commented May 10, 2021

It currently goes back to the old text clipboard icon after clicking (pretend this is a gif, I don't have a gif recorder on this pc 😀):

image
image
image

@GuillaumeGomez
Copy link
Member Author

Oh right! Good catch!

@GuillaumeGomez
Copy link
Member Author

Fixed all the mentionned issues.

@Nemo157
Copy link
Member

Nemo157 commented May 10, 2021

Looks good enough to start, @notriddle do you wanna open an issue about maybe moving to an SVG sprite sheet? I guess the major thing that would need checking is browser compatibility.

@bors r+

@bors
Copy link
Contributor

bors commented May 10, 2021

📌 Commit 7450f70 has been approved by Nemo157

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 10, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request May 10, 2021
…laumeGomez

Rollup of 4 pull requests

Successful merges:

 - rust-lang#84465 (rustdoc: Implement `is_primitive` in terms of `primitive_type()`)
 - rust-lang#85118 (Use an SVG image for clipboard instead of unicode character)
 - rust-lang#85148 (Fix source code line number display and make it clickable again)
 - rust-lang#85152 (Adjust target search algorithm for rustlib path)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c7e7de4 into rust-lang:master May 10, 2021
@rustbot rustbot added this to the 1.54.0 milestone May 10, 2021
@GuillaumeGomez GuillaumeGomez deleted the clipboard-svg branch May 10, 2021 21:16
@camelid
Copy link
Member

camelid commented May 11, 2021

This made the clipboard icon much larger and more distracting:

before

image

after

image

I felt concerned about it being too conspicuous before, but now it's even more so. Is there a way to make it smaller or lighter?

The docs.rs one is only shown for the crate root, not for every single item in the crate.

@GuillaumeGomez
Copy link
Member Author

I voluntarily made it bigger actually. XD

@camelid
Copy link
Member

camelid commented May 11, 2021

So could you make it smaller again? ;)

@Nemo157
Copy link
Member

Nemo157 commented May 11, 2021

Hmm, I don't see such a small icon on older docs, it looks like it's using system fonts so depends on what font is selected.

image

That said the new icon definitely is a bit bigger, I kinda like something like dropping the border and reducing the opacity (with some kind of hover state). Having an inline "button" border looks quite weird to me.

image

image

@GuillaumeGomez
Copy link
Member Author

Hum... Maybe @jsha has an opinion here? I personally don't mind changing to any of what was suggested so I'm definitely not the good person to pick one.

@jsha
Copy link
Contributor

jsha commented May 12, 2021

I like @Nemo157's proposal with the smallish, unobtrusive icon.

@GuillaumeGomez
Copy link
Member Author

Giving it a try then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants