-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Editor-wide link color change #4031
Copy link
Copy link
Open
Labels
Area: DesignFor UI/UX design updates, proposals, or feedbackFor UI/UX design updates, proposals, or feedbackArea:AccessibilityCategory for accessibility related features and bugsCategory for accessibility related features and bugsArea:CSSFor styling or layout issues handled with CSS/SASSFor styling or layout issues handled with CSS/SASSEnhancementImprovement to an existing featureImprovement to an existing featureHelp WantedWould love additional input or contributions!Would love additional input or contributions!Needs DesignRequires design input before moving forwardRequires design input before moving forwardNeeds DiscussionRequires further conversation or consensusRequires further conversation or consensusQuestionAny question open to discussion or input from the communityAny question open to discussion or input from the community
Metadata
Metadata
Assignees
Labels
Area: DesignFor UI/UX design updates, proposals, or feedbackFor UI/UX design updates, proposals, or feedbackArea:AccessibilityCategory for accessibility related features and bugsCategory for accessibility related features and bugsArea:CSSFor styling or layout issues handled with CSS/SASSFor styling or layout issues handled with CSS/SASSEnhancementImprovement to an existing featureImprovement to an existing featureHelp WantedWould love additional input or contributions!Would love additional input or contributions!Needs DesignRequires design input before moving forwardRequires design input before moving forwardNeeds DiscussionRequires further conversation or consensusRequires further conversation or consensusQuestionAny question open to discussion or input from the communityAny question open to discussion or input from the community
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:
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.