This project is a Tailwind CSS compiler for developers who want to use Tailwind in Salesforce Experience Cloud LWR Site Builder. It automates the process of compiling Tailwind CSS files and deploying them to Salesforce.
sfdx
) installedforce-app
directorynpm install
tailwind-configs/
: Directory containing Tailwind CSS configuration files (*.config.js
).build-all.js
: Script to compile Tailwind CSS files and deploy them to Salesforce.package.json
: Contains npm scripts for various tasks.To compile Tailwind CSS files and deploy them to Salesforce, run the following command:
npm run build:all
This command will:
../force-app
directory exists../tailwind-configs
directory exists../tailwind-configs
directory.sfdx force:source:deploy
.To watch for changes in the main CSS file and automatically compile and deploy the changes, run:
npm run watch:css
To manually build the CSS file without deploying, run:
npm run build:css
check:force-app
: Checks if the ../force-app
directory exists.build:css
: Compiles the main CSS file and outputs it to the ../force-app
directory.watch:css
: Watches for changes in the main CSS file and compiles it.build:all
: Compiles all Tailwind CSS configuration files in the ./tailwind-configs
directory and deploys them to Salesforce.Create your Tailwind CSS configuration files in the ./tailwind-configs
directory. For example, tailwind.config.js
:
module.exports = {
content: [
"./force-app/main/default/lwc/**/*.html",
"./force-app/main/default/lwc/**/*.js",
],
theme: {
extend: {},
},
plugins: [],
};
If you encounter any issues, check the error messages in the terminal for more details. Ensure that the ../force-app
directory exists and that you have the necessary permissions to deploy to Salesforce.
This project is licensed under the MIT License.