Skip to content

Allow linking to a specific card#148

Closed
merwok wants to merge 9 commits into
python-docs-translations:mainfrom
merwok-forks:add-card-anchors
Closed

Allow linking to a specific card#148
merwok wants to merge 9 commits into
python-docs-translations:mainfrom
merwok-forks:add-card-anchors

Conversation

@merwok
Copy link
Copy Markdown
Collaborator

@merwok merwok commented Nov 14, 2025

fixes #136

@merwok
Copy link
Copy Markdown
Collaborator Author

merwok commented Nov 14, 2025

two things missing:

  • adapt css so that there is a top padding so we can see the full card
  • add links somewhere: the language name maybe? (I would prefer this and not # or ⛓️ emoji so that all links have a different text (accessibility rule))

@StanFromIreland
Copy link
Copy Markdown
Member

Unfortunately the CI will fail because it only properly works on branches of this repo, I will open a PR to fix it.

@StanFromIreland
Copy link
Copy Markdown
Member

StanFromIreland commented Nov 14, 2025

adapt css so that there is a top padding so we can see the full card

I with manual testing I find a scroll-margin-top: 4.5rem; looks pretty good.

@merwok
Copy link
Copy Markdown
Collaborator Author

merwok commented Nov 14, 2025

Will that work if applied on the card div, not on the row?

@StanFromIreland
Copy link
Copy Markdown
Member

StanFromIreland commented Nov 15, 2025

When I tested, I added it to the card class, and it worked fine.

FYI, update the branch and the CI will go green.

@merwok merwok marked this pull request as ready for review November 17, 2025 14:19
@merwok
Copy link
Copy Markdown
Collaborator Author

merwok commented Nov 17, 2025

Looks nice on browser and (emulated) mobile.

Let me know if the last commit should be a separate PR (I assume you’ll squash merge this)

@StanFromIreland StanFromIreland self-requested a review November 17, 2025 16:28
@StanFromIreland
Copy link
Copy Markdown
Member

StanFromIreland commented Nov 17, 2025

My screenshots image image

Some thoughts, as for the last commit, I suggest removing that from this PR, I think it would also be better to have the full name rather than the language code. Yes, I will squash.

As for the linking, I can confirm it works fine on FireFox on Linux and on iOS with Safari. However, I think the bold blue text is now too "loud" for what it does, although this is quite difficult accessibility-wise I must admit. How about an icon that appears on hover/focus next to the heading, for example, something like like so?

@merwok
Copy link
Copy Markdown
Collaborator Author

merwok commented Nov 17, 2025

I tried this:

.card-title a:focus::after, .card-title a:hover::after {
  content: " 🔗";
}

but didn’t like it.

Another accessiblity rule: people decide to click on something before they move their mouse or finger, so essential information should not be available only on hover/focus.
Here I think we could add a line on top of the page like «To link directly to a card, click on or activate its title, then copy the link.»

The effect in your video is nice, but not discoverable enough. What about always having # in the title and adding the background colour effect on hover/focus?

@StanFromIreland
Copy link
Copy Markdown
Member

@merwok merwok marked this pull request as draft November 18, 2025 02:18
@merwok
Copy link
Copy Markdown
Collaborator Author

merwok commented Nov 18, 2025

Replaced by #156

@merwok merwok closed this Nov 18, 2025
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.

Allow linking to cards

2 participants