Announcing the opinionated Drupal Frontend platform
Tags: drupal, theming, frontend
Published: 2019-05-01 16:59:00

---
title: Announcing the opinionated Drupal Frontend platform
published: true
description: A new and opinionated approach to bring cutting edge Front-end to Drupal 
tags: Drupal,theming,frontend
---

Drupal is by default, a component-based system. Everything is in place for a Frontend developer to work in a component way, but yet we almost never do.

Compony is the bridge between the component nature of Drupal and modern Frontend. It does this with flexibility and demanding a component-based thinking from developers.

Or as the Oxford dictionary would say in a Frontend-cryptic-way:
**“heraldry made up of alternating metal and colour, colour and fur, or fur and metal”**


<h1><strong>The problem</strong></h1>

Everything in our frontend follows the logic of components. But when we plug our frontend logic in to Drupal, all of our marvels of writing component-based are lost. This is due to just a few limitations within Drupal (and also in our way of thinking as frontend Drupal developers): 
<ul>
<li>We write component-based Sass, yet we compile all of our CSS in to one file.</li>
<li>We write component-specific JS, yet we load each line of JS on every page.</li>
<li>We have Drupal libraries api, yet we put all of our assets in to one global library.</li>
<li>We all are theming the output of the same Drupal modules, yet we are unable to share our solutions&nbsp;between each other.</li>
<li>We make beautiful things project-specific styled components, yet we can't plug it in to another project.</li>
<li>We all love Drupal because of it's open source collaboration, yet the collaboration seems to stop when we talk about the frontend components or tools within our theming setup.</li>
</ul>


<h1><strong>The Compony solution<strong></h1>

The solution comes in 3 major parts:
<ol>
<li dir="ltr">
<p dir="ltr">The Compony theme</p>
</li>
<li dir="ltr">
<p dir="ltr">The Compony Gulp</p>
</li>
<li dir="ltr">
<p dir="ltr">The Compony platform</p>
</li>
</ol>

<h2>The Compony theme</h2>
The Compony-theme is a theme-structure that transforms a Drupal-theme in to a structure where everything becomes a component. You can download the theme from <a href="https://www.compony.io">The Compony platform</a>.

Next to a few PHP-functions that make all the theming you can do in the theme fully component-based. there is nothing special about it, next to a certain folder structure that you have to follow. (Docs: <a href="https://www.compony.io/docs/documentation/required-structure">Folder structure</a>)

In the folder with the name components, you can put your components. (Docs:<a href="https://www.compony.io/docs/documentation/concept">Component structure</a>) (Component example: <a href="https://www.compony.io/component/text-dropdown">text-dropdown</a>)

<h2>The Compony Gulp</h2>
Creating a state-of-the-art Gulp-setup can cause head-scratching baldness. 

Therefor we created a customised open source Gulp setup for this exact Compony-theme. The Gulp setup is opinionated, but customisable to the needs of your project and to the needs of a development team that operates in multiple ways. Within the same project it can handle multiple themes at once, multiple development environments within different operating systems.

It's even hand-tuned to know when to clear Drupal's cache for you while you are working. (docs: <a href="https://www.compony.io/docs/documentation/compony-gulp">The Compony Gulp</a>)

When downloading the theme from the homepage, the Gulp-setup is already included inside the theme.


<h2>The Compony platform</h2>
The Compony platform enables the community to share their frontend components with each other. It serves also as the hub on where we connect, contribute, discuss and evolve with the ever-evolving standards of Frontend.


<h1><strong>Progressively bringing it all together</strong></h1>
Following the logic of progressive enhancement, it's possible to only use certain parts of Compony.

<h2>The Backender's setup</h2>
Only using the Compony theme works in Drupal, without using components from the platform or using the Gulp setup. Drupal doesn't need Gulp to be able to correctly understand your theme. 

This means that you can also use this approach on your server. Gulp is merely there for development purposes of the Frontend Layer anyway.

<h2>The Frontender's setup</h2>
A Frontender of your theme will want to have both the Compony theme, but also the Compony Gulp. Because the Gulp will enable that person to work faster and more reliably.

<h2>The community driven setup</h2>
If you want to benefit from components created by the community, you can use the platform to browse & download components from others. When using other components, you could also contribute back to the components you've used by fixing bugs, or making enhancements. 

On the platform you can create components (Blogpost: <a href="https://www.compony.io/blog/create-compony-component">Create a Compony component</a>) for others to use. Or you can make collections of components that you can then download and drag-and-drop in to your theme. (Collection example: <a href="https://www.compony.io/collection/bare-essentials">Bare essentials</a>)

<h1><strong>Sounds interesting?</strong></h1>
You can use the platform free of charge, but we also have <a href="https://www.compony.io/pricing">a few paying features</a>.
Go ahead and <a href="https://www.compony.io/user/register">register your account</a>