Created
February 4, 2020 20:34
-
-
Save nstrayer/d9f3943ed08fe8b5166b66873a2f3941 to your computer and use it in GitHub Desktop.
CSS to make HTML build from basic markdown look like generating markdown but with the style preserved
This file contains 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
@import url('https://fonts.googleapis.com/css?family=Inconsolata&display=swap'); | |
body { | |
--text-color: #2b2a2a; | |
--link-color: #005fb1; | |
font-family: 'Inconsolata', monospace; | |
font-size: 15px; | |
color: var(--text-color); | |
} | |
h1, | |
h2, | |
h3, | |
h4 { | |
position: relative; | |
} | |
h1::before, | |
h2::before, | |
h3::before, | |
h4::before { | |
position: absolute; | |
right: calc(100% + 5px); | |
} | |
h1::before { | |
content: "# "; | |
} | |
h2::before { | |
content: "## "; | |
} | |
h3::before { | |
content: "### "; | |
} | |
h4::before { | |
content: "#### "; | |
} | |
em::before { | |
content: "_"; | |
} | |
em::after { | |
content: "_"; | |
} | |
a { | |
color: var(--link-color); | |
} | |
a::before { | |
content: "["; | |
} | |
a::after { | |
content: "](" attr(href) ")"; | |
word-break: break-all; | |
color: var(--text-color); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment