One of the great thing about attending conferences is attending a talk and learning about something you didn’t even realise you wanted to know about.
During DrupalCon Vienna I saw a talk by Anton Staroverov and Tassilo Groeper from Wondrous titled Decouple your Twig from PHP and make Frontenders happy! In the talk they showed a tool called Fractal which has been developed by Clearleft. After seeing the presentation I felt this would be a very useful tool so set about looking into it further.
Easy to Use
That evening I started to try out Fractal and within 10 minutes I had a build up and running and had added a component to it.
Since then at Headscape we have switched the default templating language to Twig to tie it into our Drupal 8 development. We’ve also used it’s static output to produce pattern libraries for clients.
Reference Point for All
Not only is Fractal a useful tool for frontend developers as mentioned above we also use it to show clients both individual components and components working together.
As a predominantly backend developer I also find it useful when I need to add a button for example. I can easily find all the button options in the nice frontend UI and see what classes I need to add.
Helps Building Templates and Reusable Components
Having one place where we can list all of the components and then using this as the actual templates for the production build is very useful for me.
During development, wether that is early stages or updates in the future, I find having a reference point of components speeds up the process.
For example if we have a new content type I can look at the various view modes we already have to see how I should be outputting the content.
With how quick it is to get something up and running with Fractal I’d encourage you to try it out. It might take a little bit of settings adjustment and maybe even splitting you’re templates and CSS out into more componentised methods but I think the benefits you’ll gain will be worth it.