Using Sass/Scss with Slim



I’ve been looking around and haven’t been able to find a working example of Slim 3 with Sass/Scss. I’m running a Homestead server and want to use Bootstrap 4 on the front end which requires Sass to be compiled to Css. Before I used Gulp and launched a local Browser sync server but I’m not sure how I would do the same with Slim on a local Homestead server. Any help appreciated!



Hi Ben,

There isn’t anything unique about Slim, nor Homestead with regards to Bootstrap and Homestead. The process would be the same with any other PHP project or server. Any documentation regarding Bootstrap, Gulp, and Sass will be applicable to a project running Slim under Homestead.

Your question will get a wider audience if directed towards a Bootstrap group, and they wouldn’t need any familiarity with Slim or Homestead.

In general, you would require Bootstrap 4 somewhere within your project, perhaps within a /resources directory. Typically you would pull it down by npm. Then you would have a gulp file there that would run the tasks to build up the Sass, any custom CSS, and move the built files into your /public/ directory. Your master template file would then reference the built CSS, JavaScript, etc.