Code block
On this page
On this page
Guidelines
Use a code block to visually separate code text from other content on the page.
Sizes
A code block can adhere to the width of code text or be a fixed width.
Writing content
The length of code and number of lines will change the width and height of a code block.
Responsive design
A code block does not change much as screens get smaller.
Best practices
Font family
Always use the --rh-font-family-code
token.
Do not use a different font family.
Customizing
Customize code text using syntax highlighting only.
Do not change other code block styles.
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.