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

Style Book: Iterate on presentation and design. #53431

Open
jameskoster opened this issue Aug 8, 2023 · 15 comments
Open

Style Book: Iterate on presentation and design. #53431

jameskoster opened this issue Aug 8, 2023 · 15 comments
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.

Comments

@jameskoster
Copy link
Contributor

jameskoster commented Aug 8, 2023

stylebook

Designs in this issue are created by @beafialho. Figma.

Sections

Pages

The main goal of this refresh is to better organize the blocks that make up your site into a representation of the book of style for your site. Organize into what could have been a design manual. This work includes:

  • “Landing” tab that would serve as the landing page of the stylebook. A short page, displaying only blocks that more commonly and immediately are able to represent the theme.
  • Rearranging the order of the blocks by level of relevancy: seek out an order that makes the most sense when editing a website.
  • Adding subcategories that would organize blocks better within each tab. For example the “Theme” tab would contain “Site Identity”, “Posts” and “Comments”.
  • Updating demo content, mostly images and media maintaining a more cohesive connection between them, but also headings, paragraphs and quotes.

This video shows a scrolled prototype of how these could work:

style_book_tabs.mp4

The landing page would be useful for the current iteration of the Site View, which does not feature tabs at all.

This landing page would also serve as a quick glancable "poster view" for the site style guide. Here is how that could look, as applied across three different themes:

poster-view

Finally it would serve to have deep-links to the other tabs, e.g. clicking "Headings" would take you to the Text tab:

style-book-where-areas-link-to

To afford this structure, the new categories, Color and Theme would benefit orientation. Here is a suggestion how we could reorganize existing blocks, as well as include all the site-specific blocks in those taxonomies.

Categories

Selecting blocks / sections

Here are two different suggestions for when we click each block: one similar to the current state and one that takes advantage of the labels.

Headings:

style_book_hover_2.mp4

Existing:

style_book_hover.mp4

In both cases, currentColor would be leveraged for the selection style.

Tasks

Suggested tasks related to this:

  • Implement a style book landing page.

  • Reorganize blocks into the proposed categories.

  • Apply the new structure and layouts to each of the pages.

  • Apply the new selection style.


Additional opportunities

There are many improvements that can be made across global styles and the style book, for that reason, this issue has been focused primarily on the content inside the frame. There are a couple of additional opportunities to explore, they are likely best done separately, but mentioned here for completeness.

Invoking and browsing the Style Book

The designs include a clearer separation of content and manipulation, moving the tabs to the top toolbar:

Tabs

Behavior(s) in site view

Related to invoking and browsing, there are opportunities here to review how that's meant to work in a more holistic sense. There's a larger conversation about this in #53483, where this view shows one path forward.

This recognizes that the on-canvas interactions (such as click the Quote block to style just that) as well as the tabs are not available in the Site View.

On-canvas interactions

Some blocks, like Button, have hover and active states. Other blocks, like Details and Navigation, have expanded states. How those states are visualized is likely also best explored separately.

Revisions

Revisions

Side by side revisions are tracked separately in #53484, and when these are viewed the same Style Book button should invoke a side by side revisions history.


Please share your thoughts! This issue has been updated April 16th.

Previously:

Considerations:

  • Invoking and browsing the Style Book
  • Behavior(s) in site view
  • On-canvas interactions
    • Display of block variations
    • Display of block states like hover/active
  • Command Palette suggestions
@jameskoster jameskoster added [Type] Enhancement A suggestion for improvement. Needs Design Needs design efforts. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Aug 8, 2023
@ramonjd

This comment was marked as outdated.

@jameskoster

This comment was marked as outdated.

@annezazu

This comment was marked as outdated.

@jasmussen jasmussen added Needs Design Feedback Needs general design feedback. and removed Needs Design Needs design efforts. labels Apr 16, 2024
@jasmussen
Copy link
Contributor

Thanks to beautiful work by @beafialho, I've updated this issue with designs attached. There's a lot to dive into, you can explore the linked Figma, but for now the main focus has been on updating the book itself, what's inside the frame. Especially on that, please share your thoughts. CC: @WordPress/gutenberg-design

@jasmussen jasmussen added Needs Dev Ready for, and needs developer efforts and removed Needs Design Feedback Needs general design feedback. labels Apr 29, 2024
@vcanales
Copy link
Member

I've been looking into these designs and I have a few questions and thoughts:

A “Landing” tab that would serve as the landing page of the stylebook. A short page, displaying only blocks that more commonly and immediately are able to represent the theme.

How are we going to define which blocks comprise this list?
Should we build a static page that displays these blocks, or will we use block.json to feature the blocks in the Landing page somehow? Currently, the Style Book renders blocks into each tab according to the category attribute in block.json, and only if they include an example attribute as well.

  • Rearranging the order of the blocks by level of relevancy: seek out an order that makes the most sense when editing a website.

How and where are we going to define this hierarchy? Blocks in the styles book are currently rendered in the order in which they are registered, if I'm not mistaken.
I'm thinking that the Landing Page might become outdated if we rely on a static list of blocks ie. if we add future important blocks, we'd also have to update the landing page manually.

  • Adding subcategories that would organize blocks better within each tab. For example the “Theme” tab would contain “Site Identity”, “Posts” and “Comments”.

This might be an answer to the first question; we could add a subcategory which the Landing Page compiles blocks from. The keywords attribute is another candidate.

  • Updating demo content, mostly images and media maintaining a more cohesive connection between them, but also headings, paragraphs and quotes.

Demo content is mostly the placeholders for each block, currently. I think we could be taking further advantage of the example metadata attribute to create richer previews.

@jasmussen
Copy link
Contributor

Thank you for looking, @vcanales!

How are we going to define which blocks comprise this list?

We'd manually curate this list according to the suggestions in the mockups.

How and where are we going to define this hierarchy? Blocks in the styles book are currently rendered in the order in which they are registered, if I'm not mistaken.

How are we curating these?
Screenshot 2024-07-31 at 12 50 28

Essentially we only need a few of the blocks to be "prioritized" in a particular order, and after those, anything else can show up.

I'm thinking that the Landing Page might become outdated if we rely on a static list of blocks ie. if we add future important blocks, we'd also have to update the landing page manually.

The landing page should specifically have a goal of giving you a sense of the site design. To that end, this can be thought of more like a highly curated and stylized "style card", like this:

Screenshot 2024-07-31 at 12 53 48

It wouldn't need to be updated that often, in part because we don't often add new blocks, in part also because it is intentially a subset. If you want to see all the blocks, you have to dive into the tabs.

Demo content is mostly the placeholders for each block, currently. I think we could be taking further advantage of the example metadata attribute to create richer previews.

This is likely fine to separate out exactly as you suggest, and not make part of this particular task. We definitely need to enrich the demo content across the board, update the current preview images, etc.

vcanales added a commit that referenced this issue Aug 22, 2024
As discussed in the ongoing [GitHub issue #53431](#53431), the current implementation of block categories in WordPress allows for a flat structure where blocks are grouped into high-level categories such as "text," "media," "design," etc. However, as the ecosystem of blocks grows, this flat structure becomes increasingly difficult to manage and navigate, especially when dealing with more complex themes and plugins.

Subcategories offer a solution by allowing blocks to be further organized within parent categories, adding valuable granularity. In this proposal, I’m suggesting an addition to the `block.json` schema that enables the use of subcategories and constrains their assignment to specific parent categories. This approach ensures a well-documented and structured categorization system, preventing misuse and maintaining consistency across blocks.

\### Proposed Schema

1. **Explicit Subcategory Definitions**: Define which subcategories belong to which parent categories. This ensures that only relevant subcategories are available within a given parent category, enhancing the organization and discoverability of blocks.
2. **Schema Validation Enhancements**: Modify the JSON schema to allow references between categories and their allowed subcategories. For instance, a subcategory could reference its parent category, ensuring that only blocks that belong to a valid parent-child relationship can be categorized accordingly.
3. **Granularity in Block Organization**: By enforcing these relationships, extenders will be able to categorize blocks more precisely, making the block inserter more helpful and user-friendly. This would be particularly beneficial in large projects with numerous blocks, where the ability to filter and search based on subcategories could enhance their discoverability.

\### Benefits

- **Improved User Experience**: Users can more easily find and insert blocks into their content, as blocks will be categorized in a way that makes logical sense.
- **Developer Control**: Developers gain more control over how their blocks are presented to users, allowing for a more curated and intentional block browsing experience.
- **Consistency Across Themes and Plugins**: By standardizing how categories and subcategories are defined and used, there will be greater consistency across themes and plugins, leading to a more predictable user experience.
vcanales added a commit that referenced this issue Aug 22, 2024
As discussed in the ongoing [GitHub issue #53431](#53431), the current implementation of block categories in WordPress allows for a flat structure where blocks are grouped into high-level categories such as "text," "media," "design," etc. However, as the ecosystem of blocks grows, this flat structure becomes increasingly difficult to manage and navigate, especially when dealing with more complex themes and plugins.

Subcategories offer a solution by allowing blocks to be further organized within parent categories, adding valuable granularity. In this proposal, I’m suggesting an addition to the `block.json` schema that enables the use of subcategories and constrains their assignment to specific parent categories. This approach ensures a well-documented and structured categorization system, preventing misuse and maintaining consistency across blocks.

\### Proposed Schema

1. **Explicit Subcategory Definitions**: Define which subcategories belong to which parent categories. This ensures that only relevant subcategories are available within a given parent category, enhancing the organization and discoverability of blocks.
2. **Schema Validation Enhancements**: Modify the JSON schema to allow references between categories and their allowed subcategories. For instance, a subcategory could reference its parent category, ensuring that only blocks that belong to a valid parent-child relationship can be categorized accordingly.
3. **Granularity in Block Organization**: By enforcing these relationships, extenders will be able to categorize blocks more precisely, making the block inserter more helpful and user-friendly. This would be particularly beneficial in large projects with numerous blocks, where the ability to filter and search based on subcategories could enhance their discoverability.

\### Benefits

- **Improved User Experience**: Users can more easily find and insert blocks into their content, as blocks will be categorized in a way that makes logical sense.
- **Developer Control**: Developers gain more control over how their blocks are presented to users, allowing for a more curated and intentional block browsing experience.
- **Consistency Across Themes and Plugins**: By standardizing how categories and subcategories are defined and used, there will be greater consistency across themes and plugins, leading to a more predictable user experience.
@mtias
Copy link
Member

mtias commented Aug 31, 2024

@jasmussen @beafialho this is looking wonderful. I agree we should focus an iteration on the contents and landing screen, and then revise navigation and frame, which is in need of a deeper look now that the design of the site editor has continued to evolve.

@ramonjd
Copy link
Member

ramonjd commented Sep 9, 2024

we should focus an iteration on the contents and landing screen

I've started looking at reorganizing the style book categories.

I'm thinking a first pass will be to refactor the way the style book displays categories and blocks, to make it flexible and easy to update, and then refine in follow ups.

Most of the following points are for later, but I'm just jotting down some notes/questions:

Layout category/Landing tag

I gather initially, there'd be a static list of blocks or even a pattern or two to display here.

It's mentioned that these will be blocks that show off the theme style. Down the line, should the theme be able to include their own?

Blocks that contain other blocks / Patterns

Some blocks normally live in other blocks, some are:

  • Buttons > Button
  • Navigation. > Navigation link
  • Query pagination > Next and Previous.
  • Comments pagination. Next and previous, and page numbers, etc

Not sure how it would affect navigation yet, but maybe these blocks could be displayed in mini patterns. Examples already exist for some, but others have none. Perhaps there are some custom Core patterns we could create/borrow to highlight blocks that go together, e.g., a comments pattern, to avoid displaying individual blocks just as comments next link.

Custom blocks/categories

What about custom categories and blocks from plugins and themes? We should append the categories to the tab list?

Where there are too many categories for a single row of tabs, off-canvas category tabs could be converted into a drop down, or scroll arrows. This could be dynamic, e.g., checking for element visibility or something.

By the way, what is the Text > Custom link block? 🤔 I can't seem to find it.

@jasmussen
Copy link
Contributor

Buttons > Button
Navigation. > Navigation link

Worth here connecting dots with mockups shown here that expand on what gets shown for navigation items. Notably, it explodes the navigation item into one unit for each state, hover, focus, current, etc.

That's not to necessarily to block this work, just important to keep in mind. There are some mockups that potentially affect this work too, in this Figma.

By the way, what is the Text > Custom link block? 🤔 I can't seem to find it.

@beafialho in case you have a moment. Ramon is referring to this one.

@ramonjd
Copy link
Member

ramonjd commented Sep 9, 2024

Worth here connecting dots with #38277 (comment) that expand on what gets shown for navigation items. Notably, it explodes the navigation item into one unit for each state, hover, focus, current, etc.

Nice! Thanks for cross-linking that work.

I can work with reasonably little detail initially - I think it's a good opportunity to set the style book up for flexibility. By that I mean, create a component that can consume some sort of map or config, which folks can tweak to determine categories/blocks etc. And then concentrate more on the content.

That's the theory anyway 😄

@beafialho
Copy link

By the way, what is the Text > Custom link block? 🤔 I can't seem to find it.

@ramonjd I'm currently seeing "Custom Link" under the Design tab:

Captura de ecrã 2024-09-09, às 12 18 05

@vcanales
Copy link
Member

vcanales commented Sep 9, 2024

@ramonjd By that I mean, create a component that can consume some sort of map or config, which folks can tweak to determine categories/blocks etc. And then concentrate more on the content.

Are you thinking of including this config in the block.json definition? A not-so-flexible approach I thought of was adding a subcategory attribute, but we could also consider further categorization or customization to improve discoverability with a broader config schema. Here's the PR with the subcategory attribute suggestion, by the way.

@vcanales
Copy link
Member

vcanales commented Sep 9, 2024

@ramonjd By the way, what is the Text > Custom link block? 🤔 I can't seem to find it.

It's the navigation link block, isn't it?

@ramonjd
Copy link
Member

ramonjd commented Sep 10, 2024

not-so-flexible approach I thought of was adding a subcategory attribute

@vcanales Thanks for the suggestion.

I had the same thought, but wasn't sure if it warranted updating the block.json schema (and every block.json file) just yet when things could be hard-coded for the first iteration.

I hadn't seen your PR yet however, and I think it's a good idea to allow deeper categorization in general, for example, to make things more discoverable and sortable. I haven't looked closely yet, but do you think some of the existing Core filters and other functionality would also need to be aware of sub-categories?

It's the navigation link block, isn't it?

Oh yeah, thanks for pointing that out 🤦🏻

Custom link doesn't really mean much out of context, at least to me.

@vcanales
Copy link
Member

vcanales commented Sep 11, 2024

(and every block.json file)

We could get away with adding them incrementally; I think a potential subcategory attribute should remain optional.

I haven't looked closely yet, but do you think some of the existing Core filters and other functionality would also need to be aware of sub-categories?

Yes, in my proposal for the schema, subcategories would be children of an existing category, so we'd have to add this awareness.

Custom link doesn't really mean much out of context, at least to me.

Agreed. I don't think the block's title describes it in a way that makes it easy to find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.
Projects
Status: Needs Dev
Status: Needs Dev / Todo
Development

No branches or pull requests

7 participants