Skip to content

Centralize brand color overrides for core buttons in login and signup #103611

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

Merged
merged 15 commits into from
May 26, 2025

Conversation

adamwoodnz
Copy link
Contributor

@adamwoodnz adamwoodnz commented May 21, 2025

Part of DSGCOM-92: Update primary buttons on 'Continue as user'

Proposed Changes

  • Move all color overrides for branding of core buttons in login and signup to the central overrides file
  • Add Blaze Pro orange to the central colors list so that it can be used in the overrides file
  • Fix Akismet login button story and Crowdsignal signup button story, which had outdated wrappers

Why are these changes being made?

As the design system grows it's helpful to have all the overrides for branding in a central place, see discussion.

Testing

This PR is a straight refactor apart from the Blaze Pro color variable creation, so it is largely a regression testing exercise.

Storybook

We have stories for the social buttons and login and signup buttons

Run yarn storybook:start

Instructions

For each brand:

  1. For each login link below, visit the page
  2. Check the branding of the primary button, social buttons and the stepper nav top right link button if applicable
  3. Check the same on the signup page
  4. Check the same on the magic login page

Note that button replacements are still in progress for Lost Password, Accept Email Invite and 2FA

Login links

WordPress.com
Crowdsignal
Jetpack Cloud
Jetpack Login
Woo
Blaze Pro
Akismet
A4A - Can't link due to GitHub OSS scan rules: go to automatt_c.com/for-agencies/ and click 'Log in'. Edit the URL and change the host to calypso.localhost:3000
Gravatar
WP Job Manager
VIP
Partner Portal - Can't link due to GitHub OSS scan rules: go to hosts.automatt_c.com and you should be redirected to log in. Edit the URL and change the host to calypso.localhost:3000
WP.Cloud - Can't link due to GitHub OSS scan rules: go to wp.cloud and click 'start here'. Edit the URL and change the host to calypso.localhost:3000

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

Copy link

github-actions bot commented May 21, 2025

@matticbot
Copy link
Contributor

matticbot commented May 21, 2025

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • blaze-dashboard
  • happy-blocks
  • help-center
  • notifications
  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug dsgcom-92-core-button-centralize-overrides on your sandbox.

@adamwoodnz adamwoodnz force-pushed the dsgcom-92-core-button-centralize-overrides branch from e13df7b to ce7ebc8 Compare May 21, 2025 22:24
@@ -49,20 +49,16 @@ body.is-section-signup {
--color-white: #fff;
--color-black: $colorBlack;
--color-gray: #50575e;
--color-orange: #ff6433;
Copy link
Contributor Author

@adamwoodnz adamwoodnz May 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to a central location

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@adamwoodnz adamwoodnz force-pushed the dsgcom-92-core-button-centralize-overrides branch 3 times, most recently from 54c3c18 to bf445ed Compare May 21, 2025 23:03
@adamwoodnz adamwoodnz self-assigned this May 21, 2025
@adamwoodnz adamwoodnz force-pushed the dsgcom-92-core-button-centralize-overrides branch from bf445ed to 22f4a4a Compare May 21, 2025 23:28
@adamwoodnz adamwoodnz marked this pull request as ready for review May 22, 2025 00:06
@adamwoodnz adamwoodnz requested review from ciampo and jasmussen May 22, 2025 00:07
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels May 22, 2025
@adamwoodnz adamwoodnz requested a review from mirka May 22, 2025 00:07
Copy link
Member

@jasmussen jasmussen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love a code check, but this seems an excellent centralized way to group overrides together so that they are at least collected in a central place.

Depending on brand feedback on the black "continue" link, this file could also be where we then let a black color for wp.com login live, yes?

/* A8C for Agencies */
.a8c-for-agencies {
.components-button {
--color-accent: var(--color-primary-40);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: instead of re-defining --color-accent and --color-accent-60, wouldn't it be more clear if we re-defined the --wp-components-color-* variables?

Re-defining --color-accent and ``--color-accent-60` adds an additional layer of indirection and it took me a moment to fully get what's going on.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I tend to agree, and I'm not entirely sure why we landed on this approach. The only benefit I can see is in theory if the product sets the accent color at a high level we get themed components without having to write overrides, eg. with

// class added to .layout
.a8c-for-agencies {
  --color-accent: var(--color-primary-40);
}

all A4A Buttons would now be themed, as Buttons have the global override set up. Other components without one would not.

If we did the same with

.a8c-for-agencies {
  --wp-components-color-accent: var(--color-primary-40);
}

this would affect all core components. Which is ideally what we'd want, but I haven't been comfortable making that wide a change, as there is just too much scope, with tangled styles and hard to reach screens. I haven't even been comfortable setting --color-accent at that sort of scope.

Writing an explicit override per component achieves the same, allowing a more targeted approach per component per brand.

.a8c-for-agencies {
  .components-button {
    --wp-components-color-accent: var(--color-primary-40);
  }
}

Does that make sense?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for expanding your thoughts — I agree!

Writing an explicit override per component achieves the same, allowing a more targeted approach per component per brand.

.a8c-for-agencies {
  .components-button {
    --wp-components-color-accent: var(--color-primary-40);
  }
}

Does that make sense?

This could be a good compromise — still a per component override, but with less indirection than the current approach. What you do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a good compromise — still a per component override, but with less indirection than the current approach. What you do you think?

Yep happy to go that route 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overrides are setting wp components vars directly now.

@adamwoodnz adamwoodnz changed the base branch from DSGCOM-92-fix-stepper-nav-link-button-color to trunk May 26, 2025 01:18
@adamwoodnz adamwoodnz requested a review from a team as a code owner May 26, 2025 01:18
@adamwoodnz adamwoodnz force-pushed the dsgcom-92-core-button-centralize-overrides branch from bae00e1 to 51bc1bf Compare May 26, 2025 01:22
@adamwoodnz adamwoodnz force-pushed the dsgcom-92-core-button-centralize-overrides branch from 51bc1bf to f4167b7 Compare May 26, 2025 01:28
@adamwoodnz adamwoodnz force-pushed the dsgcom-92-core-button-centralize-overrides branch from 26f0608 to 4778b97 Compare May 26, 2025 02:11
@adamwoodnz adamwoodnz force-pushed the dsgcom-92-core-button-centralize-overrides branch from 4778b97 to 77c2af1 Compare May 26, 2025 02:19
@adamwoodnz adamwoodnz merged commit ebf4d40 into trunk May 26, 2025
11 checks passed
@adamwoodnz adamwoodnz deleted the dsgcom-92-core-button-centralize-overrides branch May 26, 2025 21:19
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants