Usage
Use the <code> element for inline code snippets.
<p class="mb-0">The <code>push()</code> method adds one or more elements to the end of
an array and returns the new length of the array.</p>Use the <pre> element for multiple lines of code.
<pre class="my-0">
L TE
A A
C V
R A
DOU
LOU
REUSE
QUE TU
PORTES
ET QUI T'
ORNE O CI
VILISÉ
OTE- TU VEUX
LA BIEN
SI RESPI
RER - Apollinaire
</pre>Use <kbd> for input that is typically entered via keyboard.
To edit settings, press <kbd>ctrl</kbd> + <kbd>s</kbd>Customization
Code elements use the monospace font set by the --font-code CSS variable (the $font-family-code Sass variable). Inline <code> elements only change the font; <pre> blocks also have padding, a background color and rounded corners.
The following Sass variables are available in the theming framework. Those for <code> and <pre> are also available as CSS variables, such as --padding-code.
| Variable | Description |
|---|---|
$font-size-code | The font size of <code> and <pre> elements. |
$padding-code | The padding applied to <pre> elements. |
$margin-code | The margin applied to <pre> elements. |
$color-code | The text color of <pre> elements. |
$bg-color-code | The background color of <pre> elements. |
$border-radius-code | The border radius applied to <pre> elements. |
$padding-kbd | The padding applied to the <kbd> element. |
$color-kbd | The color of the <kbd> element. |
$bg-color-kbd | The background color of the <kbd> element. |
$font-size-kbd | The font size of the <kbd> element. |
$border-color-kbd | The border color of the <kbd> element. |
$border-width-kbd | The border width of the <kbd> element. |
$border-radius-kbd | The border radius of the <kbd> element. |
$shadow-kbd | The box shadow applied to the <kbd> element. |
To add syntax highlighting to code blocks in articles, see Adding syntax highlighting.