This is a template made to allow people to use a majority of the features of TailwindCSS like the customization & plugin features without having to mess about with the precompilers it needs to function properly like PostCSS, Webpack and the sort and use them in creating web pages or designs.
It pretty much acts the same or similar to the TailwindCSS playground, but I've made the template in a way that the GULP file compiles your SCSS & Tailwind config into CSS, cleans it up and renames it into 'styles.css'. It also features browsersync and watches for changes in the HTML, SCSS, and Tailwind.config and will recompile the styling when they are detected
- Runs on GULP JS so make sure you have that installed
- Install packages with NPM or yarn
- Run
gulpon your console
-
Uses GULP + Browsersync to create a local server that refreshes whenever a change is detected
-
Grabs your master.scss & a.tailwind.scss files and concatenates them into a single styles.css file on your root directory
-
Uses GULP JS to watches for changes in HTML, SCSS and tailwind.config and when detected, recompiles your styles or HTML accordingly
-
Make sure you have Node.js and npm/yarn installed. I have used yarn but if you use NPM, delete the yarn.lock file and run
npm install. This may take a while on your first time. -
Install the GULP CLI so you can run gulp on your console
-
Once that's all set up, double check that you have a tailwind.config file, master.scss file, a.tailwind.csss file, and the index.html file. There are required for it to actually work
-
Type
gulpin your console to create a local server onlocalhost:3000and have GULP watch for file changes. -
You sould be all set. Just don't touch the a.tailwind.scss file. Ideal way is to use SCSS partials and import them into your master scss file.
- To manually do a style recompile, type
gulp stylesin the console. - Didn't really design this to work with JS file change detection. Might do in the future
- Uses the MIT license so feel free to fork it or do pull requests with improvements.
- Can this be optimized? Yes. It definitely can. If you have the time, feel free to help out!
This came from me not wanting to make a full-blown app for some FrontendMentor challenges just to use TailwindCSS with my plugins & personal customizations. Liked how it turned out so I figured it could be a template for others who want to give TailwindCSS a try