Simplifying the Drupal frontend with Single File Components

Sam Mortenson


Doing front-end in Drupal can be confusing, for experienced developers and newcomers alike. A task like "Add the 'blue' class to all Articles and style it" might take modifying a preprocess function, adding a Twig template, compiling SASS, and more.

Enter Single File Components, a young module that aims to consolidate all your related front-end code into one ".sfc" file. Inspired by Vue.js, these files contain CSS, JavaScript, Twig, and PHP. SFC files aren't just a way to organize code, they can also be used to create blocks, layouts, field formatters, and interactive components using minimal JavaScript.

Come learn about the many features Single File Components provides from the creator of the module, and decide for yourself if this is game changing or destined for the ever growing trash heap of forgotten front-end tools.


https://2020.badcamp.org/session/simplifying-drupal-frontend-single-file-components

Drupal is a registered trademark of Dries Buytaert.