Tailwind Css Integration
A plugin that uses multiple block, Tailwind and is fully integrated into the standard build process
by The WordPress Contributors · github.com/ryanwelcher/tailwind-multiple-blocks
★ 6stars
1forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/ryanwelcher/tailwind-multiple-blocks/archive/refs/heads/trunk.zipTailwind CSS Custom Block Plugin
This repo leverages the @wordpress/scripts package and it's ability to use PostCSS to introduce TailwindCSS to the build process.
Additionally, by using the postcss-multiple-tailwind we are able create css files for each block that only contain the classes being used in the block.
Setup
- Checkout this repo
git clone https://github.com/ryanwelcher/tailwind-multiple-blocks.git - Cd into the new directory
cd tailwind-multiple-blocks - Run
npm ito install dependencies
Once set up, all of the standard commands from @wordpress/scripts will work normally:
npm start- starts the dev build process in watch modenpm run build- Build the files for production.
Adding more blocks
- Create a new directory in the
srcfolder - Add all of the files needed for a new block
- Ensure that there is a
tailwind.config.jsfile in the new folder withcontentset to the path to the new folder relative to the root -content: ['./src/FOLDER_NAME/*.{html,js}'],