This module automatically aligns HTML elements to the same height, ensuring they all match the tallest element within a specified group. It is fully responsive, has no dependencies, and can be configured with unlimited CSS selectors.
Small module providing a library to automagically align HTML elements with each other by setting their height to the tallest.
Fully responsive. Zero dependencies. Unlimited selectors.
How to use
The trick is to attach the library and set the data-same-height attribute with a list of DOM selectors.
For instance in code below, we will align all .item-title together and all .item-description together too.
{{ attach_library('same_height/same_height') }}
{%
set sameHeight = [
'.item-title',
'.item-description'
]
%}
<div class="row" data-same-height="{{ sameHeight|json_encode }}">
{% for item in items %}
<div class="col-12 col-md-4 item">
<h3 class="item-title">{{ item.title }}</h3>
<p class="item-description">{{ item.description}}</p>
</div>
{% endfor %}
</div>
Ask your assistant about Same Height
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.