summaryrefslogtreecommitdiffstats
path: root/src/layouts/_message-group.scss
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2023-11-09 15:44:54 +0100
committerVolpeon <git@volpeon.ink>2023-11-09 15:44:54 +0100
commit679b9b108101b67ad56b4fdf35ec2bd0568d8d84 (patch)
tree1b097e9f90627ca401174c738a8d754e8f2cce6b /src/layouts/_message-group.scss
parentSimplified bubble arrows (diff)
downloadiro-design-679b9b108101b67ad56b4fdf35ec2bd0568d8d84.tar.gz
iro-design-679b9b108101b67ad56b4fdf35ec2bd0568d8d84.tar.bz2
iro-design-679b9b108101b67ad56b4fdf35ec2bd0568d8d84.zip
Renamed "bubble" to "message", added message group merging
Diffstat (limited to 'src/layouts/_message-group.scss')
-rw-r--r--src/layouts/_message-group.scss138
1 files changed, 138 insertions, 0 deletions
diff --git a/src/layouts/_message-group.scss b/src/layouts/_message-group.scss
new file mode 100644
index 0000000..d95c9e8
--- /dev/null
+++ b/src/layouts/_message-group.scss
@@ -0,0 +1,138 @@
1@use 'iro-sass/src/index' as iro;
2@use '../functions' as fn;
3
4@use '../objects/message';
5
6@include iro.props-namespace('message-group') {
7 @include iro.props-store((
8 --dims: (
9 --spacing-x: fn.global-dim(--size --225),
10 --spacing-y: fn.global-dim(--size --150),
11 --arrow-size: fn.global-dim(--size --100),
12
13 --compact: (
14 --spacing-x: fn.global-dim(--size --225),
15 --spacing-y: fn.global-dim(--size --50),
16 )
17 )
18 ), 'dims');
19
20 @include iro.bem-layout(iro.props-namespace()) {
21 display: grid;
22 grid-template-columns: auto 1fr;
23 grid-auto-rows: auto;
24 grid-template-areas: 'avatar message' 'avatar .';
25 align-items: flex-start;
26 gap: 0 fn.dim(--spacing-x);
27
28 @include iro.bem-elem('avatar') {
29 grid-area: avatar;
30 height: 0;
31 }
32
33 @include iro.bem-elem('message') {
34 grid-column: message;
35 box-sizing: border-box;
36 min-width: 0;
37 max-width: 100%;
38
39 &::before {
40 content: '';
41 display: none;
42 position: absolute;
43 top: 0;
44 left: calc(-1 * fn.dim(--arrow-size));
45 border: fn.dim(--arrow-size) solid fn.global-color(--bg);
46 border-bottom-color: transparent;
47 border-left-color: transparent;
48 }
49
50 @include iro.bem-next-twin-elem {
51 margin-top: fn.dim(--spacing-y);
52 }
53 }
54
55 @include iro.bem-modifier('right') {
56 @include iro.bem-elem('message') {
57 &::before {
58 right: calc(-1 * fn.dim(--arrow-size));
59 left: auto;
60 border-right-color: transparent;
61 border-left-color: fn.global-color(--bg);
62 }
63 }
64 }
65
66 @include iro.bem-modifier('compact') {
67 gap: 0 fn.dim(--compact --spacing-x);
68
69 @include iro.bem-modifier('left') {
70 justify-items: start;
71 }
72
73 @include iro.bem-modifier('right') {
74 justify-items: end;
75 }
76
77 @include iro.bem-elem('message') {
78 @include iro.bem-next-twin-elem {
79 margin-top: fn.dim(--compact --spacing-y);
80 }
81 }
82 }
83
84 @include iro.bem-modifier('right') {
85 grid-template-columns: 1fr auto;
86 grid-template-areas: 'message avatar' '. avatar';
87 }
88
89 @include iro.bem-modifier('no-avatar') {
90 grid-template-columns: 1fr;
91 grid-template-areas: 'message';
92
93 @include iro.bem-elem('avatar') {
94 display: none;
95 }
96 }
97
98 @include iro.bem-modifier('arrow') {
99 @include iro.bem-elem('message') {
100 &::before {
101 display: block;
102 }
103
104 @include iro.bem-next-twin-elem {
105 &::before {
106 display: none;
107 }
108 }
109 }
110 }
111
112 & + & {
113 @include iro.bem-modifier('merge') {
114 margin-top: fn.dim(--spacing-y);
115
116 @include iro.bem-elem('avatar') {
117 visibility: hidden;
118 }
119
120 @include iro.bem-modifier('compact') {
121 margin-top: fn.dim(--compact --spacing-y);
122 }
123
124 @include iro.bem-elem('merge-hide') {
125 display: none;
126 }
127
128 @include iro.bem-modifier('arrow') {
129 @include iro.bem-elem('message') {
130 &::before {
131 display: none;
132 }
133 }
134 }
135 }
136 }
137 }
138}