Skip to content

About

Styling HTML as if it were raw Markdown text.

Topics

Resources

Stars

157 stars

Watchers

4 watching

Forks

Repository files navigation

Remarkdown

Remarkdown is CSS that makes HTML look like plain Markdown text.

Usage with a CDN

  1. Add a link to dist/remarkdown.css;
  2. Put class="remarkdown" on a container with all the text you want to style.
<!doctype html>
<html lang="en">
<head>
	<title>Using Remarkdown</title>
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/remarkdown.css@4/dist/remarkdown.css">
</head>
<body class="remarkdown">
	<h1>Hello World</h1>
	<p>A paragraph.</p>
</body>
</html>

This will render text in monospace and add some Markdown-like syntax around elements.

You can choose optional styles if you don’t love the defaults. For example, class="remarkdown h1-line ul-star" enables underlined <h1>s and asterisks for bullets.

The pre-built Remarkdown stylesheet comes in a few variants, which change: what default styles are enabled; how optional styles are declared in HTML:

Usage with npm

npm install remarkdown.css

When using a Bundler like Vite, you should be able to import pre-built stylesheets from the package’s dist directory in your own CSS:

@import "remarkdown.css/dist/remarkdown.css";
/* or "remarkdown.css/dist/remarkdown-zero.attr.css", etc. */

Beyond the pre-built stylesheets, Remarkdown is a Sass library, and can be imported with @use then configured with the config() mixin:

@use "pkg:remarkdown.css" as rmd;

// Configure a custom Remarkdown build
@include rmd.config($line-height: 1.75);

// Generate styles
@include rmd.header();
@include rmd.styles();

See the build directory for some examples that modify the Remarkdown selectors, and lib/_defaults.scss for all available configuration options.

About

Styling HTML as if it were raw Markdown text.

Topics

Resources

Stars

157 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages