Create Block: Integrate CSS import in JS with esnext template#22727
Merged
Create Block: Integrate CSS import in JS with esnext template#22727
Conversation
|
Size Change: 0 B Total Size: 1.12 MB ℹ️ View Unchanged
|
fabiankaegy
reviewed
May 29, 2020
Member
fabiankaegy
left a comment
There was a problem hiding this comment.
Great call to add this into the template! I have left some comments 👍 :)
Member
Author
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Now that CSS import in JS has been added to
@wordpress/scriptsand 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 tosrcfolder 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-blockI confirmed that CSS files were created in
buildfolder and properly loaded in the block editor.