Question:
Using Wix Studio, how can I format text as code?
I found this article about Wix Editor but I do not see the same function in Wix Studio
Product:
Wix Studio
What are you trying to achieve:
I’m writing a web page with a mixture of normal paragraph text and some code snippets. I want my code snippets to be correctly formatted.
You can use the Rich Content field in the CMS - it won’t have color highlighting, but will format a code snippet. If you need somehting more advanced looking, you may need to build a custom element.
This seems to work nicely, a little over complicated but it does work.
The only issue I have with it is scaling, My normal text on my page is set to
“Scale Proportionally”
I don’t see a way to get my code blocks to have this option.
Every time I test a mobile / tablet version my normal text shrinks, but the code block has keeps it’s larger font.
Upon investigation it seems that Rich content does not rely on site styles. I am not personally sure if this is by design or a bug. If you would like to report the issue as a bug for investigation, you may do so here Wix Studio - How to report a bug
Now - if you want to attempt a workaround in the meantime - you may be able to accomplish managing this font through media queries and css.
Alternatively, there may be solutions on the app market that will be easier to implement. I briefly searched and saw this one (untested by me) Snippets | Wix App Market | Wix.com