Facile Theme Custom CSS
style-1 is nice
/* Dark-themed code block */
.dark-color .post-content pre {
background: #1f1f1f !important;
border: 1px solid #333 !important;
border-radius: 8px !important;
overflow-x: auto !important;
overflow-y: hidden !important;
padding: 12px 16px !important;
line-height: 1.6 !important;
}
.dark-color .post-content pre code {
color: #e6edf3 !important;
font-size: 13px !important;
line-height: 1.6 !important;
white-space: pre !important;
word-break: normal !important;
font-family: Consolas, Monaco, "Courier New", monospace !important;
}Style-2 looks pretty good too!
/* ==========================================================
Will's Blog - Facile Theme Custom CSS
Optimized for Dark Theme & Technical Blog
========================================================== */
/* ==========================================================
1. Code block optimization (GitHub style)
========================================================== */
.dark-color .post-content pre {
background: #1f1f1f !important;
border: 1px solid #333 !important;
border-radius: 10px !important;
padding: 14px 18px !important;
overflow-x: auto !important;
overflow-y: hidden !important;
line-height: 1.6 !important;
margin: 1rem 0 !important;
}
.dark-color .post-content pre code {
color: #e6edf3 !important;
font-size: 14px !important;
line-height: 1.6 !important;
white-space: pre !important;
word-break: normal !important;
font-family:
Consolas,
Monaco,
"Courier New",
monospace !important;
}
/* Inline code */
.dark-color .post-content code:not(pre code) {
color: #79c0ff !important;
background: #161b22 !important;
border-radius: 4px !important;
padding: 2px 6px !important;
}
/* ==========================================================
2. Styling for blockquotes(blockquote)
========================================================== */
.dark-color .post-content blockquote {
border-left: 4px solid #58a6ff !important;
background: #161b22 !important;
padding: 12px 16px !important;
border-radius: 6px !important;
color: #c9d1d9 !important;
margin: 1rem 0 !important;
}
.dark-color .post-content blockquote p {
margin-bottom: 0 !important;
}
/* ==========================================================
3. Table dark theme support
========================================================== */
.dark-color .post-content table {
width: 100%;
background: #161b22 !important;
color: #c9d1d9 !important;
border-collapse: collapse !important;
margin: 1rem 0 !important;
}
.dark-color .post-content th {
background: #21262d !important;
color: #f0f6fc !important;
font-weight: 600;
}
.dark-color .post-content th,
.dark-color .post-content td {
border: 1px solid #30363d !important;
padding: 10px 14px !important;
text-align: left;
}
.dark-color .post-content tr:nth-child(even) {
background: #1c2128 !important;
}
/* ==========================================================
4. Image Enhancement
========================================================== */
.post-content img {
border-radius: 10px !important;
border: 1px solid #333 !important;
max-width: 100% !important;
height: auto !important;
margin: 1rem auto !important;
display: block !important;
}
/* ==========================================================
5. Widen the main content area
========================================================== */
@media (min-width: 1200px) {
.post-page {
max-width: 900px !important;
}
}
/* ==========================================================
Additional optimizations
========================================================== */
/* Title space */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
margin-top: 2rem;
margin-bottom: 1rem;
}
/* Separator line */
.dark-color .post-content hr {
border-color: #30363d !important;
}
/* Link color */
.dark-color .post-content a {
color: #58a6ff;
}
.dark-color .post-content a:hover {
color: #79c0ff;
}
/* Code block scrollbar */
.dark-color .post-content pre::-webkit-scrollbar {
height: 8px;
}
.dark-color .post-content pre::-webkit-scrollbar-thumb {
background: #444;
border-radius: 4px;
}
.dark-color .post-content pre::-webkit-scrollbar-track {
background: #1f1f1f;
} Copyright Notice: This article is an original work. Copyright belongs to Will's Blog. Please contact the author for permission before reprinting.
Article URL: https://blog.1amwill.com/index.php/archives/16/
If you have any questions or concerns about this article, feel free to leave a comment. I will try my best to respond as soon as possible.