processing / processing/p5.js-web-editor

Discussion: `TextLink` component

Open
#2,947 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area: Code Quality Area: Design Needs Discussion
Dominant language
JavaScript
Stars
1.7k
Forks
1.7k
Avg merge
3d 4h
Merged PRs (30d)
8

Description

Tasks
  • Decide what our basic link style should look like - particularly the color (see comment re: contrast)
  • Determine the props API for the TextLink component based on how we want to customize the style for specific use-cases
  • Write the TextLink component
  • Rewrite existing links in the app to use TextLink

Increasing Access

We want to keep the codebase clean and keep the design consistent.

Feature enhancement details

We have had many issue recently relating to the visibility of text links throughout the app. I would like to centralize the discussion here.

The recurring problem is that it's not clear to the user that a certain text is a clickable link. We can improve this by changing the default style of the link as well as adding hover styles to make it look more interactive.

I don't want us to add lots of specific CSS to specific component because this is difficult to maintain. I think this is a good opportunity for us to expand our library of reusable core UI components with a TextLink. We might not want to have the exact same styles everywhere, so we'll want to have some props which can control styles.

The goal of this issue is to discuss our API for the TextLink component and finalize what props we want.

Depending on the API that we choose, the code might look like any of these:

<TextLink href={url} underline="hover" color="always">anchor</TextLink>
<TextLink href={url} underline="hover" color="primary">anchor</TextLink>
<TextLink href={url} primary bold>anchor</TextLink>

^ This last one uses boolean props and is concise but probably more confusing.

Ideas for props:

  • underline with values "always", "hover", "none" (what MUI uses)
  • color with values "always", "hover", "none" to apply the theme primary accent color (pink or yellow)
  • color with values "primary", "inherit", etc. to choose from multiple theme colors (what MUI uses)
  • primary as a boolean flag to make it pink (this wouldn't allow for pink-on-hover behavior)
  • bold with values "always", "hover", "none" ("hover"` shouldn't be used here, but keeps it consistent)
  • bold as a boolean flag
  • fontWeight with values "bold" or "inherit"
  • display with values "inline" (default) and "block"

Specific related issues:

  • #2734
  • #2812
  • #2940
  • #2943

References / how others handle this:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by reviewing the linked contrast discussion and the related issues (#2734, #2812, #2940, and #2943), then inspect existing link patterns in the app. The work is done when the TextLink API and default styling are agreed, the component exists, and existing links use it.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
accessibility, design, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.