Last active
February 9, 2021 16:31
-
-
Save ryexley/4e7ad06d9ce5f9014423 to your computer and use it in GitHub Desktop.
Ghost blog code injection - This contains both "Blog Header" and "Blog Footer" code injection blocks that supports customization of the default Ghost theme, Casper. The custom styling for the header fixes a wrapping/horizontal scrolling issue for code samples in the default theme, and the JavaScript for the footer enables/renders Disqus comments…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style type="text/css"> | |
pre { | |
border-radius: 4px; | |
font-size: 0.8em; | |
line-height: 1.3em; | |
padding: 1em; | |
} | |
pre, code, pre > code { | |
font-family: Consolas, Monaco, "Andale Mono", monospace; | |
overflow-x: touch; | |
text-shadow: 0 1px #fff; | |
white-space: pre; | |
-webkit-overflow-scrolling: ouch; | |
} | |
:not(pre) > code { | |
border-radius: 4px; | |
font-size: 0.8em; | |
line-height: 1.5em; | |
padding: 2px 7px 0px 7px; | |
text-shadow: 0 1px #fff; | |
vertical-align: text-top; | |
white-space: pre-wrap; | |
} | |
/* | |
====================================================== | |
Override/fix code block word-wrap/scrolling wonkiness | |
====================================================== | |
*/ | |
code[class*="language-"], code, pre[class*="language-"], pre, :not(pre) > code { | |
white-space: pre; | |
} | |
code[class*="language-"], code { | |
display: inline-block; | |
} | |
/* | |
========= | |
Comments | |
========= | |
*/ | |
.comments-container::before { | |
border-bottom: 1px solid #e3edf3; | |
content: "Discussion"; | |
display: block; | |
font-size: 1.5em; | |
/*margin: 2em 0;*/ | |
text-align: center; | |
} | |
.comments-container { | |
background: #f7fafb; | |
border: 1px solid #e3edf3; | |
border-radius: 4px; | |
margin-top: 2em; | |
padding: 1em; | |
} | |
/* | |
========================== | |
Gist embed customizations | |
========================== | |
*/ | |
.gist { | |
article.markdown-body { | |
background: #f7fafb; | |
font-family: "Open Sans"; | |
font-size: 1em; | |
line-height: 1.5em; | |
padding: 0.75em 1em; | |
h1, h2, h3, h4, h5, h6 { | |
font-family: "Open Sans"; | |
font-weight: bold; | |
} | |
table { | |
border: 1px solid #efefef; | |
margin-bottom: 20px; | |
thead { | |
tr { | |
background: #fefefe; | |
} | |
} | |
} | |
hr { | |
margin: 40px 0 30px 0; | |
} | |
:not(pre) { | |
code { | |
background: #f7f7f7; | |
padding: 5px 7px; | |
} | |
} | |
pre { | |
background: #f7f7f7; | |
line-height: 1.1em; | |
overflow: auto; | |
padding: 10px; | |
code { | |
overflow: auto; | |
} | |
span { | |
white-space: nowrap; | |
} | |
code, span { | |
font-family: Consolas, Monaco, 'Andale Mono', monospace; | |
font-size: 0.7em; | |
} | |
} | |
} | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment