-
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
Create Block: Integrate CSS import in JS with esnext template #22727
Conversation
Size Change: 0 B Total Size: 1.12 MB ℹ️ View Unchanged
|
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.
Great call to add this into the template! I have left some comments 👍 :)
Let's make sure we agree on something before the end of this week to ensure it's included in the next npm packages release to raise awareness about CSS import in JavaScript support. Now, that I said that, I think we should also add code comment referencing how that works. I guess https://www.npmjs.com/package/@wordpress/scripts#using-css would be the most appropriate to link. |
Description
Now that CSS import in JS has been added to
@wordpress/scripts
and build scripts, it's time to integrate it into the default template used by@wordpress/create-block
. This PR handles it by updatingesnext
(default) template. Two existing files were moved tosrc
folder and referenced in JavaScript files.I also used
theme(button)
in one of the files to ensure that PostCSS preset is properly integrated. The generated output looks something along those lines:How has this been tested?
npx wp-create-block
I confirmed that CSS files were created in
build
folder and properly loaded in the block editor.