feat(carousel): adjust item width calculation for better distribution and responsiveness
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
<section class="carousel" role="region" [attr.aria-label]="ariaLabel()">
|
||||
<div
|
||||
class="carousel__frame"
|
||||
[class.carousel__frame--with-controls]="hasMultipleItems()"
|
||||
[style.width.px]="frameWidth()"
|
||||
>
|
||||
<div class="carousel__frame" [class.carousel__frame--with-controls]="hasMultipleItems()">
|
||||
<div
|
||||
#viewport
|
||||
class="carousel__viewport"
|
||||
@@ -29,7 +25,7 @@
|
||||
[attr.inert]="page.slot === 'current' ? null : ''"
|
||||
>
|
||||
@for (entry of page.items; track trackBy()(entry.index, entry.item)) {
|
||||
<div class="carousel__item">
|
||||
<div class="carousel__item" [style.width.px]="itemWidth()">
|
||||
<ng-container
|
||||
[ngTemplateOutlet]="itemTemplate()"
|
||||
[ngTemplateOutletContext]="{ $implicit: entry.item, index: entry.index }"
|
||||
@@ -42,7 +38,7 @@
|
||||
} @else {
|
||||
<div class="carousel__linear-track" [style.gap.px]="resolvedGap()">
|
||||
@for (item of items(); track trackBy()($index, item); let index = $index) {
|
||||
<div class="carousel__item">
|
||||
<div class="carousel__item" [style.width.px]="itemWidth()">
|
||||
<ng-container
|
||||
[ngTemplateOutlet]="itemTemplate()"
|
||||
[ngTemplateOutletContext]="{ $implicit: item, index }"
|
||||
|
||||
Reference in New Issue
Block a user