From a6b0d8432b737d974a22781b8a210f7c75977bde Mon Sep 17 00:00:00 2001 From: Volpeon Date: Wed, 18 Oct 2023 18:09:33 +0200 Subject: Improved bubble group customization --- src/layouts/_bubble-group.scss | 30 ++++++++++++++++++++++++++++-- src/objects/_bubble.scss | 15 ++++++++++++--- 2 files changed, 40 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/layouts/_bubble-group.scss b/src/layouts/_bubble-group.scss index 9336b44..6ee5c2e 100644 --- a/src/layouts/_bubble-group.scss +++ b/src/layouts/_bubble-group.scss @@ -32,8 +32,20 @@ } @include iro.bem-modifier('compact') { - justify-items: start; - gap: fn.dim(--compact --spacing-y) fn.dim(--compact --spacing-x); + gap: fn.dim(--compact --spacing-y) fn.dim(--compact --spacing-x); + + @include iro.bem-modifier('left') { + justify-items: start; + } + + @include iro.bem-modifier('right') { + justify-items: end; + } + } + + @include iro.bem-modifier('right') { + grid-template-columns: 1fr auto; + grid-template-areas: 'bubble avatar'; } @include iro.bem-modifier('arrow') { @@ -44,6 +56,20 @@ } } } + + @include iro.bem-modifier('right') { + @include iro.bem-elem('avatar') { + @include iro.bem-next-elem('bubble') { + &::before { + display: none; + } + + &::after { + display: block; + } + } + } + } } } } diff --git a/src/objects/_bubble.scss b/src/objects/_bubble.scss index fc2044b..477f475 100644 --- a/src/objects/_bubble.scss +++ b/src/objects/_bubble.scss @@ -29,15 +29,24 @@ background-color: fn.global-color(--bg); color: fn.global-color(--fg); - &::before { + &::before, + &::after { content: ''; display: none; position: absolute; top: 0; - left: calc(-1 * fn.dim(--arrow-size)); border: fn.dim(--arrow-size) solid fn.global-color(--bg); border-bottom-color: transparent; - border-left-color: transparent; + } + + &::before { + left: calc(-1 * fn.dim(--arrow-size)); + border-left-color: transparent; + } + + &::after { + right: calc(-1 * fn.dim(--arrow-size)); + border-right-color: transparent; } @include iro.bem-modifier('highlight') { -- cgit v1.2.3-70-g09d2