WebDevStudios / wd_f

GNU General Public License v2.0
11 stars 1 forks source link

38 create a block specific build pattern so scss and css can be local to the block folder #44

Closed guzmandrade-dev closed 1 year ago

guzmandrade-dev commented 1 year ago

Closes

38

#WDSUS-37

What type of PR is this? (put an x to all applicable)

Link to test

Description

This PR adds to the block created with the WP-CLI command wp wds create_portable_block starter styles and changes how styles are built, so single style files are created per each block.

Example:

Run the following to create the block myblock (double-check you don't have a folder named myblock under blocks):

wp wds create_portable_block myblock --title="This is myblock" --desc="This block is used for wds." --keyword="myblock" --icon="table-row-before"

add markup and style code to your block, such as:

Screenshot 2023-08-11 at 12 55 29 PM

and run npm run buld or npm run start. This should result, after adding the custom block to a post or page, in the following:

on the Frontend Screenshot 2023-08-11 at 12 56 20 PM

Editor page Screenshot 2023-08-11 at 12 56 02 PM

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings

Added tests?

Added to documentation?

Others

[optional] Are there any post-deployment tasks we need to perform?