-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Centralize brand color overrides for core buttons in login and signup #103611
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
e13df7b
to
ce7ebc8
Compare
@@ -49,20 +49,16 @@ body.is-section-signup { | |||
--color-white: #fff; | |||
--color-black: $colorBlack; | |||
--color-gray: #50575e; | |||
--color-orange: #ff6433; |
There was a problem hiding this comment.
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
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. |
54c3c18
to
bf445ed
Compare
bf445ed
to
22f4a4a
Compare
There was a problem hiding this 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 👍
There was a problem hiding this comment.
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.
bae00e1
to
51bc1bf
Compare
51bc1bf
to
f4167b7
Compare
26f0608
to
4778b97
Compare
4778b97
to
77c2af1
Compare
Part of DSGCOM-92: Update primary buttons on 'Continue as user'
Proposed Changes
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:
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