Coder Social home page Coder Social logo

Comments (13)

petesfrench avatar petesfrench commented on June 8, 2024 1

@bartaz The request to have the headings clickable comes from the documentation team

from vanilla-framework.

bartaz avatar bartaz commented on June 8, 2024 1

We have the icon in code snippet component, it looks like a bug that it got replaced to chevon. We can bring it back.

image

from vanilla-framework.

danielmutis avatar danielmutis commented on June 8, 2024

WG: @petesfrench @juanruitina to provide a couple of examples of how this has been implemented in other DSs and we could look into commissioning a design for the icon.

from vanilla-framework.

juanruitina avatar juanruitina commented on June 8, 2024

I've had a look at a handful of websites that have heading anchor links:

  • All websites except MDN use the link icon (🔗). I suggest that we go ahead and commission that icon.
  • Most just link to the heading as we do. Only Google's copy the link to the clipboard. ✅
  • Only MDN and GitHub make the whole heading clickable as we do, most just make the icon clickable. But I don't think our approach does any harm.
  • Most show the icon on hover as we do ✅
  • Some show the icon to the left of the heading, some to the right. I'm not sure which approach is best, but it seems to the right is simpler, even if it can potentially result in wrapping. But maybe this requires some testing with real content.

Benchmarking

Discourse: icon to the left, shows on hover, only icon is linked, points to anchor

Screenshot 2024-04-03 at 11 35 10

Carbon design system: same as Discourse

Screenshot 2024-04-03 at 11 34 09

Apple Developer: same as Discourse (but icon to the right)

Screenshot 2024-04-03 at 11 52 28

React documentation: same as Discourse (but icon to the right)

Screenshot 2024-04-03 at 11 28 20

MDN Docs: hash to the left on hover, both heading and icon point to anchor

Screenshot 2024-04-03 at 12 14 58

GitHub documentation: icon to the right, always visible, both heading and icon point to anchor

Screenshot 2024-04-03 at 11 31 44:

Material: icon to the left shows on hover, copies link

Screenshot 2024-04-03 at 11 37 48

Google Cloud documentation: same as Material (unsurprisingly), icon to the right

Screenshot 2024-04-03 at 11 32 37

from vanilla-framework.

bartaz avatar bartaz commented on June 8, 2024

Gov.uk doesn't seem to use anchor links on headings. Headings have ids (so can be linked to), but anchor is only accessible via table of contents, not the heading itself.

https://www.gov.uk/government/news/bird-flu-avian-influenza-latest-situation-in-england#cases

image

from vanilla-framework.

bartaz avatar bartaz commented on June 8, 2024

@bartaz The request to have the headings clickable comes from the documentation team

Yes, I know. We are just gathering examples of how others are doing something similar.

from vanilla-framework.

juanruitina avatar juanruitina commented on June 8, 2024

Hold on, we do have a link icon in the Figma library! It just doesn't seem to be implemented. Could we just add it to Vanilla? @lyubomir-popov @bartaz

from vanilla-framework.

bartaz avatar bartaz commented on June 8, 2024

Hmm… we have the icon of that name, but it's a chevron… I can try to track down if that was a deliberate decision or just some mistake:

image

from vanilla-framework.

danielmutis avatar danielmutis commented on June 8, 2024

WG: Link icon is a good fit.

from vanilla-framework.

petesfrench avatar petesfrench commented on June 8, 2024

@bartaz What do we have to do to get this upstreamed to vanilla?

from vanilla-framework.

bartaz avatar bartaz commented on June 8, 2024

@petesfrench Create a PR and we can take it from there in review.

from vanilla-framework.

bartaz avatar bartaz commented on June 8, 2024

It may be good to verify it first by some local implementation on one of the docs websites, to see if that works as intended in the context of the docs.

from vanilla-framework.

bartaz avatar bartaz commented on June 8, 2024

@petesfrench What's the status of this? You had some PR for that on one of docs websites, but I don't know where it was and has it landed?

from vanilla-framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.