-
Notifications
You must be signed in to change notification settings - Fork 1
Blog 3 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blog 3 #1
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,6 +46,143 @@ | |
| background-position: center; | ||
| background-attachment: fixed; | ||
| } | ||
|
|
||
| main :not(pre) > code { | ||
| background: #f4f4f5; | ||
| color: #111827; | ||
| font-size: 0.9em; | ||
| border-radius: 6px; | ||
| padding: 0.08rem 0.32rem; | ||
| } | ||
|
|
||
| main div.highlighter-rouge, | ||
| main pre.highlight, | ||
| main figure.highlight { | ||
| margin-top: 0.15rem; | ||
| margin-bottom: 1rem; | ||
| background: #f5f8fc; | ||
| border: 1px solid #d7e3f0; | ||
| border-left: 3px solid #7aa2d6; | ||
| border-radius: 10px; | ||
| padding: 0.75rem 0.9rem; | ||
| overflow-x: auto; | ||
| font-size: 0.76rem; | ||
| line-height: 1.55; | ||
| } | ||
|
|
||
| main div.highlighter-rouge .highlight, | ||
| main div.highlighter-rouge pre.highlight, | ||
| main figure.highlight pre { | ||
| margin: 0; | ||
| border: 0; | ||
| padding: 0; | ||
| background: transparent; | ||
| border-left: 0; | ||
| border-radius: 0; | ||
| font-size: inherit; | ||
| overflow: visible; | ||
| } | ||
|
|
||
| main div.highlighter-rouge code, | ||
| main pre.highlight code { | ||
| background: transparent; | ||
| padding: 0; | ||
| color: inherit; | ||
| font-size: inherit; | ||
| } | ||
|
Comment on lines
+50
to
+92
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The inline-code selector SuggestionTighten the selector to target only inline code while explicitly excluding Rouge blocks. For example: main :not(pre):not(.highlight):not(.highlighter-rouge) > code {
/* inline code styles */
}
/* Or, more explicit: */
main p > code,
main li > code,
main td > code {
/* inline code styles */
}This reduces unintended styling collisions with Rouge-generated markup. Reply with "@CharlieHelps yes please" if you’d like me to add a commit with this change. |
||
|
|
||
| main .highlight .c, | ||
| main .highlight .c1, | ||
| main .highlight .cm { | ||
| color: #64748b; | ||
| font-style: italic; | ||
| } | ||
|
|
||
| main .highlight .k, | ||
| main .highlight .kd, | ||
| main .highlight .kn, | ||
| main .highlight .kp, | ||
| main .highlight .kr, | ||
| main .highlight .kt { | ||
| color: #b45309; | ||
| } | ||
|
|
||
| main .highlight .s, | ||
| main .highlight .s1, | ||
| main .highlight .s2, | ||
| main .highlight .sb, | ||
| main .highlight .se, | ||
| main .highlight .sh { | ||
| color: #0369a1; | ||
| } | ||
|
|
||
| main .highlight .m, | ||
| main .highlight .mi, | ||
| main .highlight .mf { | ||
| color: #be123c; | ||
| } | ||
|
|
||
| main .highlight .na, | ||
| main .highlight .nb, | ||
| main .highlight .nc, | ||
| main .highlight .nf, | ||
| main .highlight .nx { | ||
| color: #1d4ed8; | ||
| } | ||
|
|
||
| @media (prefers-color-scheme: dark) { | ||
| main :not(pre) > code { | ||
| background: #0f141a; | ||
| color: #e5e7eb; | ||
| } | ||
|
|
||
| main div.highlighter-rouge, | ||
| main pre.highlight, | ||
| main figure.highlight { | ||
| background: #0f141a; | ||
| border-color: #27323d; | ||
| border-left-color: #64748b; | ||
| color: #e5e7eb; | ||
| } | ||
|
|
||
| main .highlight .c, | ||
| main .highlight .c1, | ||
| main .highlight .cm { | ||
| color: #7c8aa0; | ||
| } | ||
|
|
||
| main .highlight .k, | ||
| main .highlight .kd, | ||
| main .highlight .kn, | ||
| main .highlight .kp, | ||
| main .highlight .kr, | ||
| main .highlight .kt { | ||
| color: #fbbf24; | ||
| } | ||
|
|
||
| main .highlight .s, | ||
| main .highlight .s1, | ||
| main .highlight .s2, | ||
| main .highlight .sb, | ||
| main .highlight .se, | ||
| main .highlight .sh { | ||
| color: #34d399; | ||
| } | ||
|
|
||
| main .highlight .m, | ||
| main .highlight .mi, | ||
| main .highlight .mf { | ||
| color: #fb923c; | ||
| } | ||
|
|
||
| main .highlight .na, | ||
| main .highlight .nb, | ||
| main .highlight .nc, | ||
| main .highlight .nf, | ||
| main .highlight .nx { | ||
| color: #fda4af; | ||
| } | ||
| } | ||
|
Comment on lines
+49
to
+185
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All Rouge/highlighting styles are being injected into a shared SuggestionMove these code/highlight styles into a dedicated CSS file (e.g., If you want to keep it inline for now, at least wrap with a comment header and scope to a class on layouts that need it (e.g., |
||
| </style> | ||
| <script src="https://cdn.tailwindcss.com"></script> | ||
| <script> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching
kramdown.syntax_highlighterandhighlightertorougeis fine, but it changes generated HTML structure and class names for code blocks across the site. You already updatedindex.mdto use{% highlight %}, but any existing posts/pages that relied on prior<pre>styling may render differently.Given you also removed
.blog-content prestyles, you should verify at least one older post/page with fenced code blocks still looks acceptable (light + dark).Suggestion
Do a quick audit of existing markdown posts/pages that contain fenced code blocks (```), verify the generated HTML uses Rouge wrappers, and ensure the new CSS covers them. If gaps exist, add a small compatibility selector (e.g. for bare
pre > code) or update the markdown to use{% highlight %}consistently.Reply with "@CharlieHelps yes please" if you’d like me to add a commit that adds minimal compatibility CSS for non-Rouge code blocks.