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

Add Anchored component #280

Merged
merged 4 commits into from
Apr 15, 2021
Merged

Add Anchored component #280

merged 4 commits into from
Apr 15, 2021

Conversation

kazk
Copy link
Member

@kazk kazk commented Apr 15, 2021

Usage:

import A from "@components/Anchored";
**<A id="foo">foo</A>**

See #157


https://deploy-preview-280--reverent-edison-2864ea.netlify.app/authoring/guidelines/kata#.novelty

kazk and others added 2 commits April 14, 2021 22:31
Usage:

```jsx
import A from "@components/Anchored";
<A id="foo">foo</A>
```

Note that Markdown cannot be used inside. The bold style can be turned
off with `bold={false}`.

See #157
@kazk kazk requested a review from hobovsky April 15, 2021 05:44
Copy link
Contributor

@hobovsky hobovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay great! It looks soooo nice, but some questions from me:

  • Does it have to be styled with a red squiggle? For a moment I thought I am looking at my browser's spell checker being triggered by something i the new docs. If it has to be a squiggle, I'd make it not as similar to existing things (i.e. browser spellcheck mark), or maybe highlighting similar to the one from Chrome (https://www.theverge.com/2020/6/4/21280115/google-search-engine-yellow-highlight-featured-snippet-anchor-text)
  • There's a mark to click on to grab the link, cool!
  • Would the anchor work when empty, just ID without text? I get nothing would get highlighted then, but would it still be possible to be linked to it, and grab its link?
  • I think what when not triggered, initial styling should be neutral. Styling could still be driven by Markdown outside of the anchor, right?

@kazk
Copy link
Member Author

kazk commented Apr 15, 2021

Does it have to be styled with a red squiggle?

No, it's just using the primary brand color at the moment. The wavy line was chosen because it's rarely used on web and stands out while not being too much. I don't have a strong opinion, we can try other styles.

Would the anchor work when empty, just ID without text?

Yeah

I think what when not triggered, initial styling should be neutral. Styling could still be driven by Markdown outside of the anchor, right?

Oh, I didn't realize that's valid. I'll change it.

@kazk
Copy link
Member Author

kazk commented Apr 15, 2021

image

Yellow/Amber on dark mode makes it difficult to read, so:

image

@kazk kazk merged commit c1f313b into master Apr 15, 2021
@kazk kazk deleted the feature/add-anchored-component branch April 15, 2021 09:59
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.

2 participants