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

Editor pop-up editing symbols need to be theme BG color neutral #6451

Closed
2 tasks
weavertheme opened this issue Apr 26, 2018 · 11 comments · Fixed by #9683
Closed
2 tasks

Editor pop-up editing symbols need to be theme BG color neutral #6451

weavertheme opened this issue Apr 26, 2018 · 11 comments · Fixed by #9683
Assignees
Labels
General Interface Parts of the UI which don't fall neatly under other labels. [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@weavertheme
Copy link

weavertheme commented Apr 26, 2018

Issue Overview

There are a lot of pop-up symbols used in the editing content - the insert line, the block type symbols, the circled +, the move up down, etc. etc.

The color stylings for these symbols work okay for a white or light theme BG, but with a dark bg color (wihite on black, for example), then they simply become nearly invisible (especially when hovering). If the background of the theme is gray, then they can totally disappear.

Steps to Reproduce (for bugs)

  1. Use with a theme that supports Gutenberg and provides editor theme matching styling. (I only know of my own at the moment, but there will be more. White on black is still widely used.)
  2. Try to edit. The default symbol color and BG styling don't work.

Expected Behavior

Current Behavior

Possible Solution

  1. Find a color styling that will work with all BG colors. I would suggest putting solid bg on each item - like just a bit gray from white. Then the symbols would show on all bg colors.

  2. Force the theme to implement alternate editor symbol styling. If this is the solution, then providing a list of all the classes needed for all the editor symbols would really help. I didn't track down if the styling classes for the pop-up symbols are the same as the sidebars, but they must be different if a theme is to be able to style them separately.

A near final release of my theme with integrated Gutenberg support is available at:
Weaver Xtreme 4.0 Beta

Try with the Black and White subtheme.

Screenshots / Video

Sorry, my screen capture software has trouble grabbin popup items that go away when you move the mouse.

Related Issues and/or PRs

Todos

  • Tests
  • Documentation
@weavertheme
Copy link
Author

This can become a theme responsibility. I get decent results on any darker bg with:

/* editor block element controls */

.editor-block-mover__control,		/* The move up-down block mover control */
.editor-block-settings-menu,		/* The settings control on the right of a block */
.editor-inserter-with-shortcuts,	/* The shortcut icons on the right when inserting a new block */
.editor-block-list__empty-block-inserter	/* The circle-+ on a new block inserter */
{
    background:				#C0C0C0;
}

.editor-block-list__insertion-point-inserter::before {	/* insertion line - GB default background is #8f98a1 */
	border:					1px solid #909090;
    background:				#444444;
}

@chrisvanpatten
Copy link
Member

I believe this relates to #6406.

@weavertheme
Copy link
Author

weavertheme commented Apr 27, 2018

One more note: I find the border+bg for the insertion-point-inserter to be a better implementation than the pure bg color for the bar. Just seems to stand out a little better. I would recommend that the team consider a tweak to the inserter line.

@danielbachhuber
Copy link
Member

@weavertheme Does this issue still need more work or can it be closed?

@danielbachhuber danielbachhuber added the [Status] Needs More Info Follow-up required in order to be actionable. label Jun 27, 2018
@weavertheme
Copy link
Author

I think this is still a seriouos issue. If the theme has a dark background (a good test: bg hex values less than #888888 are "dark") AND styles the BG in the editor, the default control elements are nearly impossible to see. For example, the vertical 3 dots, the trash can, the + add new block, and so on.

But if the theme is adding style to the editor, then it could also include the CSS to re-style the above block editor styling. My concern is that these may change, or new elements might be added, making it hard to keep up with the necessary custom styling.

@jasmussen
Copy link
Contributor

So, this PR actually solves the situation for both light and dark themes: #6406 (comment)

Only — the dark theme feature isn't yet enabled. You can test it by providing an editor style with a dark background, and manually in the web inspector, adding is-dark-theme as a body class. This will invert the UI.

In other words, the way to address this issue is to enable those dark styles. I imagine two ways of doing this:

  • Through JavaScript magic divine what the background color of the theme is, and automatically add the is-dark-theme class.
  • Manually, i.e. the theme creator has to specify a variable somewhere to say "this theme is dark".

@youknowriad do you have any ideas on how best to do this?

@youknowriad
Copy link
Contributor

Manually, i.e. the theme creator has to specify a variable somewhere to say "this theme is dark".

This option would have my vote add_theme_support( 'dark-theme' ) or something

@jasmussen
Copy link
Contributor

Sounds good. Is that something I can build? ;)

@youknowriad
Copy link
Contributor

@jasmussen You can build everything :). We can pair if you need help

@jasmussen
Copy link
Contributor

@jasmussen jasmussen self-assigned this Aug 31, 2018
@designsimply designsimply added [Type] Enhancement A suggestion for improvement. [Status] In Progress Tracking issues with work in progress General Interface Parts of the UI which don't fall neatly under other labels. and removed [Status] Needs More Info Follow-up required in order to be actionable. labels Aug 31, 2018
jasmussen pushed a commit that referenced this issue Sep 7, 2018
This fixes #6451.

This PR enables a new command to themers. They can now add `add_theme_support( 'dark-theme' );` in order to ask the editing canvas to be friendly to dark themes.

What this does is add a body class to the editor, `is-dark-theme`, which enables already present color changes to the side UI and borders, that are friendly to dark themes.
@jasmussen
Copy link
Contributor

Created #9683 to fix this.

jasmussen added a commit that referenced this issue Sep 10, 2018
* Add dark editor style support

This fixes #6451.

This PR enables a new command to themers. They can now add `add_theme_support( 'dark-theme' );` in order to ask the editing canvas to be friendly to dark themes.

What this does is add a body class to the editor, `is-dark-theme`, which enables already present color changes to the side UI and borders, that are friendly to dark themes.

* Update documentation.

* Update theme support docs.

* Use dark-editor-style instead.

Hopefully this will help prevent confusion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
General Interface Parts of the UI which don't fall neatly under other labels. [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants