Skip to content

Improve color indicators in style previews #59444

Closed

Description

@richtabor

Related to this comment by @ramonjd, I propose we adapt how the highlightedColors are chosen for style variations and associated UI. This way it's a clearer visual of the actual colors applied from the variation.

I'm thinking the first indicator should be the text color, with the second using the button color. If there's no button color, it would fallback to the text color, which is fine, as that variation may be more minimal. There would always be two indicators, maintaining consistency in the UI, reducing confusion.

This would also ensure that the color indicators have appropriate contrast values, as they are styled with the same values that are expected to have a high contrast value against the variation's background color.

These indicator colors should be the same for full theme style variations as well, not just instances of these 'mini' selectors.

CleanShot 2024-02-28 at 17 29 32

Activity

  1. added
    [Type] Enhancement
    [Feature] Theme Style Variations
    on Feb 28, 2024
  2. mtias commented on Feb 28, 2024

    @mtias
    Member

    Shouldn't button color fallback to link color instead of text?

  3. bgardner commented on Feb 28, 2024

    @bgardner

    Not sure how I feel about this suggestion TBH. I realize I'm an exception_not_the_rule with my choice of design. My Powder theme includes 22 style variations, but I still set the Buttons (block or element) background to Contrast (not any of the colors) and the same is true of Links. The colors in each palette are there for convenience sake. If this goes through, all 22 variations will essentially show black and black. Not ideal. A way around this is to update the background of Buttons (block or element) from Contrast to Primary, which would look better in the Site Editor (and WP.org theme page), but also result in unexpected/breaking changes for anyone using the theme.

  4. added
    [Status] In Progress
    on Mar 1, 2024
  5. richtabor commented on Mar 1, 2024

    @richtabor
    MemberAuthor

    Shouldn't button color fallback to link color instead of text?

    Yea, that makes sense to me.

  6. richtabor commented on Mar 1, 2024

    @richtabor
    MemberAuthor

    @bgardner how else would you suggest? Are the colors in the variations used in the variations, or just setting the palette?

  7. spencerfinnell commented on Mar 1, 2024

    @spencerfinnell

    Echoing my thoughts from a couple of years ago I still believe it would be nice for these "previews" to be defined by the theme author.

    block.json supports example, what about something similar in theme.json?

  8. bgardner commented on Mar 1, 2024

    @bgardner

    I like @spencerfinnell's suggestion. (If anything as primary method, fallbacks as described above would be ok.)

    This would allow me to show Contrast (Text) and the Primary (main accent) colors in each preview, which would be ideal in my case.

  9. richtabor commented on Apr 3, 2024

    @richtabor
    MemberAuthor

    I still believe it would be nice for these "previews" to be defined by the theme author.

    I don't think that's a bad idea, although I do think a better fallback for when themes don't would still be beneficial.

  10. richtabor commented on Apr 3, 2024

    @richtabor
    MemberAuthor

    Here's an example from TT4, using the proposed method here.

    I observe:

    • The results are less random, as the colors are consistently pulled from background, text, and button background (with link color as a fallback).
    • The previews are have appropriate contrast out-of-the-box, as text and buttons contrast with the background of the site/preview.
    Current Proposed
    CleanShot 2024-04-03 at 13 55 54 CleanShot 2024-04-03 at 14 11 58

    CleanShot 2024-04-03 at 14 13 24
    CleanShot 2024-04-03 at 14 13 44
    CleanShot 2024-04-03 at 14 13 54
    CleanShot 2024-04-03 at 14 14 04
    CleanShot 2024-04-03 at 14 14 13
    CleanShot 2024-04-03 at 14 14 21
    CleanShot 2024-04-03 at 14 14 31
    CleanShot 2024-04-03 at 14 14 43

  11. changed the title [-]Improve color indicators in style tabs[/-] [+]Improve color indicators in style previews[/+] on Apr 3, 2024
  12. bgardner commented on Apr 3, 2024

    @bgardner

    @richtabor Are we still considering allowing theme authors to specify in theme.json?

    The results are less random, as the colors are consistently pulled from background, text, and button background (with link color as a fallback).

    Because with Powder, whether it be button background or link color, all of my variations would essentially show black/black on white.

  13. spencerfinnell commented on Apr 3, 2024

    @spencerfinnell

    Possibly semi-related: #49661

  14. spencerfinnell commented on Apr 3, 2024

    @spencerfinnell

    Also semi-related if a new entry point for previews is added to theme.json (which seems very logical to me): #57286

  15. richtabor commented on Apr 3, 2024

    @richtabor
    MemberAuthor

    @richtabor Are we still considering allowing theme authors to specify in theme.json?

    Yes, I think it's worth considering; perhaps like block.json's example object.

    @spencerfinnell @bgardner What do you think that would look like ideally in theme.json?

  16. bgardner commented on Apr 3, 2024

    @bgardner

    @richtabor Could be as simple as:

    {
    	"settings": {
    		"preview": [
    			{
    				"colors": [ "#f5f5f5", "#0a0a0a", "#6d28d9" ]
    			}
    		]
    	}
    }
    
  17. richtabor commented on Apr 4, 2024

    @richtabor
    MemberAuthor

    @bgardner mind opening an issue up about that specifically? I don't want it to get lost.

  18. richtabor commented on Apr 4, 2024

    @richtabor
    MemberAuthor

    @richtabor Could be as simple as:

    Maybe just the highlight colors (the two circles), allowing the background to maintain as the background of the preview.

    I wonder if example works well, as it's closer to block.json, and maybe even top-level.

  19. justintadlock commented on Apr 4, 2024

    @justintadlock
    Contributor

    I'd be good with the proposed system as a default/fallback. It's definitely an improvement over what we have today.

    I'm in favor of the preview colors being customizable even more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Feature] Theme Style Variations[Status] In Progress[Type] Enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions