include icon.pug mixin lightbox(images) - let classes = { 'o-lightbox': true, 'o-lightbox--interactive': attributes.interactive, } let linksClasses = { 's-links': true, } let thumbnailClasses = { 'o-thumbnail': true, } if (attributes.theme) { classes[`o-lightbox--${attributes.theme}`] = true; linksClasses[`s-links--${attributes.theme}`] = true; thumbnailClasses[`o-thumbnail--${attributes.theme}`] = true; } div(class=classes) header.o-lightbox__header div(class=linksClasses) block +action-button(theme=attributes.theme pill=true quiet=true icon='x' class='o-lightbox__close-btn') each img, i in images img(src=images[i] id=('image-' + i) class=`o-lightbox__img ${attributes.interactive && !i ? 'is-visible' : ''}`) if images.length > 1 +action-button(theme=attributes.theme pill=true quiet=true icon='chevron-left' class='o-lightbox__nav-btn o-lightbox__nav-btn--prev') +action-button(theme=attributes.theme pill=true quiet=true icon='chevron-right' class='o-lightbox__nav-btn o-lightbox__nav-btn--next') .o-lightbox__thumbnails each img, i in images - let classes = { 'is-selected': i === 0 } Object.assign(classes, thumbnailClasses) a.o-thumbnail(class=classes href='#image-' + i) img.o-thumbnail__image(src=img) button(class=thumbnailClasses) +icon('volume-2')(class='o-thumbnail__icon') button(class=thumbnailClasses) +icon('video')(class='o-thumbnail__icon')