Skip to content

Allow themes to surface specific patterns from the Patterns Directory #35364

Closed

Description

With the launch of the pattern directory (and the upcoming ability for folks to submit their own patterns to it), we should consider building a route through which themes can highlight specific patterns to their users.

Traditionally, themes have bundled their own proprietary patterns directly via PHP, and tend to highlight them in a category named after the theme:

Screen Shot 2021-10-05 at 1 56 50 PM

This is fine, but it locks those patterns into that one specific theme. What if (for example) a theme could place all of those patterns directly in the Pattern Directory itself, and then reference them from within theme.json. These referenced patterns could either be highlighted in the inserter via a "Theme Name" category, or bubbled up to the top of the list and given a special "theme" badge of some kind.

This would:

  • Cut down considerably on theme code.
  • Make theme patterns far easier to update, test, and review.
  • Encourage theme authors to seed the pattern directory with even more patterns.
  • Reduce pattern redundancy in the Pattern Directory by letting multiple themes reference the same simple patterns.

If a theme's pattern relied on special block styles, then the theme would still be free to register them the traditional way.

Related to #33046, #35115
This should maybe be part of #31153?

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

Metadata

Assignees

Labels

[Feature] Pattern DirectoryThe Pattern Directory, a place to find patterns[Feature] PatternsA collection of blocks that can be synced (previously reusable blocks) or unsynced[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.[Status] In ProgressTracking issues with work in progress[Type] EnhancementA suggestion for improvement.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions