Skip to content

Commit bb05c20

Browse files
chore: various styling fixes (#3111)
- fix Gallery paddings - fix prompt icon size - adjust ChannelListItemActionButtons
1 parent fb8e99b commit bb05c20

91 files changed

Lines changed: 1700 additions & 1671 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/vite/src/index.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ body {
143143
min-width: 1px;
144144
height: 100%;
145145
z-index: 1;
146+
background: var(--border-core-default);
146147
}
147148

148149
.app-chat-resize-handle__hitbox {
@@ -164,7 +165,7 @@ body {
164165
.app-chat-resize-handle__line {
165166
width: 1px;
166167
height: 100%;
167-
background: var(--str-chat__surface-color);
168+
background: transparent;
168169
}
169170

170171
.app-chat-resize-handle--thread {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.str-chat__ai-state-indicator-container {
22
padding: 0 8px;
3-
background-color: var(--str-chat__grey300);
3+
background-color: var(--background-core-surface);
44
}
55

66
.str-chat__ai-state-indicator-text {
7-
color: var(--str-chat__text-color);
7+
color: var(--text-primary);
88
}

src/components/Attachment/styling/Attachment.scss

Lines changed: 9 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
--str-chat__attachment-list-border-radius: 0;
88

99
/* The text/icon color of the component */
10-
--str-chat__attachment-list-color: var(--str-chat__text-color);
10+
--str-chat__attachment-list-color: var(--text-primary);
1111

1212
/* The background color of the component */
1313
--str-chat__attachment-list-background-color: transparent;
@@ -33,7 +33,7 @@
3333
);
3434

3535
/* The text/icon color of image/video attachments (images/videos uploaded from files, scraped media, GIFs) */
36-
--str-chat__image-attachment-color: var(--str-chat__text-color);
36+
--str-chat__image-attachment-color: var(--text-primary);
3737

3838
/* The background color of image/video attachments (images/videos uploaded from files, scraped media, GIFs) */
3939
--str-chat__image-attachment-background-color: transparent;
@@ -59,7 +59,7 @@
5959
);
6060

6161
/* The text/icon color of image gallery attachments */
62-
--str-chat__image-gallery-attachment-color: var(--str-chat__text-color);
62+
--str-chat__image-gallery-attachment-color: var(--text-primary);
6363

6464
/* The background color of image gallery attachments */
6565
--str-chat__image-gallery-attachment-background-color: transparent;
@@ -79,51 +79,13 @@
7979
/* Box shadow applied to image gallery attachments */
8080
--str-chat__image-gallery-attachment-box-shadow: none;
8181

82-
/* Overlay color applied to image gallery attachments */
83-
--str-chat__image-gallery-attachment-overlay: var(--str-chat__secondary-overlay-color);
84-
85-
/* Text colors used on overlay applied to image gallery attachments */
86-
--str-chat__image-gallery-attachment-overlay-text-color: var(
87-
--str-chat__secondary-overlay-text-color
88-
);
89-
90-
/* The border radius used for the borders of card attachments */
91-
--str-chat__card-attachment-border-radius: 0;
92-
93-
/* The text/icon color of card attachments */
94-
--str-chat__card-attachment-color: var(--str-chat__text-color);
95-
96-
/* The text color of links inside card attachments */
97-
--str-chat__card-attachment-link-color: var(--str-chat__primary-color);
98-
99-
/* The background color of card attachments */
100-
--str-chat__card-attachment-background-color: transparent;
101-
102-
/* Top border of card attachments */
103-
--str-chat__card-attachment-border-block-start: none;
104-
105-
/* Bottom border of card attachments */
106-
--str-chat__card-attachment-border-block-end: none;
107-
108-
/* Left (right in RTL layout) border of card attachments */
109-
--str-chat__card-attachment-border-inline-start: none;
110-
111-
/* Right (left in RTL layout) border of card attachments */
112-
--str-chat__card-attachment-border-inline-end: none;
113-
114-
/* Box shadow applied to card attachments */
115-
--str-chat__card-attachment-box-shadow: none;
116-
11782
/* The border radius used for the borders of file attachments */
11883
--str-chat__file-attachment-border-radius: calc(
11984
var(--str-chat__message-bubble-border-radius) - var(--str-chat__attachment-margin)
12085
);
12186

12287
/* The text/icon color of file attachments */
123-
--str-chat__file-attachment-color: var(--str-chat__text-color);
124-
125-
/* The text/icon color of file attachments for low emphasis texts (for example file size) */
126-
--str-chat__file-attachment-secondary-color: var(--str-chat__text-low-emphasis-color);
88+
--str-chat__file-attachment-color: var(--text-primary);
12789

12890
/* The background color of file attachments */
12991
--str-chat__file-attachment-background-color: transparent;
@@ -142,42 +104,6 @@
142104

143105
/* Box shadow applied to file attachments */
144106
--str-chat__file-attachment-box-shadow: none;
145-
146-
/* Border radius applied to the play / pause button of audio widget */
147-
--str-chat__audio-attachment-controls-button-border-radius: var(
148-
--str-chat__border-radius-circle
149-
);
150-
151-
/* Text color applied to audio widget's play / pause button */
152-
--str-chat__audio-attachment-controls-button-color: var(--str-chat__text-color);
153-
154-
/* Background color applied to audio widget's play / pause button */
155-
--str-chat__audio-attachment-controls-button-background-color: var(
156-
--str-chat__secondary-background-color
157-
);
158-
159-
/* Background color applied to audio widget's play / pause button when in pressed (active) state */
160-
--str-chat__audio-attachment-controls-button-pressed-background-color: var(
161-
--str-chat__surface-color
162-
);
163-
164-
/* Top border of audio widget's play / pause button */
165-
--str-chat__audio-attachment-controls-button-border-block-start: none;
166-
167-
/* Bottom border of audio widget's play / pause button */
168-
--str-chat__audio-attachment-controls-button-border-block-end: none;
169-
170-
/* Left (right in RTL layout) border of audio widget's play / pause button */
171-
--str-chat__audio-attachment-controls-button-border-inline-start: none;
172-
173-
/* Right (left in RTL layout) border of audio widget's play / pause button */
174-
--str-chat__audio-attachment-controls-button-border-inline-end: none;
175-
176-
// todo: we need to solve whether we want to keep the CSS variables. E.g. --str-chat__circle-fab-box-shadow is not declared.
177-
/* Box shadow applied to audio widget's play / pause button */
178-
--str-chat__audio-attachment-controls-button-box-shadow: var(
179-
--str-chat__circle-fab-box-shadow
180-
);
181107
}
182108

183109
.str-chat__attachment-list {
@@ -204,12 +130,12 @@
204130

205131
.str-chat__message-attachment {
206132
overflow: hidden;
207-
background-color: var(--chat-bg-attachment-incoming);
133+
background-color: var(--chat-bg-attachment);
208134
border-radius: var(--message-bubble-radius-attachment);
209135

210136
// Many classes to increase selector specificity
211137
.str-chat__button-play.str-chat__button--secondary.str-chat__button--outline {
212-
border-color: var(--chat-border-on-chat-incoming);
138+
border-color: var(--chat-border-on-chat);
213139
background-color: transparent;
214140
}
215141
}
@@ -365,7 +291,7 @@
365291
}
366292

367293
.str-chat__message-attachment-download-icon {
368-
--str-chat-icon-height: calc(var(--str-chat__spacing-px) * 16);
294+
--str-chat-icon-height: var(--size-16);
369295
}
370296
}
371297

@@ -383,39 +309,19 @@
383309
}
384310

385311
.str-chat__message-bubble {
386-
border: 1px solid var(--chat-border-incoming);
312+
border: 1px solid var(--chat-border);
387313
box-shadow: var(--background-core-elevation-0);
388314
}
389315

390316
.str-chat__message-attachment {
391-
background-color: var(--chat-bg-incoming);
317+
background-color: var(--chat-bg);
392318
}
393319
}
394320

395321
.str-chat__message--me {
396322
.str-chat__attachment-list {
397323
align-items: flex-end;
398324
}
399-
400-
.str-chat__message-attachment {
401-
background-color: var(--chat-bg-attachment-outgoing);
402-
border-radius: var(--message-bubble-radius-attachment);
403-
404-
.str-chat__button-play.str-chat__button--secondary.str-chat__button--outline {
405-
border-color: var(--chat-border-on-chat-outgoing);
406-
}
407-
}
408-
409-
&.str-chat__message--has-single-attachment.str-chat__message--has-no-text {
410-
.str-chat__message-bubble {
411-
border: 1px solid var(--chat-border-outgoing);
412-
box-shadow: var(--background-core-elevation-0);
413-
}
414-
415-
.str-chat__message-attachment {
416-
background-color: var(--chat-bg-outgoing);
417-
}
418-
}
419325
}
420326

421327
.str-chat__li--single,

src/components/Attachment/styling/AttachmentActions.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@
5050
--str-chat__attachment-action-box-shadow: none;
5151

5252
/* The text/icon color of an attachment action while in pressed state */
53-
--str-chat__attachment-action-active-color: var(--str-chat__primary-color);
53+
--str-chat__attachment-action-active-color: var(--accent-primary);
5454

5555
/* The text/icon color of an attachment action while in pressed state */
56-
--str-chat__attachment-action-focus-color: var(--str-chat__primary-color);
56+
--str-chat__attachment-action-focus-color: var(--accent-primary);
5757
}
5858

5959
.str-chat__message-attachment-actions {

src/components/Attachment/styling/Audio.scss

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@
77
);
88

99
/* Text color used in audio widget */
10-
--str-chat__audio-attachment-widget-color: var(--str-chat__text-color);
11-
12-
/* Border radius applied audio widget */
13-
--str-chat__audio-attachment-widget-secondary-color: var(
14-
--str-chat__text-low-emphasis-color
15-
);
10+
--str-chat__audio-attachment-widget-color: var(--text-primary);
1611

1712
/* The text/icon color for low emphasis texts (for example file size) in audio widget */
1813
--str-chat__audio-attachment-widget-background-color: transparent;
@@ -52,7 +47,7 @@
5247
}
5348

5449
.str-chat__message-attachment-audio-widget--progress-track {
55-
//max-width: calc(var(--str-chat__spacing-px) * 120);
50+
//max-width: 120px
5651
}
5752

5853
.str-chat__message-attachment-audio-widget--text-first-row {
@@ -67,7 +62,7 @@
6762
}
6863

6964
.str-chat__message-attachment-audio-widget--title {
70-
font: var(--str-chat__caption-emphasis-text);
65+
font: var(--str-chat__font-caption-emphasis);
7166
min-width: 0;
7267
overflow: hidden;
7368
text-overflow: ellipsis;
@@ -79,7 +74,7 @@
7974

8075
.str-chat__duration-display {
8176
width: 40px;
82-
font: var(--str-chat__metadata-default-text);
77+
font: var(--str-chat__font-metadata-default);
8378
color: var(--text-secondary);
8479
}
8580

@@ -90,7 +85,6 @@
9085
gap: var(--spacing-xs);
9186

9287
.str-chat__message-attachment-file--item-size {
93-
line-height: calc(var(--str-chat__spacing-px) * 14);
9488
font: var(--str-chat__font-metadata-default);
9589
}
9690
}

src/components/Attachment/styling/Geolocation.scss

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,10 @@
77
);
88

99
/* The text/icon color of geolocation attachments */
10-
--str-chat__geolocation-attachment-color: var(--str-chat__text-color);
11-
12-
/* The text/icon color of geolocation attachments for low emphasis texts (for example file size) */
13-
--str-chat__geolocation-attachment-secondary-color: var(
14-
--str-chat__text-low-emphasis-color
15-
);
10+
--str-chat__geolocation-attachment-color: var(--chat-text);
1611

1712
/* The background color of geolocation attachments */
18-
--str-chat__geolocation-attachment-background-color: var(
19-
--str-chat__secondary-background-color
20-
);
13+
--str-chat__geolocation-attachment-background-color: var(--chat-bg-attachment);
2114

2215
/* Top border of geolocation attachments */
2316
--str-chat__geolocation-attachment-border-block-start: none;
@@ -79,8 +72,8 @@
7972
display: flex;
8073
justify-content: center;
8174
padding: 0.5rem;
82-
background-color: var(--str-chat__tertiary-surface-color);
83-
font: var(--str-chat__caption-default-text);
75+
background-color: var(--background-core-surface-subtle);
76+
font: var(--str-chat__font-caption-default);
8477

8578
.str-chat__message-attachment-geolocation__status--active {
8679
display: flex;
@@ -89,12 +82,12 @@
8982
gap: 0.375rem;
9083

9184
.str-chat__message-attachment-geolocation__status--active-status {
92-
color: var(--str-chat__info-color);
85+
color: var(--accent-success);
9386
}
9487

9588
.str-chat__message-attachment-geolocation__status--active-until {
9689
text-transform: lowercase;
97-
font: var(--str-chat__metadata-emphasis-text);
90+
font: var(--str-chat__font-metadata-emphasis);
9891
}
9992
}
10093
}

src/components/Attachment/styling/Giphy.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
.str-chat {
44
/* The height of GIFs */
5-
--str-chat__gif-height: calc(var(--str-chat__spacing-px) * 200);
5+
--str-chat__gif-height: 200px;
66
}
77

88
.str-chat__message-attachment-giphy {
@@ -68,7 +68,7 @@
6868
gap: var(--spacing-xs, 8px);
6969
align-self: stretch;
7070

71-
color: var(--chat-text-outgoing);
71+
color: var(--chat-text);
7272
font-size: var(--typography-font-size-sm);
7373
font-weight: var(--typography-font-weight-semi-bold);
7474
line-height: var(--typography-line-height-tight);

src/components/Attachment/styling/LinkPreview.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
line-height: var(--typography-line-height-tight);
2121

2222
* {
23-
color: var(--chat-text-incoming);
23+
color: var(--chat-text);
2424
}
2525

2626
.str-chat__message-attachment-card--header {

src/components/Attachment/styling/ModalGallery.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@
33
.str-chat__message {
44
--str-chat__modal-gallery-load-failed-indicator-background: var(--accent-error);
55
--str-chat__modal-gallery-load-failed-indicator-color: var(--text-inverse);
6-
--str-chat__modal-gallery-loading-background: var(--chat-bg-incoming);
6+
--str-chat__modal-gallery-loading-background: var(--chat-bg);
77
--str-chat__modal-gallery-loading-base: var(--skeleton-loading-base);
88
--str-chat__modal-gallery-loading-highlight: var(--skeleton-loading-highlight);
99
}
1010

11-
.str-chat__message--me {
12-
--str-chat__modal-gallery-loading-background: var(--chat-bg-outgoing);
13-
}
14-
1511
.str-chat__attachment-list {
1612
.str-chat__message-attachment--gallery {
1713
$max-width: var(--str-chat__attachment-max-width);

src/components/Attachment/styling/UnsupportedAttachment.scss

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,7 @@
88
);
99

1010
/* The text/icon color of file attachments */
11-
--str-chat__unsupported-attachment-color: var(--str-chat__text-color);
12-
13-
/* The text/icon color of file attachments for low emphasis texts (for example file size) */
14-
--str-chat__unsupported-attachment-secondary-color: var(
15-
--str-chat__text-low-emphasis-color
16-
);
11+
--str-chat__unsupported-attachment-color: var(--text-primary);
1712

1813
/* The background color of file attachments */
1914
--str-chat__unsupported-attachment-background-color: transparent;
@@ -43,8 +38,8 @@
4338
column-gap: var(--spacing-xs);
4439

4540
.str-chat__icon {
46-
height: calc(var(--str-chat__spacing-px) * 20);
47-
width: calc(var(--str-chat__spacing-px) * 20);
41+
height: var(--size-20);
42+
width: var(--size-20);
4843
}
4944

5045
.str-chat__message-attachment-unsupported__metadata {

0 commit comments

Comments
 (0)