Skip to main content

Extension: Code

The code extension contains default styles for displaying code and related elements in HTML. You'll find it in src/extensions/_code.scss.

Monospace

The code extension makes sure appropriate elements—such as
  • <code>
  • <pre>
  • <kbd>
  • <samp>
—are rendered in the configured monospace font.

This is handy whenever a font-stack has been explicitly applied to the <body> (which overrides the browser defaults). For example, Level 4 sets an explicit font stack, and its demo page has this code extension included.