Skip to content

Built-in Default Document Styles ​

These excerpts are document defaults used in previews and HTML-based rendering for export. They mainly target content inside .markdown-body. They are not application-wide interface styles or a complete description of the editing view. For interface variables, see Built-in Theme Styles.

Themes, document formatting settings and the export format also affect the result. For example, preview and export headings have a size hierarchy that may differ from the editing view. Outputs such as Word and plain text do not use this stylesheet unchanged.

How to Use These Rules ​

To customize export styles, create a scheme under Settings → Advanced → Custom CSS, including only the rules you want to override. Then select the scheme in the relevant format’s options in the Export window. HTML, PDF, Image and EPUB support custom CSS; use the available formatting options for other formats. See Custom CSS.

The excerpts below focus on common formatting rules and omit font files and compatibility resets. Defaults may change with app updates; check the actual preview and exported result.

Common Rules ​

css
.markdown-body h1 {
  padding-bottom: 0.3em;
  font-size: 2em;
}

.markdown-body h2 {
  padding-bottom: 0.3em;
  font-size: 1.6em;
}

.markdown-body h3 {
  font-size: 1.35em;
}

.markdown-body h4 {
  font-size: 1.15em;
}

.markdown-body h5 {
  font-size: 1em;
}

.markdown-body h6 {
  font-size: 1em;
  color: #777;
}

.markdown-body p {
  margin: 0;
}

.markdown-body blockquote {
  padding: 16px;
  border-left: 0.25em solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.03);
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 2.5em;
}

.markdown-body table {
  display: block;
  width: 100%;
  overflow: auto;
  word-break: keep-all;
}

.markdown-body table.wp-table-sized {
  display: table;
  overflow: visible;
}

.markdown-body table th,
.markdown-body table td {
  padding: 6px 13px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.markdown-body img {
  max-width: 100%;
  box-sizing: content-box;
  background-color: #fff;
}

.markdown-body pre > code {
  padding: 0;
  margin: 0;
  font-size: 100%;
  word-break: normal;
  white-space: pre-wrap;
  background: transparent;
  border: 0;
}

Additional Notes ​

  • Lists: nested unordered lists cycle through discs, circles and squares; ordered lists cycle through numbers, lowercase letters and lowercase Roman numerals. Individual list settings can override the defaults. Set list-style-type on ul or ol, rather than applying it to every li.
  • Tables: tables with explicit column widths or full-width settings use .wp-table-sized so that the ordinary table scrolling rules do not override their widths.
  • Images: ordinary images fit within the content width. A separate img[data-full-width="1"] rule sets full-width images to width: 100% and height: auto.
  • Paragraphs and margins: export options may generate additional font, line-height, paragraph-spacing and margin rules. This excerpt alone does not determine the final dimensions.