Skip to content

Commit

Permalink
New: Add support for vertical accordion items and custom title icons (f…
Browse files Browse the repository at this point in the history
…ixes #529) (#530)

* Add support for vertical accordion items and custom title icons

* Moved structural vertical styles to plugin

* Updated class name
  • Loading branch information
guywillis authored Nov 20, 2024
1 parent 324b1fa commit f70bd70
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions less/plugins/adapt-contrib-accordion/accordion.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
position: relative;
padding-top: @item-padding;
padding-bottom: @item-padding;
padding-inline: @item-padding (@icon-size + (@item-padding * 2));
padding-inline-start: @item-padding;
padding-inline-end: @icon-size + (@item-padding * 2);
text-align: start;
background-color: @item-color;
color: @item-color-inverted;
Expand All @@ -18,6 +19,10 @@
}
}

&__btn.has-title-icon {
padding-inline-start: @icon-size + (@item-padding * 2);
}

&__btn.is-visited {
background-color: @visited;
color: @visited-inverted;
Expand All @@ -28,7 +33,19 @@
color: @item-color-inverted-selected;
}

&__icon {
&:not(.is-center-aligned) &__title-icon {
position: absolute;
top: 50%;
left: @item-padding;
.transform(translateY(-50%));

.dir-rtl & {
left: inherit;
right: @item-padding;
}
}

&:not(.is-center-aligned) &__icon {
position: absolute;
top: 50%;
right: @item-padding;
Expand All @@ -52,4 +69,14 @@
&.has-img-zoom &__image-container {
.img-zoom();
}

// vertical items
&.is-center-aligned &__btn {
padding-inline: @item-padding;
}

&.is-center-aligned &__title-icon,
&.is-center-aligned &__title {
padding-bottom: @icon-padding / 2;
}
}

0 comments on commit f70bd70

Please sign in to comment.