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

web docs: use of link that ends with #something should briefly highlight the function something #7299

Open
Anton-4 opened this issue Dec 2, 2024 · 5 comments · May be fixed by #7477
Open
Labels
intermediate issue Likely good for someone who has completed a few other issues

Comments

@Anton-4
Copy link
Collaborator

Anton-4 commented Dec 2, 2024

Usually this specific link scrolls to the function perfectly but you can't do this with the last functions, like with https://www.roc-lang.org/packages/basic-cli/0.17.0/Stdin#readToEnd

For that reason it would be good to highlight the function used in the link with something like a css background color transition, similar to this rust docs link: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.as_ptr

@Anton-4 Anton-4 added the intermediate issue Likely good for someone who has completed a few other issues label Dec 2, 2024
@kukimik
Copy link
Contributor

kukimik commented Dec 9, 2024

Doesn't this amount to adding a few lines to crates/docs/src/static/styles.css using the :target pseudo-class?

I'm asking because I'm surprised by the "intermediate issue" tag. Is there some trap in here?

something like a css background color transition

Or do you mean to use the CSS transitions and want to animate the background change? I think a simple, instant change of background color would be sufficient. I think this is what the Rust docs do.

@Anton-4
Copy link
Collaborator Author

Anton-4 commented Dec 10, 2024

In the rust docs there is a brief flash (you can see it on refresh), looks like it comes from here:

@keyframes targetfadein {
  from {
    background-color:var(--main-background-color);
  }
  10% {
    background-color:var(--target-border-color);
  }
  to {
    background-color:var(--target-background-color);
  }
}
:target {
  padding-right:3px;
  background-color:var(--target-background-color);
  border-right:3px solid var(--target-border-color);
}

I'm asking because I'm surprised by the "intermediate issue" tag. Is there some trap in here?

I think I was mostly leaving space for things are harder than they look from the outset :)

Or do you mean to use the CSS transitions and want to animate the background change? I think a simple, instant change of background color would be sufficient.

I think a brief background color flash is worth it, but we could do it in two PRs if you like.

@kukimik
Copy link
Contributor

kukimik commented Dec 10, 2024

In the rust docs there is a brief flash (you can see it on refresh),

Ah, right, didn't notice it.

I think a brief background color flash is worth it, but we could do it in two PRs if you like.

Ok. I'll give it a try if I find a moment. But I'm rather short on time, so if there is anyone interested in taking up the issue, then go ahead!

kukimik added a commit to kukimik/roc that referenced this issue Dec 16, 2024
kukimik added a commit to kukimik/roc that referenced this issue Dec 17, 2024
Anton-4 added a commit that referenced this issue Dec 17, 2024
Highlight current :target entry name (#7299)
@lishaduck
Copy link

@Anton-4, you didn't seem to think an animation was necessary over in #7299, so is this finished?

@Anton-4
Copy link
Collaborator Author

Anton-4 commented Jan 1, 2025

Thanks for alerting me @lishaduck :)
We can close this once this is resolved.

@kukimik kukimik linked a pull request Jan 7, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
intermediate issue Likely good for someone who has completed a few other issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants