Skip to content

Commit d747e02

Browse files
refactor: put css in ChatBox component
1 parent 5e18627 commit d747e02

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

wanderlust.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def ChatMessage(message):
132132
elif message.role == "user":
133133
solara.Text(
134134
message.content[0].text.value,
135-
classes=["chat-message", "user-message"],
135+
classes=["chat-message", "chat-user-message"],
136136
)
137137
elif message.role == "assistant":
138138
if message.content[0].text.value:
@@ -172,6 +172,16 @@ def ChatBox(children=[]):
172172
# this uses a flexbox with column-reverse to reverse the order of the messages
173173
# if we now also reverse the order of the messages, we get the correct order
174174
# but the scroll position is at the bottom of the container automatically
175+
solara.Style(
176+
"""
177+
.chat-box > :last-child{
178+
padding-top: 7.5vh;
179+
}
180+
.chat-user-message{
181+
font-weight: bold;
182+
}
183+
"""
184+
)
175185
solara.Column(
176186
style={
177187
"flex-grow": "1",
@@ -323,17 +333,11 @@ def Page():
323333
width: 100%;
324334
height: 15%;
325335
}
326-
.chat-box > :last-child{
327-
padding-top: 7.5vh;
328-
}
329336
.map-container{
330337
width: 50vw;
331338
height: 100%;
332339
justify-content: center;
333340
}
334-
.user-message{
335-
font-weight: bold;
336-
}
337341
@media screen and (max-aspect-ratio: 1/1) {
338342
.ui-container{
339343
padding: 30px;

0 commit comments

Comments
 (0)