Single Directory Components: Streamlining Drupal Theming
DrupalHelps has published a detailed overview of Single Directory Components (SDC), a new standardized approach to theming in Drupal, introduced experimentally in Drupal 10.1 and now fully integrated in Drupal 11 and DrupalCMS. SDC organizes all component-related files, such as templates, CSS, JavaScript, and metadata, into a single directory, addressing challenges like scattered assets, unclear data expectations, and inconsistent theming practices. Designed to enhance maintainability and reusability, SDC includes features like metadata-based validation, automatic asset handling, and integration with design tools like Storybook and Figma. The approach eliminates external hooks, standardizes UI components, and supports seamless integration with systems like US Web Design System (USWDS). The article highlights SDC's role in advancing Drupal's alignment with modern front-end practices and its potential to become a core standard in UI development.