Drupal Theming

Generate one-word machine names for Drupal themes extending Classy.

34|12|Updated Mar 10, 2019
One-click install
npx skills add https://github.com/theodorosploumis/drupal-best-practices --skill drupal-theming
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Drupal Theming
Source: https://github.com/theodorosploumis/drupal-best-practices/tree/main/ai/skills/theming
Command: npx skills add https://github.com/theodorosploumis/drupal-best-practices --skill drupal-theming

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Guide Claude to create themes that favor Twig, preprocess logic, and atomic SCSS structure while keeping overrides minimal and purposeful.

Core Features & Use Cases

  • One-word machine names without theme prefixes or base-theme prefixes.
  • Guidance on using Classy as a base theme and limiting overrides to documented needs (404/403/maintenance/login, etc.).
  • Propose SCSS structure by responsibility (variables, mixins, entities, components) and class naming (twig-, js-).

Quick Start

Plan a one-word machine name theme that extends Classy, lists essential Twig overrides, and proposes SCSS folders with twig-/js- class prefixes.

Frequently Asked Questions about Drupal Theming

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a clean machine name for a Drupal theme?

Use a single descriptive word without theme or base-theme prefixes as your Drupal theme's machine name. This approach keeps naming simple and avoids namespace conflicts while maintaining clarity across your theme structure.

What's the best way to organize SCSS in a Drupal theme?

Organize SCSS by responsibility into separate folders: variables, mixins, entities, and components. Use semantic class prefixes like `twig-` and `js-` to distinguish template-driven styles from JavaScript-targeted selectors, keeping your stylesheet structure predictable and maintainable.

Should I extend Classy as a base theme for Drupal?

Yes, extending Classy provides a solid foundation with existing Twig templates and semantic markup. It lets you override only essential templates—like 404, 403, maintenance, and login pages—while inheriting sensible defaults for the rest of your theme.

How do I use Twig preprocessing to generate CSS classes in Drupal themes?

Leverage Twig preprocessing logic to dynamically generate semantic classes in your templates rather than hardcoding them. This approach reduces duplication, keeps class naming consistent across components, and makes styles easier to track and modify.

What's the difference between twig- and js- class prefixes in theme development?

Use `twig-` prefixes for classes generated and managed by Twig templates for styling purposes, and `js-` prefixes for classes targeted by JavaScript interactions. This separation prevents accidental style breakage when JavaScript selectors change and clarifies intent in your markup.

When should I override Drupal theme templates instead of using CSS?

Override templates only when markup structure must change—such as for documented exceptions like 404, 403, maintenance, and login pages. For styling needs, use preprocessing and SCSS instead to minimize overrides and keep your theme lightweight and maintainable.