cloudfour / drizzle

A streamlined tool for developing, documenting and presenting UI pattern libraries.
https://cloudfour.com/thinks/introducing-drizzle/
MIT License
666 stars 32 forks source link

Patterns should have IDs (and perhaps some anchor helpers) #7

Closed tylersticka closed 8 years ago

tylersticka commented 8 years ago

It'd be nice to be able to link to a specific pattern heading on a collections page using a # hash URL.

gerardo-rodriguez commented 8 years ago

@tylersticka @erikjung

Trying to work through this one. My thought was to do something like this:

<h2 id="{{data.name}}">
  {{data.name}}
</h2>

The issue with this is the data.name could be something like List Elements. It should instead be list-elements. I imagine I need to create a handlebars helper to take care of this? If so, where does the helper get registered? I don't see (within Drizzle) any Handlebars helpers registered at all. Looking for some guidance. 😄

tylersticka commented 8 years ago

@mrgerardorodriguez I believe we manage that in a separate repo, and I think there may already be a helper for it: https://github.com/cloudfour/core-hbs-helpers/blob/master/lib/toSlug.js

gerardo-rodriguez commented 8 years ago

@tylersticka Bahahaha! Well then, thank you! 😁

gerardo-rodriguez commented 8 years ago

and perhaps some anchor helpers

Can you expand on this @tylersticka?

tylersticka commented 8 years ago

@mrgerardorodriguez Certainly!

Basically, I'm wondering if it would be beneficial to include some sort of <a> for the permalink to allow for easy copy-paste of the hash URLs.

I know we've already got text and labels and all sorts of stuff going on, so it may or may not be a good fit for something like this:

screen shot 2016-04-21 at 3 41 54 pm

It could be as simple as linking the pattern headings and creating a utility to override link styles until hover...

.u-hiddenLink:not(:hover, :focus, :active) {
  color: inherit !important;
  text-decoration: none !important;
}

Anyway, just some ideas!