Add cai-chat-square chat style

This commit is contained in:
oobabooga 2023-09-14 16:15:08 -07:00
parent 3d1c0f173d
commit a3ecf3bb65
3 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,19 @@
@import url("file/css/chat_style-cai-chat.css");
.circle-bot, .circle-you {
height: 75px;
border-radius: 8.333px;
background-color: #656565;
}
.circle-bot img, .circle-you img {
border-radius: 8.333px;
}
.circle-you {
background-color: #656565;
}
.message {
padding-bottom: 30px;
}

View file

@ -51,6 +51,7 @@
.dark .message-body p em {
color: rgb(138, 138, 138) !important;
font-weight: 500;
}
.message-body p em {

View file

@ -25,6 +25,16 @@ chat_styles = {}
for k in get_available_chat_styles():
chat_styles[k] = open(Path(f'css/chat_style-{k}.css'), 'r').read()
# Handle styles that derive from other styles
for k in chat_styles:
lines = chat_styles[k].split('\n')
input_string = lines[0]
match = re.search(r'chat_style-([a-z\-]*)\.css', input_string)
if match:
style = match.group(1)
chat_styles[k] = chat_styles.get(style, '') + '\n\n' + '\n'.join(lines[1:])
def fix_newlines(string):
string = string.replace('\n', '\n\n')