Chat CSS: fix ul, li, pre styles + remove redefinitions

This commit is contained in:
oobabooga 2023-06-18 01:56:43 -03:00
parent 0686a2e75f
commit 44f28830d1
7 changed files with 44 additions and 168 deletions

View File

@ -45,3 +45,46 @@ div.svelte-362y77>*, div.svelte-362y77>.form>* {
#main button { #main button {
min-width: 0 !important; min-width: 0 !important;
} }
/*****************************************************/
/*************** Chat box declarations ***************/
/*****************************************************/
.chat {
margin-left: auto;
margin-right: auto;
max-width: 800px;
height: calc(100vh - 296px);
overflow-y: auto;
padding-right: 20px;
display: flex;
flex-direction: column-reverse;
word-break: break-word;
overflow-wrap: anywhere;
padding-top: 1px;
}
.message-body li {
margin-top: 0.5em !important;
margin-bottom: 0.5em !important;
}
.message-body li > p {
display: inline !important;
}
.message-body ul, .message-body ol {
font-size: 15px !important;
}
.message-body pre {
margin-bottom: 1.25em !important;
}
.message-body code {
overflow-x: auto;
}
.message-body :not(pre) > code {
white-space: normal !important;
}

View File

@ -1,19 +1,5 @@
/* All credits to TheEncrypted777: https://www.reddit.com/r/Oobabooga/comments/12xe6vq/updated_css_styling_with_color_customization_for/ */ /* All credits to TheEncrypted777: https://www.reddit.com/r/Oobabooga/comments/12xe6vq/updated_css_styling_with_color_customization_for/ */
.chat {
margin-left: auto;
margin-right: auto;
max-width: 800px;
height: calc(100vh - 296px);
overflow-y: auto;
padding-right: 20px;
display: flex;
flex-direction: column-reverse;
word-break: break-word;
overflow-wrap: anywhere;
padding-top: 1px;
}
.message { .message {
display: grid; display: grid;
grid-template-columns: 60px minmax(0, 1fr); grid-template-columns: 60px minmax(0, 1fr);
@ -112,23 +98,6 @@
line-height: 1.428571429 !important; line-height: 1.428571429 !important;
} }
.message-body li {
margin-top: 0.5em !important;
margin-bottom: 0.5em !important;
}
.message-body li > p {
display: inline !important;
}
.message-body code {
overflow-x: auto;
}
.message-body :not(pre) > code {
white-space: normal !important;
}
.dark .message-body p em { .dark .message-body p em {
color: rgb(138, 138, 138) !important; color: rgb(138, 138, 138) !important;
} }

View File

@ -1,17 +1,3 @@
.chat {
margin-left: auto;
margin-right: auto;
max-width: 800px;
height: calc(100vh - 296px);
overflow-y: auto;
padding-right: 20px;
display: flex;
flex-direction: column-reverse;
word-break: break-word;
overflow-wrap: anywhere;
padding-top: 1px;
}
.message { .message {
display: grid; display: grid;
grid-template-columns: 60px minmax(0, 1fr); grid-template-columns: 60px minmax(0, 1fr);
@ -43,9 +29,6 @@
object-fit: cover; object-fit: cover;
} }
.text {
}
.text p { .text p {
margin-top: 5px; margin-top: 5px;
} }
@ -54,9 +37,6 @@
font-weight: bold; font-weight: bold;
} }
.message-body {
}
.message-body img { .message-body img {
max-width: 300px; max-width: 300px;
max-height: 300px; max-height: 300px;
@ -69,23 +49,6 @@
line-height: 1.428571429 !important; line-height: 1.428571429 !important;
} }
.message-body li {
margin-top: 0.5em !important;
margin-bottom: 0.5em !important;
}
.message-body li > p {
display: inline !important;
}
.message-body code {
overflow-x: auto;
}
.message-body :not(pre) > code {
white-space: normal !important;
}
.dark .message-body p em { .dark .message-body p em {
color: rgb(138, 138, 138) !important; color: rgb(138, 138, 138) !important;
} }

View File

@ -1,17 +1,3 @@
.chat {
margin-left: auto;
margin-right: auto;
max-width: 800px;
height: calc(100vh - 296px);
overflow-y: auto;
padding-right: 20px;
display: flex;
flex-direction: column-reverse;
word-break: break-word;
overflow-wrap: anywhere;
padding-top: 1px;
}
.message { .message {
padding-bottom: 25px; padding-bottom: 25px;
font-size: 15px; font-size: 15px;
@ -104,23 +90,6 @@
line-height: 1.428571429 !important; line-height: 1.428571429 !important;
} }
.message-body li {
margin-top: 0.5em !important;
margin-bottom: 0.5em !important;
}
.message-body li > p {
display: inline !important;
}
.message-body code {
overflow-x: auto;
}
.message-body :not(pre) > code {
white-space: normal !important;
}
.dark .message-body p em { .dark .message-body p em {
color: rgb(138, 138, 138) !important; color: rgb(138, 138, 138) !important;
} }

View File

@ -1,17 +1,3 @@
.chat {
margin-left: auto;
margin-right: auto;
max-width: 800px;
height: calc(100vh - 296px);
overflow-y: auto;
padding-right: 20px;
display: flex;
flex-direction: column-reverse;
word-break: break-word;
overflow-wrap: anywhere;
padding-top: 1px;
}
.message { .message {
padding-bottom: 25px; padding-bottom: 25px;
font-size: 15px; font-size: 15px;
@ -48,9 +34,6 @@
margin-top: 5px; margin-top: 5px;
} }
.message-body {
}
.message-body img { .message-body img {
max-width: 300px; max-width: 300px;
max-height: 300px; max-height: 300px;
@ -63,23 +46,6 @@
line-height: 1.428571429 !important; line-height: 1.428571429 !important;
} }
.message-body li {
margin-top: 0.5em !important;
margin-bottom: 0.5em !important;
}
.message-body li > p {
display: inline !important;
}
.message-body code {
overflow-x: auto;
}
.message-body :not(pre) > code {
white-space: normal !important;
}
.dark .message-body p em { .dark .message-body p em {
color: rgb(138, 138, 138) !important; color: rgb(138, 138, 138) !important;
} }

View File

@ -1,17 +1,3 @@
.chat {
margin-left: auto;
margin-right: auto;
max-width: 800px;
height: calc(100vh - 296px);
overflow-y: auto;
padding-right: 20px;
display: flex;
flex-direction: column-reverse;
word-break: break-word;
overflow-wrap: anywhere;
padding-top: 1px;
}
.message { .message {
display: grid; display: grid;
grid-template-columns: 60px 1fr; grid-template-columns: 60px 1fr;
@ -25,32 +11,12 @@
display: none; display: none;
} }
.message-body {
}
.message-body p { .message-body p {
font-size: 15px !important; font-size: 15px !important;
line-height: 1.75 !important; line-height: 1.75 !important;
margin-bottom: 1.25em !important; margin-bottom: 1.25em !important;
} }
.message-body li {
margin-top: 0.5em !important;
margin-bottom: 0.5em !important;
}
.message-body li > p {
display: inline !important;
}
.message-body code {
overflow-x: auto;
}
.message-body :not(pre) > code {
white-space: normal !important;
}
.dark .message-body p em { .dark .message-body p em {
color: rgb(198, 202, 214) !important; color: rgb(198, 202, 214) !important;
} }

View File

@ -708,6 +708,7 @@ def create_interface():
with gr.Row(): with gr.Row():
shared.gradio['interface_modes_menu'] = gr.Dropdown(choices=modes, value=current_mode, label="Mode") shared.gradio['interface_modes_menu'] = gr.Dropdown(choices=modes, value=current_mode, label="Mode")
shared.gradio['reset_interface'] = gr.Button("Apply and restart the interface", elem_classes="small-button")
shared.gradio['toggle_dark_mode'] = gr.Button('Toggle dark/light mode', elem_classes="small-button") shared.gradio['toggle_dark_mode'] = gr.Button('Toggle dark/light mode', elem_classes="small-button")
with gr.Row(): with gr.Row():
@ -717,7 +718,6 @@ def create_interface():
with gr.Column(): with gr.Column():
shared.gradio['bool_menu'] = gr.CheckboxGroup(choices=bool_list, value=bool_active, label="Boolean command-line flags", elem_classes='checkboxgroup-table') shared.gradio['bool_menu'] = gr.CheckboxGroup(choices=bool_list, value=bool_active, label="Boolean command-line flags", elem_classes='checkboxgroup-table')
shared.gradio['reset_interface'] = gr.Button("Apply and restart the interface")
with gr.Row(): with gr.Row():
extension_name = gr.Textbox(lines=1, label='Install or update an extension', info='Enter the GitHub URL below. For a list of extensions, see: https://github.com/oobabooga/text-generation-webui-extensions ⚠️ WARNING ⚠️ : extensions can execute arbitrary code. Make sure to inspect their source code before activating them.') extension_name = gr.Textbox(lines=1, label='Install or update an extension', info='Enter the GitHub URL below. For a list of extensions, see: https://github.com/oobabooga/text-generation-webui-extensions ⚠️ WARNING ⚠️ : extensions can execute arbitrary code. Make sure to inspect their source code before activating them.')
extension_install = gr.Button('Install or update', elem_classes="small-button") extension_install = gr.Button('Install or update', elem_classes="small-button")