-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: create static categories #65430
Style book: create static categories #65430
Conversation
Size Change: +823 B (+0.05%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
ed53658
to
021275c
Compare
@vcanales Thanks for linking. Also for the tracking issue 👍🏻 Sorry, I didn't see that until today. Is there anything else we can add to the TODO list in the description of this PR do you think? Let's coordinate so we don't double up on work. I'm currently looking at catering for other registered categories (aside from those in the static list). I think @aaronrobertshaw might be working on custom examples, e.g., the theme colors. |
I'm currently working through ensuring we have examples for all the core blocks outlined in the style book iteration issue. I've gotten a little sidetracked on some blocks that render placeholder states, such as the Avatar block. It might be open for debate as to what state the block should be in for the Style Book but that can be discussed on relevant PRs. Once the core block examples are sorted my plan is to work on display of the examples in the Color tab. |
dfa250a
to
c9d092d
Compare
Using fixtures for tests. Using fixtures for tests.
…lock store update comments Use `slug` instead of `name`
…Examples component it should render all available examples. Renamed getCategoryExamples function to getExamplesByCategory
3cd9a76
to
032182e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name: string; | ||
title: string; | ||
category: string; | ||
blocks: Block; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be the single Block, an array of blocks e.g. blocks: Block[];
, or either a single Block or array of Blocks: blocks: Block | Block[];
?
getExamples
looks to assign a single block for non-heading blocks, while the example for the heading block is an array of blocks.
The naming of the property indicates an array to me.
FWIW the draft PR to add a color tab to the Style Book with arbitrary palette color examples wraps the color blocks in a Grid block to provide layout. So it could work with just a single Block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block | Block[];
Oh yes, this!
Not sure what a better name would be, but I'll fix the type value and mull over it.
integrate registered categories changes from #65507
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick fix on the types @ramonjd 🚀
I've given this another smoke test and it's all testing well for me.
From my end this is looking good to go. If you want to double check the categories with our design gurus, that works for me also.
🚢
Thanks for testing so thoroughly. If @jasmussen and folks are okay with the categories in this PR (the only user-facing change). we can move onto the landing page. 👍🏻 Cheers! |
I suspect as we keep exploring #65619, I suspect the categories will need further iteration regardless, and that work arguably makes the landing page even more important. So no objections on my end, assuming I'm not missing nuance. |
Thanks for the quick sanity check!
Exactly 👍🏻
This is the PR that will enable all variations of category lists going forward. The static list can be chopped and changed. I speculate that we'll need to refine its logic as new requirements come in, but right now its fairly flexible. Thanks! |
This commit creates a static category map based on list defined in Style Book: Iterate on presentation and design. WordPress#53431. It also: - Sorts examples based on static categories and their subcategories - Introduces simple layout for subcategories (under theme) - Adds unit tests for utils - Converts utils to TypeScript Co-authored-by: ramonjd <[email protected]> Co-authored-by: aaronrobertshaw <[email protected]> Co-authored-by: vcanales <[email protected]> Co-authored-by: jasmussen <[email protected]>
This reverts commit 6d8f2a8.
Part of:
What? How?
MVP for #53431
Why?
Note
This is a foundational PR only. So clearing a path to creating custom tabs and example lists. More design stuff to come in subsequent PRs.
Below is the theme tab for example. The "Design" tab's examples are now under "Theme" sorted into subcategories.
Testing Instructions
Open the style book and check for regressions, e.g.,
Screenshots
Steps after this PR:
getCategories()
for extenders etc. Style book: display registered categories #65507