Refactor CSS class names from .post-content to .md-content

This commit is contained in:
Aditya Telange
2026-04-11 00:31:48 +05:30
parent f1b2dea280
commit 383696db85
4 changed files with 59 additions and 59 deletions
+53 -53
View File
@@ -1,161 +1,161 @@
.post-content { .md-content {
color: var(--content); color: var(--content);
margin: 30px 0; margin: 30px 0;
} }
.post-content h3, .md-content h3,
.post-content h4, .md-content h4,
.post-content h5, .md-content h5,
.post-content h6 { .md-content h6 {
margin: 24px 0 16px; margin: 24px 0 16px;
} }
.post-content h1 { .md-content h1 {
margin: 40px auto 32px; margin: 40px auto 32px;
font-size: 40px; font-size: 40px;
} }
.post-content h2 { .md-content h2 {
margin: 32px auto 24px; margin: 32px auto 24px;
font-size: 32px; font-size: 32px;
} }
.post-content h3 { .md-content h3 {
font-size: 24px; font-size: 24px;
} }
.post-content h4 { .md-content h4 {
font-size: 16px; font-size: 16px;
} }
.post-content h5 { .md-content h5 {
font-size: 14px; font-size: 14px;
} }
.post-content h6 { .md-content h6 {
font-size: 12px; font-size: 12px;
} }
.post-content a { .md-content a {
box-shadow: 0 1px 0; box-shadow: 0 1px 0;
box-decoration-break: clone; box-decoration-break: clone;
-webkit-box-decoration-break: clone; -webkit-box-decoration-break: clone;
} }
.post-content a code { .md-content a code {
margin: auto 0; margin: auto 0;
border-radius: 0; border-radius: 0;
box-shadow: 0 -1px 0 var(--primary) inset; box-shadow: 0 -1px 0 var(--primary) inset;
} }
.post-content del { .md-content del {
text-decoration: line-through; text-decoration: line-through;
} }
.post-content dl, .md-content dl,
.post-content ol, .md-content ol,
.post-content p, .md-content p,
.post-content figure, .md-content figure,
.post-content ul { .md-content ul {
margin-bottom: var(--content-gap); margin-bottom: var(--content-gap);
} }
.post-content ol, .md-content ol,
.post-content ul { .md-content ul {
padding-inline-start: 20px; padding-inline-start: 20px;
} }
.post-content li { .md-content li {
margin-top: 5px; margin-top: 5px;
} }
.post-content li p { .md-content li p {
margin-bottom: 0; margin-bottom: 0;
} }
.post-content dl { .md-content dl {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin: 0; margin: 0;
} }
.post-content dt { .md-content dt {
width: 25%; width: 25%;
font-weight: 700; font-weight: 700;
} }
.post-content dd { .md-content dd {
width: 75%; width: 75%;
margin-inline-start: 0; margin-inline-start: 0;
padding-inline-start: 10px; padding-inline-start: 10px;
} }
.post-content dd~dd, .md-content dd~dd,
.post-content dt~dt { .md-content dt~dt {
margin-top: 10px; margin-top: 10px;
} }
.post-content table { .md-content table {
margin-bottom: var(--content-gap); margin-bottom: var(--content-gap);
} }
.post-content table th, .md-content table th,
.post-content table:not(.highlighttable, .highlight table, .gist .highlight) td { .md-content table:not(.highlighttable, .highlight table, .gist .highlight) td {
min-width: 80px; min-width: 80px;
padding: 8px 5px; padding: 8px 5px;
line-height: 1.5; line-height: 1.5;
border-bottom: 1px solid var(--border); border-bottom: 1px solid var(--border);
} }
.post-content table th { .md-content table th {
text-align: start; text-align: start;
} }
.post-content table:not(.highlighttable) td code:only-child { .md-content table:not(.highlighttable) td code:only-child {
margin: auto 0; margin: auto 0;
} }
.post-content .highlight table { .md-content .highlight table {
border-radius: var(--radius); border-radius: var(--radius);
} }
.post-content .highlight:not(table) { .md-content .highlight:not(table) {
margin: 10px auto; margin: 10px auto;
background: var(--code-block-bg) !important; background: var(--code-block-bg) !important;
border-radius: var(--radius); border-radius: var(--radius);
direction: ltr; direction: ltr;
} }
.post-content li>.highlight { .md-content li>.highlight {
margin-inline-end: 0; margin-inline-end: 0;
} }
.post-content ul pre { .md-content ul pre {
margin-inline-start: calc(var(--gap) * -2); margin-inline-start: calc(var(--gap) * -2);
} }
.post-content .highlight pre { .md-content .highlight pre {
margin: 0; margin: 0;
} }
.post-content .highlighttable { .md-content .highlighttable {
table-layout: fixed; table-layout: fixed;
} }
.post-content .highlighttable td:first-child { .md-content .highlighttable td:first-child {
width: 40px; width: 40px;
} }
.post-content .highlighttable td .linenodiv { .md-content .highlighttable td .linenodiv {
padding-inline-end: 0 !important; padding-inline-end: 0 !important;
} }
.post-content .highlighttable td .highlight, .md-content .highlighttable td .highlight,
.post-content .highlighttable td .linenodiv pre { .md-content .highlighttable td .linenodiv pre {
margin-bottom: 0; margin-bottom: 0;
} }
.post-content code { .md-content code {
margin: auto 4px; margin: auto 4px;
padding: 4px 6px; padding: 4px 6px;
font-size: 0.78em; font-size: 0.78em;
@@ -164,7 +164,7 @@
border-radius: 2px; border-radius: 2px;
} }
.post-content pre code { .md-content pre code {
display: grid; display: grid;
margin: auto 0; margin: auto 0;
padding: 10px; padding: 10px;
@@ -175,44 +175,44 @@
word-break: break-all; word-break: break-all;
} }
.post-content blockquote { .md-content blockquote {
margin: 20px 0; margin: 20px 0;
padding: 0 14px; padding: 0 14px;
border-inline-start: 3px solid var(--primary); border-inline-start: 3px solid var(--primary);
} }
.post-content hr { .md-content hr {
margin: 30px 0; margin: 30px 0;
height: 2px; height: 2px;
background: var(--tertiary); background: var(--tertiary);
border: 0; border: 0;
} }
.post-content iframe { .md-content iframe {
max-width: 100%; max-width: 100%;
} }
.post-content img { .md-content img {
border-radius: 4px; border-radius: 4px;
margin: 1rem 0; margin: 1rem 0;
} }
.post-content img[src*="#center"] { .md-content img[src*="#center"] {
margin: 1rem auto; margin: 1rem auto;
} }
.post-content figure.align-center { .md-content figure.align-center {
text-align: center; text-align: center;
} }
.post-content figure>figcaption { .md-content figure>figcaption {
color: var(--primary); color: var(--primary);
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
margin: 8px 0 16px; margin: 8px 0 16px;
} }
.post-content figure>figcaption>p { .md-content figure>figcaption>p {
color: var(--secondary); color: var(--secondary);
font-size: 14px; font-size: 14px;
font-weight: normal; font-weight: normal;
+4 -4
View File
@@ -22,16 +22,16 @@
} }
/* from post-single */ /* from post-single */
.post-content .highlighttable td .highlight pre code::-webkit-scrollbar { .md-content .highlighttable td .highlight pre code::-webkit-scrollbar {
display: none; display: none;
} }
.post-content :not(table) ::-webkit-scrollbar-thumb { .md-content :not(table) ::-webkit-scrollbar-thumb {
border: 2px solid var(--code-block-bg); border: 2px solid var(--code-block-bg);
background: rgb(113, 113, 117); background: rgb(113, 113, 117);
} }
.post-content :not(table) ::-webkit-scrollbar-thumb:hover { .md-content :not(table) ::-webkit-scrollbar-thumb:hover {
background: rgb(163, 163, 165); background: rgb(163, 163, 165);
} }
@@ -44,7 +44,7 @@
background: rgb(112, 112, 112); background: rgb(112, 112, 112);
} }
.post-content table::-webkit-scrollbar-thumb { .md-content table::-webkit-scrollbar-thumb {
border-width: 2px; border-width: 2px;
} }
+1 -1
View File
@@ -31,7 +31,7 @@
{{- end }} {{- end }}
{{- if .Content }} {{- if .Content }}
<div class="post-content"> <div class="md-content">
{{- if not (.Param "disableAnchoredHeadings") }} {{- if not (.Param "disableAnchoredHeadings") }}
{{- partial "anchored_headings.html" .Content -}} {{- partial "anchored_headings.html" .Content -}}
{{- else }}{{ .Content }}{{ end }} {{- else }}{{ .Content }}{{ end }}
+1 -1
View File
@@ -35,7 +35,7 @@
{{- end }} {{- end }}
{{- if .Content }} {{- if .Content }}
<div class="post-content"> <div class="post-content md-content">
{{- if not (.Param "disableAnchoredHeadings") }} {{- if not (.Param "disableAnchoredHeadings") }}
{{- partial "anchored_headings.html" .Content -}} {{- partial "anchored_headings.html" .Content -}}
{{- else }}{{ .Content }}{{ end }} {{- else }}{{ .Content }}{{ end }}