Cog is a Drupal 8 base theme created and maintained by the Acquia Professional Service Front-end team.
Many great Drupal base themes already exist, so what does Cog bring to the table?
Cog is not intended to be a framework, or even much to look at out of the box. This is because it focuses on the developer experience. It is a minimal, stripped-down starter kit that is primarily based on the Core ‘classy’ theme. The reason for this direction: our projects typically have very custom design requirements, so imposing a framework would require considerable overriding and abstracting code. And most developers prefer starting with a blank canvas.
What Cog does have is a built-in front-end build toolset based on node modules, primarily gulp. Because we have control over these tools, we can orient our development of them to complement other Acquia tools we’ve standardized on internally, such as BLT and Lightning. This allows a more standardized workflow for Acquia PS and partners, with a familiar set of evolving tools and configuration. There’s nothing about Cog that would prevent it from being used without BLT, but that is our primary use-case. Cog reinforces best practices through its starting architecture and its included documentation.
Here is a brief walkthrough of the build tools and other scripts available with Cog:
- A Drush script similar to Zen to create a custom sub-theme based on the included STARTERKIT
- Gulp: a Gulpfile to run modularized gulp tasks for common front-end requirements
- Susy: a semantic grid system tool. There is very basic config for susy in the starterkit sass files as well
- Kss-node: a living styleguide generation tool to allow for quick prototyping and documentation of atomic design components
- Sass: All sass plugins included in the Cog package.json run on the node-sass version of libsass, which is 400% faster than ruby sass and is only dependent on node, so there are no Ruby dependencies in Cog out of the box.
- Yarn: Yarn is a new package manager for node, similar to npm (which is installed with node out of the box). Yarn has many improvements over npm, particularly for locking down versions of packages, and it installs much faster because of caching behaviors.
- BLT: Because BLT and Cog have many maintainers in common and are used together on most Acquia PS projects, Cog is tightly integrated with BLT
Future in-depth blog posts in this series will cover tools and techniques as they relate to Cog and BLT.
Update: a post on The Tools You Get with Cog was just published. Check it out.
Note: Liz Mackie contributed mightily to this blog post!