Bootstrap from Composer or Bower?

Hi all,

I want to work on my workflow, want to ask other questions later, but first this one.

For theme development I always use a WordPress parent theme that works with Bootstrap (I will continue doing this) and make a child theme for that. In my child-themes functions.php I disable the Bootstrap CSS files of the parent theme, and include all the LESS files from Bootstrap so I can overwrite them with my own LESS files.

Now, in my new workflow Bootstrap will be one of my ā€˜dependencies’. My feeling tells me I’m going to use Bower + Gulp, as I can read here Major changes coming in version 8.0.0 - #7 by benword it looks like you are doing the same for Sage!

Now, since the workflow is much broader then above, I want to start looking at the screencasts here: http://roots.io/wordpress-stack/. Now I have looked on the Composer websites, and what I don’t understand is that I also find Bootstrap in their repository (Packagist).

So why use Bower then? What is the difference?

Kind regards,

Willem-Siebe

Bower is for front-end packages and Composer is for PHP packages.

For theme related purposes, you wouldn’t ever want to include Bootstrap via Composer unless you were compiling the Less with PHP. Since you have a feeling you’re going to be using Bower + Gulp (which is a great toolset), ignore Composer and use Bower to grab Bootstrap.

1 Like

Ok, then I will use Bower + Gulp.

An other wish I have is to start using Git/Github for Version Control Management, since ofcourse I make changes to my child themes on regular basis. I now upload this using FTP and my previous version are ā€˜lost’.

Now I want to start learning Bedrock to improve my complete workflow, folder structure etcetera. But how does my child-theme development fit inside that picture? My parent theme (third party, actually also a ā€˜dependencie’ right?) will have updates as well. Now on the bedrock Github I read:

Themes

Themes can also be managed by Composer but should only be done so under two conditions:

  1. You’re using a parent theme that won’t be modified at all
  2. You want to separate out your main theme and use that as a standalone package
    Under most circumstances we recommend NOT doing #2 and instead keeping your main theme as part of your app’s repository.

Just like plugins, WPackagist maintains a Composer mirror of the WP theme directory. To require a theme, just use the wpackagist-theme namespace.

For example, when my parent theme is listed in the WP theme directory, it will have updates. So I don’t understand this: ā€œYou’re using a parent theme that won’t be modified at allā€.

Kind regards,

Willem-Siebe

Or does that mean that I don’t modify it myself? Which seems obvious then, because for that I use a child theme…

Correct. I guess it is obvious but in your case it’s a dependency so use Composer to manage it.