From 196b141af5f133978e12e4819097fbd9e699e97a Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 11 Sep 2024 09:29:18 +0200 Subject: [PATCH] [Glitch] Change inner borders in media galleries in web UI Port a3215c0f88bb5f436bed665ad26175923544d9d4 to glitch-soc Signed-off-by: Claire --- .../glitch/components/media_gallery.jsx | 2 +- .../flavours/glitch/styles/components.scss | 58 +++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/components/media_gallery.jsx b/app/javascript/flavours/glitch/components/media_gallery.jsx index 1710ca9691..5be5fb4c58 100644 --- a/app/javascript/flavours/glitch/components/media_gallery.jsx +++ b/app/javascript/flavours/glitch/components/media_gallery.jsx @@ -312,7 +312,7 @@ class MediaGallery extends PureComponent { const style = {}; - const computedClass = classNames('media-gallery', { 'full-width': fullwidth }); + const computedClass = classNames('media-gallery', `media-gallery--layout-${size}`, { 'full-width': fullwidth }); if (this.isStandaloneEligible()) { // TODO: cropImages setting style.aspectRatio = `${this.props.media.getIn([0, 'meta', 'small', 'aspect'])}`; diff --git a/app/javascript/flavours/glitch/styles/components.scss b/app/javascript/flavours/glitch/styles/components.scss index e450b2c5c3..c773b991ef 100644 --- a/app/javascript/flavours/glitch/styles/components.scss +++ b/app/javascript/flavours/glitch/styles/components.scss @@ -7359,6 +7359,64 @@ img.modal-warning { inset-inline-start: 8px; display: flex; gap: 2px; + + &--layout-2 { + .media-gallery__item:nth-child(1) { + border-end-end-radius: 0; + border-start-end-radius: 0; + } + + .media-gallery__item:nth-child(2) { + border-start-start-radius: 0; + border-end-start-radius: 0; + } + } + + &--layout-3 { + .media-gallery__item:nth-child(1) { + border-end-end-radius: 0; + border-start-end-radius: 0; + } + + .media-gallery__item:nth-child(2) { + border-start-start-radius: 0; + border-end-start-radius: 0; + border-end-end-radius: 0; + } + + .media-gallery__item:nth-child(3) { + border-start-start-radius: 0; + border-end-start-radius: 0; + border-start-end-radius: 0; + } + } + + &--layout-4 { + .media-gallery__item:nth-child(1) { + border-end-end-radius: 0; + border-start-end-radius: 0; + border-end-start-radius: 0; + } + + .media-gallery__item:nth-child(2) { + border-start-start-radius: 0; + border-end-start-radius: 0; + border-end-end-radius: 0; + } + + .media-gallery__item:nth-child(3) { + border-start-start-radius: 0; + border-start-end-radius: 0; + border-end-start-radius: 0; + border-end-end-radius: 0; + } + + .media-gallery__item:nth-child(4) { + border-start-start-radius: 0; + border-end-start-radius: 0; + border-start-end-radius: 0; + } + } } .media-gallery__alt__label,