Refactor css for 'pre' with modifiers

This commit is contained in:
Alexey Golub 2018-06-26 01:14:54 +03:00
parent f0cd2dce1b
commit 7ecf90d1cb
4 changed files with 19 additions and 20 deletions

View file

@ -9,14 +9,13 @@ a {
color: #0096cf; color: #0096cf;
} }
.pre-multiline { .pre {
background-color: #2F3136; background-color: #2f3136;
border-color: #282b30;
color: #839496;
} }
.pre-inline { .pre--multiline {
background-color: #2f3136; border-color: #282b30;
color: #839496;
} }
.mention { .mention {

View file

@ -9,13 +9,12 @@ a {
color: #00b0f4; color: #00b0f4;
} }
.pre-multiline { .pre {
background-color: #f9f9f9; background-color: #f9f9f9;
color: #657b83;
} }
.pre-inline { .pre--multiline {
background-color: #f9f9f9; color: #657b83;
} }
/* === INFO === */ /* === INFO === */

View file

@ -17,20 +17,21 @@ img {
object-fit: contain; object-fit: contain;
} }
.pre-multiline { .pre {
margin-top: 4px;
padding: 8px;
border: 2px solid;
border-radius: 5px;
font-family: "Consolas", "Courier New", Courier, Monospace; font-family: "Consolas", "Courier New", Courier, Monospace;
white-space: pre-wrap; white-space: pre-wrap;
} }
.pre-inline { .pre--multiline {
margin-top: 4px;
padding: 8px;
border: 2px solid;
border-radius: 5px;
}
.pre--inline {
padding: 2px; padding: 2px;
border-radius: 3px; border-radius: 3px;
font-family: "Consolas", "Courier New", Courier, Monospace;
white-space: pre-wrap;
} }
.emoji { .emoji {

View file

@ -146,11 +146,11 @@ namespace DiscordChatExporter.Core.Services
// Decode and process multiline codeblocks // Decode and process multiline codeblocks
content = Regex.Replace(content, "\x1AM(.*?)\x1AM", content = Regex.Replace(content, "\x1AM(.*?)\x1AM",
m => $"<div class=\"pre-multiline\">{m.Groups[1].Value.Base64Decode()}</div>"); m => $"<div class=\"pre pre--multiline\">{m.Groups[1].Value.Base64Decode()}</div>");
// Decode and process inline codeblocks // Decode and process inline codeblocks
content = Regex.Replace(content, "\x1AI(.*?)\x1AI", content = Regex.Replace(content, "\x1AI(.*?)\x1AI",
m => $"<span class=\"pre-inline\">{m.Groups[1].Value.Base64Decode()}</span>"); m => $"<span class=\"pre pre--inline\">{m.Groups[1].Value.Base64Decode()}</span>");
// Decode and process links // Decode and process links
if (allowLinks) if (allowLinks)