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:
“How?” the client asked, bewildered.
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
He opened his terminal and ran the familiar commands:
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
On Sunday night, Luca ran the final build. He used Drupal 10’s new auto-setup CLI to spin up a test environment, ran phpunit on his custom theme settings, and pushed the changes.
He updated his Drupal Slack status: “Modernizing Drupal themes, one component at a time. #SDC #Drupal10 #NoMoreSpaghettiCSS” He closed the monolithic styles
Monday morning, the editors logged in. The admin UI was untouched. But the front end? It felt like a new website. The designers could now edit a single .css file inside a component folder without fear of breaking the header. The developers thanked him for removing jQuery.