Text Formatting - Code Block #2135
-
Hi team, I need to design a modified version of this page in the console just wondering if there is a way to stylise some part of a paragraph like a code or code block? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
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 helps! Let us know if you have any other questions on this. |
Beta Was this translation helpful? Give feedback.
-
Code block and inline Code are now available in Paste. |
Beta Was this translation helpful? Give feedback.
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 …