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

Test instructions copy icon color should match the text color to ensure it matches the theme colors. #9773

Closed
brettshumaker opened this issue Nov 20, 2024 · 0 comments · Fixed by #9868
Assignees
Labels
focus: checkout payments priority: medium The issue/PR is medium priority—non-critical functionality loss, minimal effect on usability type: enhancement The issue is a request for an enhancement.

Comments

@brettshumaker
Copy link
Contributor

Description

When the test instructions include a copyable test card number, there's a copy icon beside the number. Currently, this is an SVG as the background image of an HTML element and is a static color (black). When the user clicks to copy the number and that's successful, the icon changes to a green checkmark. Ideally, both icons will match the text color based on the WooPayments computed styles for the theme so they don't blend in with the background.

Image
Image

Acceptance criteria

  • The "copy" icon matches the text color and is determined by the styles computed by WooPayments.
  • The "check" icon matches the text color and is determined by the styles computed by WooPayments.

Dev notes

I realize we can't directly affect the fill color of the SVG since it's being output as a background-image, but I think we can effectively achieve the same thing using masks. We'd need to ensure browser compatibility with all of the properties, but it could look something like this:

.icon-selector {
    mask-image: url('path/to/svg/copy.svg');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    background-color: var(--text-color-from-computed-styles);
}

Additional Context

This was mentioned in #9488 so I split it out into its own issue.

@brettshumaker brettshumaker added focus: checkout payments type: enhancement The issue is a request for an enhancement. labels Nov 20, 2024
@pierorocca pierorocca added the priority: medium The issue/PR is medium priority—non-critical functionality loss, minimal effect on usability label Nov 20, 2024
@gpressutto5 gpressutto5 self-assigned this Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: checkout payments priority: medium The issue/PR is medium priority—non-critical functionality loss, minimal effect on usability type: enhancement The issue is a request for an enhancement.
Projects
None yet
3 participants