-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Contrast Checker: check link color (#38100)
* Initial commit. Detecting the color of an A tag, if it exists and passing it to the ConstrastChecker Added base logic and tests. Very messy. To be optimzized. Don't hate me. * A WIP commit. Reducing logic complexity into a hook. Will be squished. * WIP to be squashed. Using hook * Reducing logic with passing tests. * Extracting ContrastCheckerMessage component * Extracting readable options * Update DOM query to find an A tag even if its nested in, say, a strong or em tag. * This commit refactors the contrast checker to accept an array of text colors. This is so it can handle checking multiple text/foreground colors on a single background, e.g., text, link and so on. Updating arguments and tests. * Reverting change in ContrastChecker props model. These things should be done iteratively as it touches too many parts, e.g. mobile. * Update packages/block-editor/src/components/contrast-checker/index.js Co-authored-by: Aaron Robertshaw <[email protected]> * Reorder dependencies Update comment so that it reflects what's going on in the code. Co-authored-by: Aaron Robertshaw <[email protected]>
- Loading branch information
1 parent
48da1d9
commit ca3c6da
Showing
3 changed files
with
285 additions
and
94 deletions.
There are no files selected for viewing
189 changes: 102 additions & 87 deletions
189
packages/block-editor/src/components/contrast-checker/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.