webksde / drowl_base
DROWL Drupal (Base-)Theme based on Radix 6.x.
Requires
- drupal/core: ^10.3 || ^11
- drupal/fences_block: ^2
- drupal/radix: 6.0.1
- drupal/twig_field_value: ^2
- drupal/twig_real_content: ^1
- drupal/twig_tweak: ^3.2
Suggests
- drupal/blazy: Used and extended by this theme (optional).
- drupal/photoswipe: Used and extended by this theme (optional).
- drupal/slick: Used and extended by this theme (optional).
- npm-asset/js-cookie: ^2; Necessary for this theme, but needs custom steps to be required, see https://www.drupal.org/docs/develop/using-composer/manage-dependencies#third-party-libraries
- npm-asset/simple-parallax-js: ^5; Necessary for this theme, but needs custom steps to be required, see https://www.drupal.org/docs/develop/using-composer/manage-dependencies#third-party-libraries
- 2.x-dev
- 2.0.25
- 2.0.24
- 2.0.23
- 2.0.22
- 2.0.21
- 2.0.20
- 2.0.19
- 2.0.18
- 2.0.17
- 2.0.16
- 2.0.15
- 2.0.14
- 2.0.13
- 2.0.12
- 2.0.11
- 2.0.10
- 2.0.9
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 2.0.0-alpha20
- 2.0.0-alpha19
- 2.0.0-alpha18
- 2.0.0-alpha17
- 2.0.0-alpha16
- 2.0.0-alpha15
- 2.0.0-alpha14
- 2.0.0-alpha13
- 2.0.0-alpha12
- 2.0.0-alpha11
- 2.0.0-alpha10
- 2.0.0-alpha9
- 2.0.0-alpha8
- 2.0.0-alpha7
- 2.0.0-alpha6
- 2.0.0-alpha5
- 2.0.0-alpha4
- 2.0.0-alpha3
- 2.0.0-alpha2
- 2.0.0-alpha1
- 1.x-dev
- 1.0.113
- 1.0.112
- 1.0.111
- 1.0.110
- 1.0.109
- 1.0.108
- 1.0.107
- 1.0.105
- 1.0.103
- 1.0.102
- 1.0.101
- 1.0.100
- 1.0.99
- 1.0.98
- 1.0.97
- 1.0.96
- 1.0.95
- 1.0.94
- 1.0.93
- 1.0.92
- 1.0.91
- 1.0.90
- 1.0.89
- 1.0.88
- 1.0.87
- 1.0.86
- 1.0.85
- 1.0.84
- 1.0.83
- 1.0.82
- 1.0.81
- 1.0.80
- 1.0.79
- 1.0.78
- 1.0.77
- 1.0.76
- 1.0.75
- 1.0.74
- 1.0.73
- 1.0.72
- 1.0.71
- 1.0.70
- 1.0.69
- 1.0.68
- 1.0.67
- 1.0.66
- 1.0.65
- 1.0.64
- 1.0.63
- 1.0.62
- 1.0.61
- 1.0.60
- 1.0.59
- 1.0.58
- 1.0.57
- 1.0.56
- 1.0.55
- 1.0.54
- 1.0.53
- 1.0.52
- 1.0.51
- 1.0.50
- 1.0.49
- 1.0.48
- 1.0.47
- 1.0.46
- 1.0.45
- 1.0.44
- 1.0.43
- 1.0.42
- 1.0.41
- 1.0.40
- 1.0.39
- 1.0.38
- 1.0.37
- 1.0.36
- 1.0.35
- 1.0.34
- 1.0.33
- 1.0.31
- 1.0.30
- 1.0.29
- 1.0.28
- 1.0.27
- 1.0.26
- 1.0.25
- 1.0.24
- 1.0.23
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- dev-87-doctype-should-never-have-preceding-characters-whitespace
- dev-83-remove-captcha-global-library-loading-once-module-issue-is-solved
- dev-75-blazy-slick-3-compatibility-drowl_base-1-x-2-x
- dev-77-shorten-search-input-placeholder
- dev-67-overview_link-string-value-found-but-an-array-or-an-object-is-required
This package is auto-updated.
Last update: 2025-06-18 09:17:36 UTC
README
[TOC]
Helpful documentation
- Radix (Base Theme) Docs
- Drupal Single Directory Components (SDC) Docs
- Bootstrap 5 Docs
- Laravel Mix (Build Pipeline Library) Docs
Guidelines
- Follow the Drupal Guidelines: https://www.drupal.org/docs/develop/theming-drupal
- Use Components (SDC) for all reusable tempalte snippets
- With Bootstrap as a framework, we have to deal with two different conventions when it comes to CSS class naming. Drupal prefers BEM (https://getbem.com/naming), while Bootstrap uses some kind of OOCSS. We use this to our advantage, and use BEM for our custom page structure and components, so that we can better differentiate them. If it makes sense to use BEM classes next to Bootstrap classes, just do it. Example: 'page__navar navbar' are fine.
Extend Bootstrap
Components
Grid
- gy-equal-x: Adds vertical gutter equal to the horizontal gutter
Buttons
- btn-width-full: Stretches a button to 100% width (like the old btn-block class)
Icons
DROWL Base brings a set of basic icons which are available as SASS and PHP variables. In sass the icons are named $ico-theme-X (see drowl-sass-base variables). In PHP the icons are available by the global drowl_theme_icons array.
To override SASS variables, see $basics-frontend-iconfont-family and the single $ico-theme-X variables.
To override single PHP variables:
$variables['drowl_theme_icons']['info'] = 'ico-info-circle';
or override all:
$variables['drowl_theme_icons'] = [
'info' => 'ico-info',
'warning' => 'ico-warning',
...
];
Utilities
Whenever possible, use the BS Utilities API to extend the BS Utilities: https://getbootstrap.com/docs/5.3/utilities/api/#api-explained However utility classes are added, the naming should follow the existing BS logic. So for all class and variable names, start with meaningful prefixes, like: bg-x, bg-gradient-x, ...
Gradients
Bootstrap has its own logic for simple gradients: https://getbootstrap.com/docs/5.3/utilities/background/#background-gradient This is fine for very simple gradients, but doesn't work well for complex ones.
So when adding more complex gradients, use:
$gradient-x-y: linear-gradient(
var(--degree, 90deg),
#{$color-x} 0%,
#{$color-y} 100%
);
.bg-gradient-x-y{
background-image: $gradient-x;
}
To control the gradient degree add further utitlity classes like:
.gradient-degree-60 {
--degree: 60deg;
}
.gradient-degree-60-inverse{
--degree: -60deg;
}
Helpers
Body classes
- current-breakpoint-is-x: Current active breakpoint determined by JS.
- current-breakpoint-is-smaller-x: If the current breakpoint is smaller brekpoint x.
- current-breakpoint-is-larger-x: If the current breakpoint is larger brekpoint x.
- current-vw-is-smaller-container-max: Set if the current viewport width is smaller as the BS .container (max. page width)
Drupal Specific
Fields (with Fences)
- field__label--colon: Set on the field label wrapper to add colons after the label
Utilities
Text / Typography
- text-muted: Deprecated since BS 5.3 and replaced by a meaningless class. So we reinvented it.
- text-columns--x (2-4): Split text into columns. The column count decrease automatically using media queries.
List Styles
Base class: styled-list. With the required formatter classes:
- styled-list--comma: Inline list devided by comma
- styled-list--square: Vertical list with square "dots"
- styled-list--checklist: Vertical list with checkmarks
- styled-list--arrow: Vertical list with arrows
- styled-list--data-grid: Creates a label | data grid, with equal wide labels
Javascript
Debounce / Throttle
Drupal.drowl_base.functions.debounce(function,delay);
// Example usage:
new ResizeObserver(Drupal.drowl_base.functions.debounce(function(){
// Do stuff!
}, 600));
Get current Breakpoint
// Returns: Breakpoint Name (string), example: "lg"
Drupal.drowl_base.functions.getCurrentBreakpoint();
Get Scrollbar width
// Returns: Pixel value (decimal), example: 15
Drupal.drowl_base.functions.getScrollbarWidth();
Events
Listen to viewport size changes
document.addEventListener(
"drowl_base:resize",
(e) => {
/* … */
},
false,
);
SDC Single Directory Components
Component Usage
Basically you have two ways to add a component:
Include
Include a component, and drop some parameters, but dont change its contents.
{% include 'drowl_base:block' with {
html_tag: 'section',
block_utility_classes: [
'my-3',
'block--local-tasks',
],
}%}
Embed
Include a component and change its contents using block overrides.
{% embed 'drowl_base:metaheader' with {
color: 'light',
navbar_utility_classes: ['bg-light'],
} %}
{% block left %}
Replacement
{% endblock %}
{% block right %}
Replacement
{% endblock %}
{% endembed %}
Create new Components
Prefer to use drush genrate:
drush generate theme:sdc:component
Override existing Components
Only themes can override components (modules cannot override). For a theme to override a component, use the replaces key within the mytheme.component.yml file.
Override DROWL Base Stylesheets
All stylesheets are written with CSS variables (where possible). So in most cases, you might only need to modify your SASS variables (so your drowl_child.variables.css file is updated).
If you need to modify or remove DROWL Base styles, you could simply remove or override the according Drupal library.
Libraries
Slick
DROWL Base has its own Slick Carousel theme, with various tweaks using CSS Variables.
Configuration variables
--grid-gutter: var(--bs-grid-gutter);
--direction-nav-top: calc(50% - (var(--dot-nav-reserved-outer-space) * 0.5));
--direction-nav-item-width: var(--icon-size-lg);
--direction-nav-item-height: var(--icon-size-lg);
--direction-nav-icon-size: var(--icon-size-md);
--direction-nav-item-bg: var(--bs-light-glass);
--direction-nav-item-color: var(--bs-dark-glass);
--direction-nav-item-bg-hover: var(--bs-light);
--direction-nav-item-color-hover: var(--bs-dark);
--dot-nav-item-width: var(--icon-size-xs);
--dot-nav-item-height: var(--icon-size-xs);
--dot-nav-item-radius: 50%;
--dot-nav-grid-gutter: .35rem;
--dot-nav-item-color: var(--bs-light-glass);
--dot-nav-item-color-hover: var(--bs-primary);
--dot-nav-item-color-active: var(--bs-white);
// Dot nav alignment, available options: start, center, end.
--dot-nav-alignment: center;
Check libraries/slick.scss for more details.
Controls outside
To show direction + dot nav outside the contents, use the class slick-controls-outside
on any wrapper, or .slick,
slick--controlsoutside
right on the .slick wrapper (prefered).
If slick__nav becomes > viewport width, it switches to the style defined by the CSS variable --direction-nav-outside-fallback-behavoir (could be: 'overlay','inset' or 'hide').
Controls inset
To show direction + dot nav outside the contents, while not moving the direction nav outside the container, use the class slick-controls-inset
on any wrapper, or .slick, slick--controlsinset
right on the .slick wrapper (prefered).
See libraries/slick.scss for details.
Allow Overflow
For slideshows which needs visible overflow (eg: because you have elements with box-shadow inside), you can set slick-allow-overflow
on any wrapper. Its very important to set slick-allow-overflow-parent
on the section
wrapper, to prevent the horizonal overflow. Otherwise the document will become horizontally scrollable.