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

Try: High-luminance default colors #20460

Closed
wants to merge 2 commits into from
Closed

Try: High-luminance default colors #20460

wants to merge 2 commits into from

Conversation

jasmussen
Copy link
Contributor

@jasmussen jasmussen commented Feb 26, 2020

These are colors that are explored through the G2 visual refresh (see #18667).

Screenshot 2020-05-11 at 12 30 00

The color change does a few things:

  • It is chosen and balanced against the rest of the visual refresh.
  • It reduces the overall color palette, removing secondary colors used for toggles or checkmarks, unifying on a single blue.
  • It increases contrast against white, quite a bit, which is good for toggles, focus, form widgets and buttons.

The new blue has a contrast of 5.61:1 compared to 4.57:1 for the previously used WordPress blue (#007cba).

Before:

Screenshot 2020-02-26 at 12 11 47

After:

Screenshot 2020-02-26 at 12 09 45

@github-actions
Copy link

github-actions bot commented Feb 26, 2020

Size Change: +584 B (0%)

Total Size: 825 kB

Filename Size Change
build/block-editor/style-rtl.css 10.5 kB +190 B (1%)
build/block-editor/style.css 10.5 kB +187 B (1%)
build/block-library/editor-rtl.css 7.25 kB +133 B (1%)
build/block-library/editor.css 7.25 kB +134 B (1%)
build/components/index.js 180 kB +2 B (0%)
build/components/style-rtl.css 17 kB +21 B (0%)
build/components/style.css 17 kB +22 B (0%)
build/edit-post/style-rtl.css 12.2 kB -16 B (0%)
build/edit-post/style.css 12.2 kB -16 B (0%)
build/edit-site/style-rtl.css 5.21 kB -14 B (0%)
build/edit-site/style.css 5.21 kB -14 B (0%)
build/edit-widgets/style-rtl.css 4.68 kB -9 B (0%)
build/edit-widgets/style.css 4.68 kB -9 B (0%)
build/editor/style-rtl.css 5.06 kB -15 B (0%)
build/editor/style.css 5.06 kB -12 B (0%)
ℹ️ View Unchanged
Filename Size Change
build/a11y/index.js 1.02 kB 0 B
build/annotations/index.js 3.62 kB 0 B
build/api-fetch/index.js 4.08 kB 0 B
build/autop/index.js 2.82 kB 0 B
build/blob/index.js 620 B 0 B
build/block-directory/index.js 6.61 kB 0 B
build/block-directory/style-rtl.css 760 B 0 B
build/block-directory/style.css 761 B 0 B
build/block-editor/index.js 102 kB 0 B
build/block-library/index.js 115 kB 0 B
build/block-library/style-rtl.css 7.37 kB 0 B
build/block-library/style.css 7.37 kB 0 B
build/block-library/theme-rtl.css 683 B 0 B
build/block-library/theme.css 685 B 0 B
build/block-serialization-default-parser/index.js 1.88 kB 0 B
build/block-serialization-spec-parser/index.js 3.1 kB 0 B
build/blocks/index.js 48.1 kB 0 B
build/compose/index.js 6.66 kB 0 B
build/core-data/index.js 11.4 kB 0 B
build/data-controls/index.js 1.29 kB 0 B
build/data/index.js 8.45 kB 0 B
build/date/index.js 5.47 kB 0 B
build/deprecated/index.js 772 B 0 B
build/dom-ready/index.js 568 B 0 B
build/dom/index.js 3.1 kB 0 B
build/edit-navigation/index.js 4.41 kB 0 B
build/edit-navigation/style-rtl.css 618 B 0 B
build/edit-navigation/style.css 617 B 0 B
build/edit-post/index.js 28 kB 0 B
build/edit-site/index.js 12.1 kB 0 B
build/edit-widgets/index.js 8.37 kB 0 B
build/editor/editor-styles-rtl.css 425 B 0 B
build/editor/editor-styles.css 428 B 0 B
build/editor/index.js 44.3 kB 0 B
build/element/index.js 4.65 kB 0 B
build/escape-html/index.js 734 B 0 B
build/format-library/index.js 7.63 kB 0 B
build/format-library/style-rtl.css 502 B 0 B
build/format-library/style.css 502 B 0 B
build/hooks/index.js 2.14 kB 0 B
build/html-entities/index.js 622 B 0 B
build/i18n/index.js 3.56 kB 0 B
build/is-shallow-equal/index.js 710 B 0 B
build/keyboard-shortcuts/index.js 2.51 kB 0 B
build/keycodes/index.js 1.94 kB 0 B
build/list-reusable-blocks/index.js 3.12 kB 0 B
build/list-reusable-blocks/style-rtl.css 226 B 0 B
build/list-reusable-blocks/style.css 226 B 0 B
build/media-utils/index.js 5.29 kB 0 B
build/notices/index.js 1.79 kB 0 B
build/nux/index.js 3.4 kB 0 B
build/nux/style-rtl.css 616 B 0 B
build/nux/style.css 613 B 0 B
build/plugins/index.js 2.56 kB 0 B
build/primitives/index.js 1.5 kB 0 B
build/priority-queue/index.js 789 B 0 B
build/redux-routine/index.js 2.85 kB 0 B
build/rich-text/index.js 14.8 kB 0 B
build/server-side-render/index.js 2.68 kB 0 B
build/shortcode/index.js 1.7 kB 0 B
build/token-list/index.js 1.28 kB 0 B
build/url/index.js 4.02 kB 0 B
build/viewport/index.js 1.84 kB 0 B
build/warning/index.js 1.14 kB 0 B
build/wordcount/index.js 1.18 kB 0 B

compressed-size-action

@@ -31,7 +31,7 @@ $medium-gray-text: #757575;
$light-gray-secondary: #ccc;
$light-gray-tertiary: #e7e8e9;
$theme-color: theme(button);
$blue-medium-focus: #007cba; // @todo: Currently being used as "spot" color. Needs to be considered in context of themes.
$blue-medium-focus: #3858e9; // @todo: Currently being used as "spot" color. Needs to be considered in context of themes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's try to find a way to compute this based on "theme" (otherwise the alternative schemes are a bit broken)

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 pushed a fix. There really aren't that many shades of blue used here, but what shades there are should take from this now, right?

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

What's the plan for WordPress Core here? I'm assuming we want to stay consistent. Should we create a trac ticket, make/core post for the next steps?

@ellatrix
Copy link
Member

😍 I like this a lot.

@mtias
Copy link
Member

mtias commented Feb 26, 2020

What's the plan for WordPress Core here? I'm assuming we want to stay consistent. Should we create a trac ticket, make/core post for the next steps?

I think core should overwrite the default one initially.

@SchneiderSam
Copy link

It looks fresher. I like it. And yes...please be consistent with core... 😍

@jasmussen
Copy link
Contributor Author

I updated to use theme colors, but kept the update to the default theme:

Screenshot 2020-02-27 at 11 18 02

Here's Sunrise:

Screenshot 2020-02-27 at 11 17 39

Here's Midnight:

Screenshot 2020-02-27 at 11 17 50

This brings an excellent segue to the conversation on the plan for the core project. Honestly, every color theme here deserves an update, not just the default one. The Midnight one is lovely, but the idea of using the red spot color for buttons is perhaps not the best, as it indicates "danger". That aspect is unchanged, but worth bringing up.

Matías plan makes sense:

I think core should overwrite the default one initially.

That is, we can move forward with the fresh blue for the Gutenberg project itself, but we create a Trac ticket to add CSS to the core project to override these colors back to the #007bca color that the rest of the admin interface ships with. This keeps things consistent, even if it does mean anyone using the block editor as part of WordPress will get the lower-luminance colors, and even if that means the majority of users won't see these blues in the near future.

It seems like a trac ticket to suggest that is the next step here?

@youknowriad
Copy link
Contributor

That is, we can move forward with the fresh blue for the Gutenberg project itself, but we create a Trac ticket to add CSS to the core project to override these colors back to the #007bca color that the rest of the admin interface ships with

I don't think it's a great idea personally, because that variable usage can change here. We can add new components using this variable or update existings ones but we won't think that we need to do a trac ticket for each one of these changes to update the override.

@jasmussen
Copy link
Contributor Author

I don't think it's a great idea personally, because that variable usage can change here. We can add new components using this variable or update existings ones but we won't think that we need to do a trac ticket for each one of these changes to update the override.

@youknowriad Here's an idea:

When we build the plugin we replace the color

Can you help me do that?

As it is now, there's a primary and a secondary color, that's all that's left, and the rewriting would need to do this:

#3858e9 → #007cba
#1635bb → #11a0d2

But we could even simplify the base-styles further, as you can see the G2 UI reduces the need for many colors. We could make it a single spot color that's used everywhere, so all we'd have to do is this:

#3858e9 → #007cba

Let me know what you think.

@youknowriad
Copy link
Contributor

@jasmussen When Core consumes the styles, they are already built into CSS, so it's not just a single place or two, it's everywhere the variable is used and the only way for Core to override is to add a stylesheet overriding all the places where the variable was used.

@mtias
Copy link
Member

mtias commented Mar 8, 2020

This would be before core. A different build for the playground and the plugin / core using a different base color.

@youknowriad
Copy link
Contributor

A different build for the playground and the plugin / core using a different base color.

Yes, this is potentially the solution. Have two separate CSS outputs for the packages. I wonder about the performance impact on the build time.

@mtias
Copy link
Member

mtias commented Mar 9, 2020

Would it make sense to run it only when creating the plugin bundle? (Then master would get the updated blue, but the plugin would get the WordPress blue.)

@jasmussen
Copy link
Contributor Author

Rebased this to just freshen it up:

Screenshot 2020-03-10 at 11 05 41

I could use help with the next steps.

@jasmussen
Copy link
Contributor Author

Rebased this and updated the screenshot in the PR ticket just as a refresher.

I love the new color, I think it would be a great default for contexts outside of WordPress.

But because it needs dev help to make that happen, I'm guessing this PR will go stale eventually, and so I extracted a small change into #22261 which can easily go in soon.

@jasmussen jasmussen added the Needs Dev Ready for, and needs developer efforts label May 11, 2020
Joen Asmussen added 2 commits May 11, 2020 14:29
These are colors that are explored through the G2 visual refresh (see #18667).

The color change does a few things:

- It is chosen and balanced against the rest of the visual refresh.
- It reduces the overall color palette, removing secondary colors used for toggles or checkmarks, unifying on a single blue.
- It increases contrast against white, quite a bit, which is good for toggles, focus, form widgets and buttons.

The new blue has a contrast of 5.61:1 compared to 4.57:1 for the previously used WordPress blue (#007cba).
@youknowriad
Copy link
Contributor

cc @gziolo since you were working on the CSS support for scripts.

For context: we need a way to generate the stylesheets for two color schemes. One style to be used on "Core" with the default core colors (existing colors), and one to be used in the plugin with the high-luminance default colors.

@gziolo
Copy link
Member

gziolo commented May 13, 2020

cc @gziolo since you were working on the CSS support for scripts.

For context: we need a way to generate the stylesheets for two color schemes. One style to be used on "Core" with the default core colors (existing colors), and one to be used in the plugin with the high-luminance default colors.

Does it mean, we want a different config depending on the context, i.e:

  1. One set of colors for that lands in packages and is consumed by WordPress core, 3rd party projects, or Storybook.
  2. The alternative set is used only by the Gutenberg plugin.

Do I get it correct?

@youknowriad
Copy link
Contributor

youknowriad commented May 13, 2020

@gziolo yes, I guess npm users might also want to opt-in into the "plugin's" set

@gziolo
Copy link
Member

gziolo commented May 14, 2020

Does it have to work like this forever or it's only until the plugin and WP core align? It's important because we could use process.env.WP_HIGH_LUMINANCE flag to control it if it's temporary :)

@youknowriad
Copy link
Contributor

I'm not sure how realistic is it to expect Core to use these colors everywhere anytime soon. That said, the requirement is that npm consumers could choose one or the other which means an env variable won't work, we'd need to ship both.

@gziolo
Copy link
Member

gziolo commented May 14, 2020

It feels like we could add a new section to @wordpress/base-styles next to default. You should know better how much work it would be to update postcss plugin to consume this section. I think you authored this plugin, didn't you?

@ellatrix
Copy link
Member

ellatrix commented Jun 6, 2020

I'd love this to happen. Is there anyone who could help out?

@jasmussen
Copy link
Contributor Author

I'd love this to happen. Is there anyone who could help out?

In #22727 (comment) we discussed how this PR might not be the approach we want to take after all.

The intent of this PR is to bake in the high luminance blue color by default, so environments that use the block editor outside of wp-admin inherit this color. But wp-admin should still override it with existing brand colors.

A slightly different approach would be to allow the environment that includs the block editor to provide this color, rather than rely on a default (which there might still be). This might involve some PostCSS magic that @gziolo has been thinking about. Ideally this should work in a way that is more conducive to theming — not with a ton of colors, maybe just a single spot color.

@youknowriad
Copy link
Contributor

A slightly different approach would be to allow the environment that includs the block editor to provide this color, rather than rely on a default (which there might still be). This might involve some PostCSS magic that @gziolo has been thinking about. Ideally this should work in a way that is more conducive to theming — not with a ton of colors, maybe just a single spot color.

Assuming it's fine to use CSS variables, the simplest solution here would be to use a CSS variable and change its value depending on the context. I know the #core-css folks on Core are experimenting with CSS variables for admin theme colors which would solve this issue.

@jasmussen
Copy link
Contributor Author

I'd love to move to a CSS variable.

@mtias
Copy link
Member

mtias commented Jun 8, 2020

How about creating a new separate color scheme for the admin?

@jasmussen
Copy link
Contributor Author

How about creating a new separate color scheme for the admin?

I.e. new blue by default but overridden by an admin color theme? That could work too.

@ellatrix
Copy link
Member

ellatrix commented Jun 8, 2020

Yes, it would be great to even have a new default and leave the rest alone for now.

@jasmussen
Copy link
Contributor Author

Closing in favor of #23048!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Dev Ready for, and needs developer efforts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants