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

UI: Update colors for 7.0 #19023

Merged
merged 44 commits into from
Oct 6, 2022
Merged

UI: Update colors for 7.0 #19023

merged 44 commits into from
Oct 6, 2022

Conversation

MichaelArestad
Copy link
Contributor

@MichaelArestad MichaelArestad commented Aug 25, 2022

What I did

Updated the base colors, light color scheme, and dark color scheme.

Updates to base.ts:

  • Updated color.secondary, the monochrome colors, color.border, and background.app
  • Added status text colors, positiveText, negativeText, and warningText

Update to convert.ts:

  • Added button and boolean objects with their own customizable background/border colors. They fall back to input background colors, but overall should make theming form elements simpler.

Notes:

  • code/lib/components/src/Colors/colorpalette.stories.mdx seems to be broken, but is unrelated to this PR.

How to test

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

@@ -11,6 +12,7 @@ interface Return {
export const createReset = memoize(1)(
({ typography }: { typography: Typography }): Return => ({
body: {
color: color.defaultText,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this the correct place to set the body color?

Copy link
Member

Choose a reason for hiding this comment

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

Is it getting set elsewhere right now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@domyen It seems to not be set anywhere, though line 104 of that file looks like it MIGHT be a place that is supposed to set it, but isn't.

code/lib/theming/src/base.ts Outdated Show resolved Hide resolved
@@ -11,6 +12,7 @@ interface Return {
export const createReset = memoize(1)(
({ typography }: { typography: Typography }): Return => ({
body: {
color: color.defaultText,
Copy link
Member

Choose a reason for hiding this comment

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

Is it getting set elsewhere right now?

code/lib/theming/src/themes/dark.ts Outdated Show resolved Hide resolved
@domyen
Copy link
Member

domyen commented Aug 30, 2022

The new borders are tough to make out because they're a transparent mid-blue whereas the old border was transparent pure black. Can we darken them while keeping the blue tint?

Current:
image

Before:
image

@domyen
Copy link
Member

domyen commented Aug 30, 2022

It's tough to know which tab nav is hierarchically more important because the blue background contrasts the white and because it's the same color as the app background.

image

Can we differentiate the app bg from canvas subnav bg? Perhaps make it more transparent (opacity: .7)?

@MichaelArestad
Copy link
Contributor Author

The new borders are tough to make out because they're a transparent mid-blue whereas the old border was transparent pure black. Can we darken them while keeping the blue tint?

@domyen This was intentional to match the mockups and proposal. I will try increasing the contrast a touch.

It's tough to know which tab nav is hierarchically more important because the blue background contrasts the white and because it's the same color as the app background.

We decided to go this route when designing the Interactions addon. I can change this if you prefer a different background color.

@@ -6,11 +6,11 @@ const theme: ThemeVars = {

// Storybook-specific color palette
colorPrimary: '#FF4785', // coral
colorSecondary: '#1EA7FD', // ocean
colorSecondary: '#029CFD', // ocean
Copy link
Contributor

Choose a reason for hiding this comment

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

could be helpful to have another object which are aliases like

{
ocean: colors.colorSecondary
...
}

@@ -6,7 +6,7 @@ const theme: ThemeVars = {

// Storybook-specific color palette
colorPrimary: '#FF4785', // coral
colorSecondary: '#1EA7FD', // ocean
colorSecondary: '#029CFD', // ocean
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like these are shared between themes - could be exported as constants in base and used in the light and dark files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great! On it!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ran into a hiccup. I implemented it as you suggested, but convert.js gets a bit mad unless I add them there. I am not sure the best way to do that.

@@ -71,8 +71,11 @@ const Label = styled.label(({ theme }) => ({
},

'input:checked ~ span:last-of-type, input:not(:checked) ~ span:first-of-type': {
background: theme.background.app,
boxShadow: `${opacify(0.1, theme.appBorderColor)} 0 0 2px`,
background: theme.boolean.selectedBackground,
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like there are two conventions going on,

when I saw all the text prefixes like textMutedColor, textColor, etc I had an urge to comment that it could be text.muted etc.

I also see ones like positiveText, warningText etc. so maybe there are 3 naming conventions.

I know these came before this PR but just highlighting it in case this is an easy-ish time to standardize some

Copy link
Contributor

Choose a reason for hiding this comment

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

forgot about this specific line - it could be booleanSelectedBg or booleanSelectedBackground

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am hesitant to change the names of existing variables as I don't want to break user themes that rely on these names. I am open to suggestions on preferred naming schemes. If we do decide to rename them (breaking change), now is the time.

Copy link
Contributor

@JonathanKolnik JonathanKolnik left a comment

Choose a reason for hiding this comment

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

Just some consistency/ergonomics comments, overall looks good!

@MichaelArestad
Copy link
Contributor Author

Alrighty, I think this one is good to go. Any further refinements I will do in followup PRs.

@shilman shilman changed the title Update Storybook colors for 7.0 UI: Update colors for 7.0 Sep 7, 2022
@MichaelArestad
Copy link
Contributor Author

@shilman I believe this one is ready to go.

@shilman shilman assigned shilman and unassigned MichaelArestad Oct 5, 2022
@shilman shilman merged commit a2cdd73 into next Oct 6, 2022
@shilman shilman deleted the update-colors branch October 6, 2022 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants