-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Colour Scheming: Replace Jetpack Variable #30232
Conversation
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.
Thanks for working on this! While this looks good to me (👍) we should clarify your question on how to address cases where we, at the moment, lighten or darken those brand colors.
client/blocks/login/style.scss
Outdated
@@ -2,7 +2,7 @@ | |||
.login { | |||
&.is-jetpack { | |||
.button.is-primary { | |||
background-color: $green-jetpack; | |||
background-color: var( --color-jetpack ); | |||
border-color: darken( $green-jetpack, 5% ); |
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.
@drw158 do you have feedback on how to address those? I'm not sure how I feel about lighten or darken brand colors but if we do so I guess we should pre-define them as the others, like --color-jetpack-light
or --color-jetpack-dark
.
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.
There's three different ones in total, btw:
darken( $green-jetpack, 30% );
darken( $green-jetpack, 5% );
lighten( $green-jetpack, 25% );
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.
@jeffgolenski We are replacing all scss variables with css custom props. I'm wondering if Jetpack has official shades of the Jetpack Green, or is it ok to generate a couple of shades for the purposes of the buttons in Calypso?
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.
@drw158 We only have one "official" jetpack green now. Feel free to explore some different shades as you see fit. the light and darken colors mentioned above aren't really official, but we use them in a couple places.
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.
If this is confined to just the button styles, I think defining dark and light colors for Jetpack is fine (-color-jetpack-light or --color-jetpack-dark). Jetpack is a unique case because its color is not from the Color Studio palette and thus doesn't have 10 shades like the other colors. Jetpack green is also unique because it needs more shades to create button styles.
Let's use #81d677
for light and #2e8928
for dark
} | ||
|
||
&:focus { | ||
box-shadow: 0 0 0 2px lighten( $green-jetpack, 25% ); | ||
box-shadow: 0 0 0 2px var( --color-jetpack-light ); | ||
} | ||
|
||
&[disabled], | ||
&:disabled { | ||
background: tint( $green-jetpack, 50% ); | ||
border-color: tint( $green-jetpack, 35% ); |
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'm not feeling too confident on if variables work here. If they don't, I'm a bit stumped on which to use for there to be a visible difference.
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.
We recently aligned disabled buttons to look the same across button types. I think that should be the same here as well. Compare with #30229.
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.
Thanks, added!
It seems like this branch doesn't build at the moment. The file Here's the complete error message (for
|
Sorry, forgot about those, switched now. |
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 think this should be good to go after addressing my comments.
In the long term we should use the actual <Button />
component and add Jetpack
styles (is-jetpack
?) there. I can see at least two different overrides while looking through the code. Not in the scope of this PR though.
client/jetpack-connect/style.scss
Outdated
background-color: $green-jetpack; | ||
border-color: darken( $green-jetpack, 5% ); | ||
background-color: var( --color-jetpack ); | ||
border-color: var( --color-jetpack-light ); |
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 should be --color-jetpack-dark
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.
My concern with changing these lights to dark would mean that the hover state wouldn't have a visible effect. Is it okay to lose that?
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.
My concern with changing these lights to dark would mean that the hover state wouldn't have a visible effect. Is it okay to lose that?
That concern is right 👍
The <Button />
component uses a lighter background color for hover states which I think would be appropriate here too. You could add (new) hover styles to work around this, though I think we then should rather use the actual <Button />
component instead of recreating it - the latter fits in the long term "vision" I mentioned in #30232 (review).
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've switched all the ones that you recommended to be dark.
You could add (new) hover styles to work around this
So I understand correctly here, do you suggest adding a new variable, perhaps --color-jetpack-hover
, so that there's a difference in hover styles currently?
.button.is-primary {
background-color: var( --color-jetpack );
border-color: var( --color-jetpack-dark );
&:hover,
&:focus {
border-color: var( --color-jetpack-dark );
}`
Just to clarify, my concern is that the hover border will be identical. From a really brief look, I don't think there's too a major issue with background colours on hover though.
In the long term we should use the actual component and add Jetpack styles (is-jetpack?) there.
Agreed, happy to take a stab at that after this!
So to just clarify, is this correct?
Background colours:
Normal state - Jetpack green
Hover/Focus state - Lighter Jetpack
Border colours:
Normal state - Dark Jetpack
Hover/Focus state - This PR currently proposes also Dark Jetpack, which seems off...but I think changing that would require a new variable. Perhaps --color-jetpack-hover
at #002508
which seems to be the one now, but I'm not certain about this.
For reference, here's the current styles.
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.
My suggestion is to align it with the current <Button />
implementation. Though we might need to introduce another light green color for hover states.
That's what the current <Button />
for e.g. a primary one looks like in terms of colors:
- normal:
- background:
--color-accent
- border:
--color-accent-dark
- background:
- hover:
- background:
--color-accent-400
(this one does not currently exist for Jetpack) - border:
--color-accent-dark
(border color doesn't change for hover)
- background:
/cc @drw158
I hope that makes it more clear. Let me know if you have further questions and I'll try to answer them accordingly.
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.
400 in Jetpack Green would be #57ca53
Let me know if you need any more!
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.
So currently, --color-jetpack-light
is being used five times, and only for hover or focus button styles, either as the background-color
or the box-shadow
. In that case, should the current #81d677
be replaced with #57ca53
?
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.
--color-jetpack-light
is not the same as --color-jetpack-400
(we need to define the latter separately with the value #57ca53
from #30232 (comment)
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.
In that case, should the current #81d677 be replaced with #57ca53?
The latter should be used for the button background color on hover.
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.
Thanks for confirming, just added some commits, let me know if that's what you're referring to. :)
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.
LGTM
This partially reverts commit 3f05571.
@@ -29,11 +29,11 @@ | |||
} | |||
|
|||
.jetpack-logo__icon-circle { | |||
fill: $green-jetpack !important; | |||
fill: var( --color-jetpack ) !important; |
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 caused #30469
Changes proposed in this Pull Request
Follow up to #30084, this PR should update most brand colours with variables. I've not removed
$green-jetpack
completely yet because there's a couple of cases where I'm not sure which variable to use due to thelighten/darken
effect, and I don't think variables will work there? This PR addresses all the other ones though.Testing instructions
There should be no visible changes, so does the code make sense?
Edit: Minor visible changes due to the darken/lighten variables being replaced
(cc @flootr, @drw158, @blowery)