Skip to content

Editor-wide link color change #4031

@Izzy-Snyder

Description

@Izzy-Snyder

Increasing Access

Currently, small text hyperlinks don't have enough contrast in the editor in light or dark mode. The contrast is below the WCAG guidelines minimum ratio of 4.5:1.

Feature enhancement details

Proposal

I'm proposing to change the link color in the editor (p5js pink) in light/dark mode to meet contrast guidelines. One way of approaching this is to change the themes to match the p5js.org website, which does meet contrast guidelines for links. I would appreciate input on this as it somewhat affects the use of the main brand color (p5-pink) across the whole editor.

Background

The p5js.org website uses the colors --type-magenta #eb285f (which looks very similar to p5 pink #ed225d) in dark mode against a completely black background. and --type-magenta-dark #b20046 in light mode against a completely white background.

Color options to meet contrast guidelines

Light theme
--type-magenta-dark has a contrast ratio of 6.8:1 with the main background of the light palette (lighter: #fbfbfb), 6.2:1 with the console/modal background color (light: #f0f0f0), and 7:1 with other various backgrounds that are lightest (#ffffff). So it works on all the backgrounds as far as I can tell!

Dark theme
--type-magenta has under 4.5:1 contrast against darker (#1c1c1c) and dark (333333) which are the main background colors in the dark theme.

This could be addressed in a few ways:

  1. changing all the backgrounds that have links on them to darkest (#000) and link text to #eb285f
  2. use an existing color in the palette for links such as middle-light (#a6a6a6), medium-light (#d9d9d9), or contrast-pink (#ffa9d9) - all these have well over 4.5:1 contrast with dark (333333) and darker (#1c1c1c) which are the main background colors.
  3. add another color that looks similar to p5 pink but has sufficient contrast, like #FF6691 and use that for links on the existing backgrounds.

Contrast theme
Links are yellow which is high contrast already!

Other suggestions

All regular links should be underlined by default (so they're not indicated by color alone). They can also have the underline get thicker on hover like the fix used in this PR.

I would also suggest adding a variable to each theme for link text color.

Currently link color is set at the link level for each sass module, and it doesn't refer back to a variable for link color. This means that changing the link color is pretty tedious. Having one variable per theme to change would make that a lot more straightforward for future contributors.

Currently, links are styled by default with the placeholder link class, which uses inactive-text-color, and that gets overridden on actual links in each module. It seems like there should be different classes for actual links and links on buttons/menus, so that those can have consistent styling, but I'm not the most knowledgeable about CSS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: DesignFor UI/UX design updates, proposals, or feedbackArea:AccessibilityCategory for accessibility related features and bugsArea:CSSFor styling or layout issues handled with CSS/SASSEnhancementImprovement to an existing featureHelp WantedWould love additional input or contributions!Needs DesignRequires design input before moving forwardNeeds DiscussionRequires further conversation or consensusQuestionAny question open to discussion or input from the community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions