Code block
On this page
Usage
Use a code block to highlight code text only, no other styles should be included.
When to use a code block
If a block of code text needs to be highlighted separate from paragraphs or other elements, use a code block.
Sizes
A code block container can adhere to the width of content within or be fixed width.

Content
The length of code text and the number of lines can change the width and height of a code block.

Responsive design
Large breakpoints

Small breakpoints
Container spacing and code text size reduces as breakpoints get smaller.

Best practices
Font family
Use --rh-font-family-code
.
Do not use a different font family token than --rh-font-family-code
.
Customizing
Use the available options for customizing code block. (Adjusting syntax highlighting is ok.)
Do not change the code block styling, especially if it will look like other text containers on the same page.
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.