There might be some minimalist way to get Monaco into read-only mode for it...
I spent some time exploring how to improve the UX of code blocks on the web
21–30 of 68 posts
Re: I spent some time exploring how to improve the UX of code blocks on the web
#22Re: I spent some time exploring how to improve the UX of code blocks on the web
#23Ignoring that: this is pretty nice looking, both the explanation (clear and with good examples) and the component itself. Good work!
Re: I spent some time exploring how to improve the UX of code blocks on the web
#24 -.sx5jq50 .highlight-line[data-highlighted="false"], .sx5jq50 .highlight-line[data-highlighted="false"] * {
- color: var(---fadedLines);
-}
+.sx5jq50 .highlight-line[data-highlighted="false"] {
+ opacity: 0.5;
+ filter: grayscale(0.6);
+}
But I have always found adding a yellow background to the line to be by far the most effective (that is, the most likely to be read and understood correctly without explanation), most likely combined with opacity reduction and/or desaturation. And yes, specifically yellow will normally yield the best results. (There may be cultural factors to weigh against this recommendation, but there’s also some actual colour science supporting it. I’d definitely avoid red and green for normal highlighting in western culture, though it’s great for removed and added lines in diffs—but do remember the colourblind and not make colour the only indication.)Re: I spent some time exploring how to improve the UX of code blocks on the web
#25It's looks great. I think for me biggest problem with code snippets is that I encounter them with mobile device. Lines are quite long, like who uses 80 character line limits these days, more like 160. This combined with reality that most websites don't allow mobile device to zoom out. I wish I could read full lines of code instead of trying to scroll back and forth.
Re: I spent some time exploring how to improve the UX of code blocks on the web
#26It's looks great. I think for me biggest problem with code snippets is that I encounter them with mobile device. Lines are quite long, like who uses 80 character line limits these days, more like 160. This combined with reality that most websites don't allow mobile device to zoom out. I wish I could read full lines of code instead of trying to scroll back and forth.
Text files (source) are documents, and documents are much taller than they are wide: portrait orientation, like letter or A4. My two side monitors and oriented in portrait mode for this reason, and their quadrants (also portrait) are where I put editors.
I made this comment not to show my age, but to overcome the loudness bias of trends. There are plenty of us out here who still do it the old way, because the new way isn't better.
Re: I spent some time exploring how to improve the UX of code blocks on the web
#27It's looks great. I think for me biggest problem with code snippets is that I encounter them with mobile device. Lines are quite long, like who uses 80 character line limits these days, more like 160. This combined with reality that most websites don't allow mobile device to zoom out. I wish I could read full lines of code instead of trying to scroll back and forth.
Re: I spent some time exploring how to improve the UX of code blocks on the web
#28Except for collapsed code blocks. I would suggest collapsing them using JavaScript, so they are fully readable without. They are currently unavailable to someone who does not run JavaScript.
Re: I spent some time exploring how to improve the UX of code blocks on the web
#29It's looks great. I think for me biggest problem with code snippets is that I encounter them with mobile device. Lines are quite long, like who uses 80 character line limits these days, more like 160. This combined with reality that most websites don't allow mobile device to zoom out. I wish I could read full lines of code instead of trying to scroll back and forth.
Re: I spent some time exploring how to improve the UX of code blocks on the web
#30It's looks great. I think for me biggest problem with code snippets is that I encounter them with mobile device. Lines are quite long, like who uses 80 character line limits these days, more like 160. This combined with reality that most websites don't allow mobile device to zoom out. I wish I could read full lines of code instead of trying to scroll back and forth.