Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CSS to make HTML build from basic markdown look like generating markdown but with the style preserved
@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