A custom Drupal sub-theme based on the Bootstrap Barrio base theme, providing a Bootstrap-powered responsive design framework for your Drupal site.
This sub-theme extends the Bootstrap Barrio theme, allowing for customized styling and functionality while maintaining the flexibility and power of Bootstrap's responsive grid system and components.
- Drupal 10.x, 11.x
- Bootstrap Barrio base theme (8.x-5.x or later)
- Bootstrap 5.x (included via CDN or locally)
Download and install the Bootstrap Barrio base theme if you haven't already:
composer require drupal/bootstrap_barrioOr download it manually from Drupal.org.
-
Clone or download this repository into your Drupal themes directory:
cd web/themes/custom git clone [your-repository-url] bootstrap_barrio_subtheme -
Clear Drupal cache:
drush cr
-
Enable the sub-theme via Drush:
drush theme:enable bootstrap_barrio_subtheme drush config:set system.theme default bootstrap_barrio_subtheme
Or enable it through the Drupal admin interface at:
Administration > Appearance
Navigate to Administration > Appearance > Settings > Bootstrap Barrio SubTheme to configure:
- Bootstrap version (CDN or local files)
- Layout settings and container widths
- Navigation styles
- Button styles and sizes
- Color schemes
- And more Bootstrap-specific options
To customize Bootstrap variables:
- Navigate to
scss/variables/_bootstrap-variables.scss - Override any Bootstrap variable (colors, spacing, breakpoints, etc.)
- Compile the SCSS files (see Development section below)
Example customizations:
$primary: #0066cc;
$secondary: #6c757d;
$font-family-base: 'Helvetica Neue', Arial, sans-serif;bootstrap_barrio_subtheme/
├── config/
│ ├── install/
│ └── schema/
├── css/
│ └── style.css # Compiled CSS
├── images/
├── js/
│ └── custom.js # Custom JavaScript
├── scss/
│ ├── components/ # Component-specific styles
│ ├── layout/ # Layout styles
│ ├── variables/
│ │ └── _bootstrap-variables.scss
│ └── style.scss # Main SCSS file
├── templates/ # Twig template overrides
│ ├── block/
│ ├── field/
│ ├── node/
│ ├── page/
│ └── views/
├── bootstrap_barrio_subtheme.info.yml
├── bootstrap_barrio_subtheme.libraries.yml
├── bootstrap_barrio_subtheme.theme
├── logo.svg
├── package.json
├── screenshot.png
└── README.md
- Node.js and npm
- Sass compiler
-
Install dependencies:
npm install
-
Compile SCSS to CSS:
npm run build
-
Watch for changes during development:
npm run watch
If you haven't set up npm scripts, you can compile manually:
sass scss/style.scss css/style.cssOr with watch mode:
sass --watch scss/style.scss:css/style.css- Create component files in
scss/components/ - Import them in
scss/style.scss - Run the build command to compile
Example:
// scss/components/_custom-header.scss
.custom-header {
background-color: $primary;
padding: 2rem 0;
}Then import in scss/style.scss:
@import 'components/custom-header';Template files go in the templates/ directory, organized by template type. Copy templates from the base theme or core and modify as needed.
Example: To override the page template:
- Copy
page.html.twigfrom Bootstrap Barrio or core - Place it in
templates/page/ - Modify as needed
- Clear cache
Custom JavaScript should be added to js/custom.js and is automatically loaded via the theme's library definition in bootstrap_barrio_subtheme.libraries.yml.
- Always use Bootstrap classes when possible for consistency
- Keep custom CSS organized in component files
- Use Drupal's render arrays and theme suggestions
- Test responsive behavior at all breakpoints
- Document any custom functionality in this README
- Clear Drupal cache:
drush cr - Rebuild SCSS:
npm run build - Hard refresh browser (Ctrl+Shift+R or Cmd+Shift+R)
Ensure Bootstrap JavaScript is properly loaded. Check theme settings to verify the Bootstrap library source (CDN or local) is configured correctly.
- Clear Drupal cache:
drush cr - Check that templates are in the correct directory
- Verify template suggestions using Twig debugging
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -am 'Add new feature' - Push to the branch:
git push origin feature/my-feature - Submit a pull request
This project is licensed under the GPL-2.0+ License - see the LICENSE file for details.
- Base theme: Bootstrap Barrio
- Framework: Bootstrap
For issues, questions, or contributions, please use the project's issue queue or contact the maintainers.
Version: 1.0.0
Last Updated: October 2025