close
Skip to content

Create block: Add CSS templates #70580

Open
Infinite-Null wants to merge 4 commits intoWordPress:trunkfrom
Infinite-Null:feat/add-css-block-templates
Open

Create block: Add CSS templates #70580
Infinite-Null wants to merge 4 commits intoWordPress:trunkfrom
Infinite-Null:feat/add-css-block-templates

Conversation

@Infinite-Null
Copy link
Contributor

@Infinite-Null Infinite-Null commented Jul 1, 2025

What?

Adds CSS variant support to the @wordpress/create-block package, allowing developers to scaffold blocks with CSS files instead of SCSS files.
Closes: #52181

Why?

The current create-block package defaults to SCSS files, but some developers prefer working with plain CSS files for consistency and standards enforcement. While CSS can be written in SCSS files, having dedicated CSS templates provides a better developer experience and enforces coding standards from the start.

Testing Instructions

  1. Test CSS static variant:
 npx @wordpress/create-block my-css-block --variant css
  1. Verify it generates CSS files (editor.css, style.css) instead of SCSS
  2. Verify that JavaScript files import CSS files correctly

Screencast:

Screen.Recording.2025-07-03.at.6.34.59.PM.mov

@Infinite-Null Infinite-Null changed the title [WIP] Create block: Add CSS templates to Create Block tool [WIP] Create block: Add CSS templates Jul 2, 2025
@Infinite-Null Infinite-Null changed the title [WIP] Create block: Add CSS templates Create block: Add CSS templates Jul 3, 2025
@Infinite-Null Infinite-Null marked this pull request as ready for review July 3, 2025 13:15
@github-actions
Copy link

github-actions bot commented Jul 3, 2025

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Infinite-Null <ankitkumarshah@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: benoitchantre <benoitchantre@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Tool] Create Block /packages/create-block labels Jul 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Tool] Create Block /packages/create-block [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create block: add variation for CSS

2 participants