A minimal Drupal 11 base theme utilizing the Minim CSS framework with atomic design principles and modern build tools.
Minim is a lightweight, component-based Drupal theme that emphasizes clean design and developer experience. Built with atomic design methodology and powered by PostCSS for modern CSS development.
- Atomic Design Architecture - Organized component structure from atoms to organisms
- Modern CSS Build Pipeline - PostCSS with Lightning CSS for optimal performance
- Component-First Development - Utilizes Drupal's Single Directory Components (SDC)
- Minimal Dependencies - Clean, lightweight foundation
- Drupal 11 Compatible - Built for the latest Drupal core
source/
βββ 00-core/ # Core styles and Minim CSS framework
β βββ _minim.css/ # External Minim CSS framework
β βββ nucleus/ # Base styles and variables
βββ 01-atoms/ # Basic building blocks (buttons, inputs, labels)
βββ 02-molecules/ # Simple groups of atoms
βββ 03-organisms/ # Complex components
βββ 04-symbiosis/ # Layout components
βββ 05-synergy/ # Page-level templates
- Branding - Site logo and branding elements
- Navigation - Main navigation menu
- Focus - Featured content area
- Hero - Hero banner section
- Highlight - Highlighted content
- Content - Main content area
- Sidebar - Sidebar content
- Footer - Footer content
- Buffer - Additional content buffer
- Drupal 11 with Components module
- Git (for cloning dependencies)
- Node.js 23+ (auto-installed via NVM, or manual installation)
The theme includes an automated installation script that handles everything:
cd web/themes/custom/minim
bash install.shWhat the script does:
- π Validates you're in the correct directory
- π¦ Clones the Minim CSS framework (if not already present)
- βοΈ Sets up Node.js 23 (via NVM if available, otherwise checks system)
- π¦ Installs all npm dependencies
- π¨ Builds theme assets
- β Provides next steps for theme activation
After installation, activate the theme:
drush theme:enable minim
drush config:set system.theme default minimIf you prefer manual setup or the script fails:
-
Install Node.js (if needed):
# With NVM (recommended) nvm install 23 && nvm use 23 # Or download from https://nodejs.org/
-
Clone Minim CSS framework:
git clone https://github.com/michaelpadiernos/minim.css.git ./source/00-core/_minim.css
-
Install dependencies and build:
npm install npm run run
If you encounter issues:
# Make script executable
chmod +x install.sh
# Run with bash explicitly
bash install.sh
# Install Gulp CLI globally if needed
npm install -g gulp-cli
# Check Node.js version
node --version # Should be 23+The theme uses Gulp with PostCSS for processing styles and JavaScript:
# One-time build
npm run run
# or
gulp run
# Type check + build (recommended for development)
npm run build
# Type checking only
npm run type-check
# Watch for changes during development
gulp watch
# Default task (build + watch)
gulpThe build pipeline includes:
- Lightning CSS - Fast CSS processing and optimization
- Autoprefixer - Automatic vendor prefixes
- CSS Nano - CSS minification
- PostCSS Nesting - CSS nesting support
- PostCSS Mixins - Reusable CSS mixins
- Custom Properties - CSS custom properties support
- Font Magician - Automatic font loading
- Brand Colors - Predefined brand color palette
minim/
βββ assets/
β βββ css/
β β βββ minim.theme.css # Compiled CSS
β β βββ minim.theme.css.map # Source map
β βββ js/
β βββ minim.theme.js # Compiled JavaScript
βββ source/
β βββ minim.source.css # Main CSS entry point
β βββ minim.source.js # Main JS entry point
β βββ [atomic structure]/
βββ minim.info.yml # Theme definition
βββ minim.libraries.yml # Asset libraries
βββ gulpfile.js # Build configuration
βββ package.json # Dependencies
Create new components following atomic design principles:
- Atoms (
01-atoms/) - Basic elements like buttons, inputs - Molecules (
02-molecules/) - Simple component groups - Organisms (
03-organisms/) - Complex UI sections - Symbiosis (
04-symbiosis/) - Layout components - Synergy (
05-synergy/) - Page templates
Each component should include:
- CSS styles
- Twig templates (if applicable)
- Component definition files
The theme uses modern CSS features:
/* Custom properties */
:root {
--primary-color: #007acc;
--font-size-base: 1rem;
}
/* Nesting support */
.component {
color: var(--primary-color);
&:hover {
opacity: 0.8;
}
&__element {
font-size: var(--font-size-base);
}
}
/* Mixins */
@mixin button-style {
padding: 0.5rem 1rem;
border-radius: 0.25rem;
border: none;
}The theme integrates with Drupal's Components module for SDC support:
# In your component's definition
dependencies:
- components:componentsInclude theme assets in your templates:
{# Attach global styling #}
{{ attach_library('minim/global-styling') }}Add custom styles by extending the source files:
- Create new files in the appropriate atomic level
- Import them in
source/minim.source.css - Run the build process
Add JavaScript functionality:
- Edit
source/minim.source.js - Build with
gulp run - JavaScript will be minified and included automatically
The theme includes dependency on body_roles_classes for enhanced styling options:
dependencies:
- components:components
- body_roles_classes:body_roles_classesCustomize the build process in gulpfile.js:
// Modify processors array to add/remove PostCSS plugins
const processors = [
postcss_autoprefixer,
postcss_brands,
// ... other plugins
]The theme uses PostCSS Font Magician for automatic font loading. Configure fonts in your CSS:
body {
font-family: 'Source Sans Pro', sans-serif; /* Automatically loaded */
}components:components- Single Directory Components supportbody_roles_classes:body_roles_classes- Enhanced body classes
- Node.js 23+ - Runtime environment (auto-installed by script)
- Gulp 5.x - Task runner
- PostCSS - CSS processing with 15+ plugins
- Lightning CSS - Fast CSS optimization
- TypeScript - Type checking for JavaScript modules
- Minim CSS - Minimal CSS framework (auto-cloned by install script)
The build process includes:
- CSS minification with CSS Nano
- JavaScript uglification
- Autoprefixing for browser compatibility
- Source maps for debugging
- Minimal CSS footprint
- Optimized asset delivery
- Modern CSS features for better performance
- Tree-shaking for unused styles
The theme supports modern browsers with automatic fallbacks via:
- Autoprefixer for CSS prefixes
- PostCSS Preset Env for feature polyfills
- Lightning CSS optimizations
- Fork the repository
- Create a feature branch
- Make changes following atomic design principles
- Build and test your changes
- Submit a pull request
- Follow Drupal CSS coding standards
- Use atomic design methodology
- Include source maps for debugging
- Test across target browsers
- Keep components focused and reusable
- Follow naming conventions
- Include proper documentation
- Test component variations
- Minim CSS Framework: https://github.com/michaelpadiernos/minim.css
- Atomic Design: https://atomicdesign.bradfrost.com/
- Drupal Components: https://www.drupal.org/project/components
- PostCSS Documentation: https://postcss.org/
ISC License - see package.json for details.
Author: M. Padiernos
Version: 1.0.0
Drupal Compatibility: 11.x