Skip to content

Code Text Color Recommendations #877

Answered by TheSisb
ang-twilio asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @ang-twilio!

We don't currently have any guidance around syntax highlighting code blocks. For the most part, folks can copy and paste the code into an editor if they need syntax highlighting.

In general our recommendations are:

  • Make sure the text color has a color contrast ratio of 4.5:1 to the background color of the code block
  • Use a monospace font; ideally the one that matches your current theme (https://paste.twilio.design/getting-started/design/#fira-mono)
  • Make sure the font is legible, not too small and a healthy line-height. (at your discretion)
  • Make sure the code is highlightable and copiable (the default behavior unless you go out of your way to disable it)
  • (Optional): Add an …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ang-twilio
Comment options

Answer selected by TheSisb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants