Luca Lusso Modernizing | Drupal 10 Theme Development

global-scripts: js: dist/scripts/index.js: preprocess: true, minified: true dependencies: - core/drupal - core/once No more $(document).ready() . He used the new once() library to prevent rebinding and wrote vanilla JavaScript:

Luca knew the heart of modern Drupal theming wasn’t just about Twig templates—it was about component-driven design . He closed the monolithic styles.css file. No one should write global CSS in 2026. luca lusso modernizing drupal 10 theme development

The real magic came when he integrated Tailwind’s @layer components with Drupal’s SDC (Single Directory Components). He configured postcss.config.js to scan the components/ folder. Now, unused CSS was purged automatically. Build times dropped from 12 seconds to 0.8 seconds. global-scripts: js: dist/scripts/index

His mission was clear: modernize it without breaking the live site for more than a weekend. No one should write global CSS in 2026

Luca Lusso stared at the screen, the glow of three monitors reflecting off his espresso cup. Before him lay a Drupal 10 theme. On the surface, it worked. But beneath the hood, it was a time capsule from 2015.

He’d been called in as a freelance front-end architect. The client, a fast-growing tech magazine, complained that their site felt “sluggish” and that their designers were “fighting the theme.” Luca had seen this before. The previous developer had simply ported a Drupal 7 theme forward, layering patch upon patch. The styles.css file was 8,000 lines of spaghetti. The JavaScript was a jQuery meatball. And the template files ( html.twig , page.html.twig ) were littered with deprecated variables.

He showed the client a preview. The carousel that used to stutter on scroll now ran at 120fps. The CLS (Cumulative Layout Shift) score went from 0.45 to 0.02.