Skip to content

Commit

Permalink
refactor: put css in ChatBox component
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed Nov 10, 2023
1 parent 5e18627 commit d747e02
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions wanderlust.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def ChatMessage(message):
elif message.role == "user":
solara.Text(
message.content[0].text.value,
classes=["chat-message", "user-message"],
classes=["chat-message", "chat-user-message"],
)
elif message.role == "assistant":
if message.content[0].text.value:
Expand Down Expand Up @@ -172,6 +172,16 @@ def ChatBox(children=[]):
# this uses a flexbox with column-reverse to reverse the order of the messages
# if we now also reverse the order of the messages, we get the correct order
# but the scroll position is at the bottom of the container automatically
solara.Style(
"""
.chat-box > :last-child{
padding-top: 7.5vh;
}
.chat-user-message{
font-weight: bold;
}
"""
)
solara.Column(
style={
"flex-grow": "1",
Expand Down Expand Up @@ -323,17 +333,11 @@ def Page():
width: 100%;
height: 15%;
}
.chat-box > :last-child{
padding-top: 7.5vh;
}
.map-container{
width: 50vw;
height: 100%;
justify-content: center;
}
.user-message{
font-weight: bold;
}
@media screen and (max-aspect-ratio: 1/1) {
.ui-container{
padding: 30px;
Expand Down

0 comments on commit d747e02

Please sign in to comment.