WordPress / WordPress/create-block-theme
Allow creating/registering block variations from the UI
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 417
- Forks
- 66
- PR merge metrics
- No merged PRs in 30d
Description
Allow registering new block variations and style them without leaving the editor.
Idea:
A theme can register new buttons variations such as pill, rounded, circular and style them to be used in the editor.
| Pill | Rounded | Circular |
|---|---|---|
Currently it is not possible to create such variations from the editor.
A block variations can be registered with javascript
const { registerBlockStyle } = wp.blocks;
registerBlockStyle('core/button', {
name: 'pill',
label: _x('Pill', 'block style', 'theme-name'),
});
this creates a new button variations and adds a css class wp-block-button is-style-pill which can be styled from the editor global styles.
Proposal:
Create block theme can have a UI to create a new block variation, (which adds the required javascript code and enqueues is safely).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by mapping the existing editor UI and block-variation registration flow, then define the UI, generated JavaScript, enqueueing, and styling behavior. Done means a theme author can create and style a variation from the editor without leaving it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100