* Denotes a contextual color token that will change values based on the layer it is placed on.

* Denotes a contextual color token that will change values based on the layer it is placed on.

States for copy button: active, enabled, hover, focus, disabled

States for show toggle: enabled, hover, focus
* Denotes a contextual color token that will change values based on the layer it is placed on.

States for inline codesnippet: enabled, hover, active, focus
Syntax colors
Carbon has defined a set of accessible syntax colors. View an in-context example on CodePen.
Element | Property | px / rem | Spacing token |
|---|---|---|---|
Container | height | 40 / 3 | – |
max-width | 768 / 48 | – | |
padding-right | 48 / 3 |
| |
padding-left | 16 / 1 |
|

Structure and spacing measurements for code snippet | px / rem
Element | Property | px / rem | Spacing token |
|---|---|---|---|
Container | min-height | 288 / 18 | – |
max-height | Varies based on content | – | |
max-width | 768 / 48 | – | |
padding | 16 / 1 |
| |
padding-right | 40 / 2.5 |
| |
Icon | height, width | 16px | – |
Snippet button | height, width | 40 / 2.5 | – |
Copy button | height, width | 32 / 2 | – |

Structure and spacing measurements for multi-line snippet | px / rem
Element | Property | px / rem | Spacing token |
|---|---|---|---|
Container | height | 16 / 1 | – |
width | Varies based on content | – | |
border-radius | 2 | - | |
Code | padding-right, padding-left | 8 / 0.5 |
|

Structure and spacing measurements for inline code snippet | px / rem
Feedback
Help us improve by providing feedback, asking questions, requesting features, or leaving any other comments on GitHub.