Bricks Accordion (Nestable) Element’s Icons

Bricks comes with 2 elements for building accordions: Accordion and Accordion (Nestable).

It is possible to set the old Accordion element’s regular and expanded-state icons via a theme style that applies to the entire website (make sure to remove the icons from the element itself since they override theme style).

Unfortunately the same is not possible with the element that you are most likely to use – Accordion (Nestable).

Out of the box, the icons appear like this in both normal and expanded states:

Bricks team could have at least added a line of CSS to rotate the icons in the opened state.

Nevertheless, we can add this custom CSS to turn the arrow to a down arrow in the default state and up arrow in expanded state:

.accordion-title-wrapper .brxe-icon {
    transform: rotate(90deg);
    transition: 200ms transform ease-in-out;
}

.brx-open .accordion-title-wrapper .brxe-icon {
    transform: rotate(-90deg);
}

If you want more controls and flexibility like being able to set different icons for normal and expanded states, consider the Pro Accordion element in our BricksExtras plugin instead.

Reference

https://forum.bricksbuilder.io/t/wip-accordion-nestable-icon-on-expanded/5035/4?u=sridhar

Get access to all 524 Bricks code tutorials with BricksLabs Pro

1 comment

  • the brxe-open state is added when the item is opened fully so any transistion to the icon is done with a 200ms delay,

    have any other method?

Leave your comment

 

Related Tutorials..

Auto-Scroll to the New Open Accordion Item

Auto-Scroll to the New Open Accordion Item

How we can make sure the scroll position is always synced with the accordion when opened.
Categories:
Tags:
Pro
Dynamic Accordion in WordPress using Meta Box and Alpine.js

Dynamic Accordion in WordPress using Meta Box and Alpine.js

This Pro tutorial provides the steps to implement an accordion using Alpine.js in WordPress that pulls the values of sub fields of a Meta Box…
Pro
WooCommerce Product Carousel in Bricks

WooCommerce Product Carousel in Bricks

How to set up a carousel that shows WooCommerce products with the product title, price and Add to Cart button for each.
Categories:
Pro
Dynamic Horizontal Posts Accordion in Bricks

Dynamic Horizontal Posts Accordion in Bricks

Creating a horizontal accordion of featured images from posts output by Bricks' query loop.
Categories:
Tags:
Making Bricks Nestable Accordion’s First Item Open on Desktop and Closed on Mobile

Making Bricks Nestable Accordion’s First Item Open on Desktop and Closed on Mobile

Using JS to ensure the accordion first entry is open on desktop but closed on mobile.
Categories:
Tags:
Pro
Accordion Grid Query Loop in Bricks

Accordion Grid Query Loop in Bricks

How to set up a accordion in Bricks such that the "titles" are arranged in a grid with the full width content opening below.
Categories: