summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/_layouts.scss2
-rw-r--r--src/_objects.scss2
-rw-r--r--src/layouts/_message-group.scss (renamed from src/layouts/_bubble-group.scss)47
-rw-r--r--src/objects/_bubble.scss45
-rw-r--r--src/objects/_message.scss51
5 files changed, 91 insertions, 56 deletions
diff --git a/src/_layouts.scss b/src/_layouts.scss
index cc8b1c5..26cfe3f 100644
--- a/src/_layouts.scss
+++ b/src/_layouts.scss
@@ -4,4 +4,4 @@
4@use 'layouts/form'; 4@use 'layouts/form';
5@use 'layouts/flex'; 5@use 'layouts/flex';
6@use 'layouts/overflow'; 6@use 'layouts/overflow';
7@use 'layouts/bubble-group'; 7@use 'layouts/message-group';
diff --git a/src/_objects.scss b/src/_objects.scss
index faa45bd..578de0c 100644
--- a/src/_objects.scss
+++ b/src/_objects.scss
@@ -13,7 +13,7 @@
13@use 'objects/overflow-button'; 13@use 'objects/overflow-button';
14@use 'objects/status-indicator'; 14@use 'objects/status-indicator';
15@use 'objects/avatar'; 15@use 'objects/avatar';
16@use 'objects/bubble'; 16@use 'objects/message';
17@use 'objects/action-menu'; 17@use 'objects/action-menu';
18@use 'objects/menu'; 18@use 'objects/menu';
19@use 'objects/icon-nav'; 19@use 'objects/icon-nav';
diff --git a/src/layouts/_bubble-group.scss b/src/layouts/_message-group.scss
index e4bc666..d95c9e8 100644
--- a/src/layouts/_bubble-group.scss
+++ b/src/layouts/_message-group.scss
@@ -1,7 +1,9 @@
1@use 'iro-sass/src/index' as iro; 1@use 'iro-sass/src/index' as iro;
2@use '../functions' as fn; 2@use '../functions' as fn;
3 3
4@include iro.props-namespace('bubble-group') { 4@use '../objects/message';
5
6@include iro.props-namespace('message-group') {
5 @include iro.props-store(( 7 @include iro.props-store((
6 --dims: ( 8 --dims: (
7 --spacing-x: fn.global-dim(--size --225), 9 --spacing-x: fn.global-dim(--size --225),
@@ -19,16 +21,17 @@
19 display: grid; 21 display: grid;
20 grid-template-columns: auto 1fr; 22 grid-template-columns: auto 1fr;
21 grid-auto-rows: auto; 23 grid-auto-rows: auto;
22 grid-template-areas: 'avatar bubble' 'avatar .'; 24 grid-template-areas: 'avatar message' 'avatar .';
23 align-items: flex-start; 25 align-items: flex-start;
24 gap: 0 fn.dim(--spacing-x); 26 gap: 0 fn.dim(--spacing-x);
25 27
26 @include iro.bem-elem('avatar') { 28 @include iro.bem-elem('avatar') {
27 grid-area: avatar; 29 grid-area: avatar;
30 height: 0;
28 } 31 }
29 32
30 @include iro.bem-elem('bubble') { 33 @include iro.bem-elem('message') {
31 grid-column: bubble; 34 grid-column: message;
32 box-sizing: border-box; 35 box-sizing: border-box;
33 min-width: 0; 36 min-width: 0;
34 max-width: 100%; 37 max-width: 100%;
@@ -50,7 +53,7 @@
50 } 53 }
51 54
52 @include iro.bem-modifier('right') { 55 @include iro.bem-modifier('right') {
53 @include iro.bem-elem('bubble') { 56 @include iro.bem-elem('message') {
54 &::before { 57 &::before {
55 right: calc(-1 * fn.dim(--arrow-size)); 58 right: calc(-1 * fn.dim(--arrow-size));
56 left: auto; 59 left: auto;
@@ -71,7 +74,7 @@
71 justify-items: end; 74 justify-items: end;
72 } 75 }
73 76
74 @include iro.bem-elem('bubble') { 77 @include iro.bem-elem('message') {
75 @include iro.bem-next-twin-elem { 78 @include iro.bem-next-twin-elem {
76 margin-top: fn.dim(--compact --spacing-y); 79 margin-top: fn.dim(--compact --spacing-y);
77 } 80 }
@@ -80,12 +83,12 @@
80 83
81 @include iro.bem-modifier('right') { 84 @include iro.bem-modifier('right') {
82 grid-template-columns: 1fr auto; 85 grid-template-columns: 1fr auto;
83 grid-template-areas: 'bubble avatar' '. avatar'; 86 grid-template-areas: 'message avatar' '. avatar';
84 } 87 }
85 88
86 @include iro.bem-modifier('no-avatar') { 89 @include iro.bem-modifier('no-avatar') {
87 grid-template-columns: 1fr; 90 grid-template-columns: 1fr;
88 grid-template-areas: 'bubble'; 91 grid-template-areas: 'message';
89 92
90 @include iro.bem-elem('avatar') { 93 @include iro.bem-elem('avatar') {
91 display: none; 94 display: none;
@@ -93,7 +96,7 @@
93 } 96 }
94 97
95 @include iro.bem-modifier('arrow') { 98 @include iro.bem-modifier('arrow') {
96 @include iro.bem-elem('bubble') { 99 @include iro.bem-elem('message') {
97 &::before { 100 &::before {
98 display: block; 101 display: block;
99 } 102 }
@@ -105,5 +108,31 @@
105 } 108 }
106 } 109 }
107 } 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 }
108 } 137 }
109} 138}
diff --git a/src/objects/_bubble.scss b/src/objects/_bubble.scss
deleted file mode 100644
index d91b6d1..0000000
--- a/src/objects/_bubble.scss
+++ /dev/null
@@ -1,45 +0,0 @@
1@use 'iro-sass/src/index' as iro;
2@use '../functions' as fn;
3
4@include iro.props-namespace('bubble') {
5 @include iro.props-store((
6 --dims: (
7 --pad-x: fn.global-dim(--size --200),
8 --pad-y: fn.global-dim(--size --150),
9 --rounding: 0,
10
11 --75: (
12 --pad-x: fn.global-dim(--size --150),
13 --pad-y: fn.global-dim(--size --85),
14 ),
15 )
16 ), 'dims');
17
18 @include iro.props-store((
19 --colors: (
20 --highlight: fn.global-color(--fg-lo),
21 ),
22 ), 'colors');
23
24 @include iro.bem-object(iro.props-namespace()) {
25 position: relative;
26 padding: fn.dim(--pad-y) fn.dim(--pad-x);
27 border-radius: fn.dim(--rounding);
28 background-color: fn.global-color(--bg);
29 color: fn.global-color(--fg);
30
31 @include iro.bem-modifier('highlight') {
32 box-shadow: -3px 0 0 0 fn.color(--highlight);
33 }
34
35 @include iro.bem-elem('suffix') {
36 margin-left: 1em;
37 float: right;
38 transform: translate(.2em, .2em);
39 }
40
41 @include iro.bem-modifier('75') {
42 padding: fn.dim(--75 --pad-y) fn.dim(--75 --pad-x);
43 }
44 }
45}
diff --git a/src/objects/_message.scss b/src/objects/_message.scss
new file mode 100644
index 0000000..283ce26
--- /dev/null
+++ b/src/objects/_message.scss
@@ -0,0 +1,51 @@
1@use 'iro-sass/src/index' as iro;
2@use '../functions' as fn;
3
4@include iro.props-namespace('message') {
5 @include iro.props-store((
6 --dims: (
7 --bubble: (
8 --pad-x: fn.global-dim(--size --200),
9 --pad-y: fn.global-dim(--size --150),
10 --rounding: 0,
11
12 --75: (
13 --pad-x: fn.global-dim(--size --150),
14 --pad-y: fn.global-dim(--size --85),
15 ),
16 ),
17 )
18 ), 'dims');
19
20 @include iro.props-store((
21 --colors: (
22 --highlight: fn.global-color(--fg-lo),
23 ),
24 ), 'colors');
25
26 @include iro.bem-object(iro.props-namespace()) {
27 @include iro.bem-elem('suffix') {
28 margin-left: 1em;
29 float: right;
30 }
31
32 @include iro.bem-modifier('bubble') {
33 padding: fn.dim(--bubble --pad-y) fn.dim(--bubble --pad-x);
34 border-radius: fn.dim(--bubble --rounding);
35 background-color: fn.global-color(--bg);
36 color: fn.global-color(--fg);
37
38 @include iro.bem-elem('suffix') {
39 transform: translate(.2em, .2em);
40 }
41
42 @include iro.bem-modifier('highlight') {
43 box-shadow: -3px 0 0 0 fn.color(--highlight);
44 }
45
46 @include iro.bem-modifier('75') {
47 padding: fn.dim(--bubble --75 --pad-y) fn.dim(--bubble --75 --pad-x);
48 }
49 }
50 }
51}