Skip to content

Text Formatting - Code Block #2135

Answered by kate-porter
kasey-seo asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @kasey-seo - there is no Paste component or pattern around this yet, but you can still achieve this look using Box and Text. In fact, we do it quite frequently on the Paste docs site (here's an example).

I noticed your original post in Slack also asked about how to do this in Figma. Unfortunately, the answer is that it'll have to be a little hacky—there's not a great way to style text inline when it's got a custom background color, border radius, etc. What'll you basically need to do is style the code snippets separately from the paragraph text, and then drop the code snippets on top of the paragraph text to create the effect. Here's a quick vid that explains what I mean.

I hope that …

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
8 replies
@kate-porter
Comment options

@bhamtil-twilio
Comment options

@bhamtil-twilio
Comment options

@SiTaggart
Comment options

@arigsigal
Comment options

Answer selected by kate-porter
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants