Sharing an example I use in website, I do use following pre in my stylesheet:
pre {
background: #f4f4f4;
border: 1px solid #ddd;
border-left: 3px solid #f36d33;
color: #666;
page-break-inside: avoid;
font-family: monospace;
font-size: 15px;
line-height: 1.6;
margin-bottom: 1.6em;
max-width: 100%;
overflow: auto;
padding: 1em 1.5em;
display: block;
word-wrap: break-word;
}
This gives the following results:

Answer from Maytham Fahmi on Stack OverflowDisclaimer: In my leisure time, I have spend few hours to update this CSS with a bit extra features like code lines and code Copy button using CSS with JavaScript to my personal use that I like to share. Please use as you like github source code. To see a code example in real world, check this article from my blog that show how I use the code sample.
Videos
What does a CSS Formatter / Beautifier do?
Is my CSS code uploaded to your server?
Is this CSS beautifier tool free?
Sharing an example I use in website, I do use following pre in my stylesheet:
pre {
background: #f4f4f4;
border: 1px solid #ddd;
border-left: 3px solid #f36d33;
color: #666;
page-break-inside: avoid;
font-family: monospace;
font-size: 15px;
line-height: 1.6;
margin-bottom: 1.6em;
max-width: 100%;
overflow: auto;
padding: 1em 1.5em;
display: block;
word-wrap: break-word;
}
This gives the following results:

Disclaimer: In my leisure time, I have spend few hours to update this CSS with a bit extra features like code lines and code Copy button using CSS with JavaScript to my personal use that I like to share. Please use as you like github source code. To see a code example in real world, check this article from my blog that show how I use the code sample.
This javascript library seems excellent:
https://highlightjs.org/
UPDATE: I also used this on my Tumblr-based blog because it was easiest to deploy:
https://github.com/google/code-prettify
Quite sure you can do this with prettier code formatter plugin. And you can set format on save true for all languages by adding the following to your user settings json file(dont forget to reload vscode after updating) :
"editor.formatOnSave": true,
you can enable format on save for a specific language by adding the following too :
"[css]": {
"editor.formatOnSave": true
}
"[css][scss][less]": {
"editor.defaultFormatter": "vscode.css-language-features"
}
The JSON configuration you've provided appears to be related to Visual Studio Code (VSCode) settings for formatting CSS, SCSS, and LESS code. This configuration sets the default formatter for these languages to "vscode.css-language-features."
Here's what this configuration does:
"editor.defaultFormatter": This setting in VSCode allows you to specify the default code formatter for a particular language or file type.
"vscode.css-language-features": This value indicates that you want to use the built-in CSS language features of VSCode as the default formatter for CSS, SCSS, and LESS files.
In simpler terms, when you open or edit CSS, SCSS, or LESS files in VSCode, it will use its own internal formatter for those languages by default.
You can customize your VSCode settings by adding or modifying settings in your settings.json file to tailor your development environment to your preferences. This particular configuration is useful if you prefer to use the VSCode built-in formatter for CSS-related languages.