10

Content Toggler block: change fixed height to max height

new
July 6, 2024

I\’m using a content toggler block in a template, but sometimes the content is not as long as the height set under the \”height of toggle\” field.

That results in a whitespace below the content, followed by the toggler.

This can be easily fixed by the following code:

.gs-toggler-wrapper {
height: auto;
max-height: the height set in the height of toggle field;
}

.gs-toggler-wrapper.gs-toggler-open {
max-height: none;
}

Ideally, the toggler won\’t be shown at all if the content is less high than the set height, but I don\’t know if that can be done with CSS only.

Leave a Reply

Your email address will not be published. Required fields are marked *

Latest Voters