{"id":4628,"date":"2026-01-21T07:41:21","date_gmt":"2026-01-21T07:41:21","guid":{"rendered":"https:\/\/thedigitalsagency.com\/services\/digital-downloadable\/introducing-the-enhanced-code-block-syntax-highlighting-and-more\/"},"modified":"2026-01-21T07:41:22","modified_gmt":"2026-01-21T07:41:22","slug":"introducing-the-enhanced-code-block-syntax-highlighting-and-extra","status":"publish","type":"post","link":"https:\/\/thedigitalsagency.com\/services\/digital-downloadable\/introducing-the-enhanced-code-block-syntax-highlighting-and-extra\/","title":{"rendered":"Introducing the Enhanced Code Block: Syntax Highlighting and Extra"},"content":{"rendered":"<p><\/p>\n<div id=\"wpblog-post-body\">\n<p>Closing yr, WordPress.com presented new code editors for the block editor and the Further CSS enter field within the WordPress admin. This was once the primary level of a bigger effort to make enhancing code a extra stress-free revel in.<\/p>\n<p>These days, I\u2019m satisfied to announce the release of the second one level of that effort: <strong>introducing the brand new and advanced Code block<\/strong>.<\/p>\n<p>This isn&#8217;t a brand new block. It\u2019s an enhancement to the present Code block that you just\u2019ve most likely already been the usage of, which incorporates a number of enhancements over the unique:<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Syntax highlighting:<\/strong> Helps color-based syntax highlighting for over 100 not unusual languages.<\/li>\n<li><strong>Configuration:<\/strong> Make a decision to turn the filename, language identify, line numbers, or even come with a replica button for guests.<\/li>\n<li><strong>Drag-and-drop:<\/strong> Dragging a code report out of your laptop to the editor will mechanically turn out to be it to the Code block with the language set.<\/li>\n<li><strong>Transforms:<\/strong> Change into different code-supported blocks on WordPress.com, equivalent to Syntax Highlighter, to the brand new Code block.<\/li>\n<li><strong>Kinds:<\/strong> Customise syntax colours immediately from the editor or by way of \u2018theme.json\u2019 for those who\u2019re a developer.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\">The use of the improved Code block<\/h2>\n<p>You shouldn&#8217;t have to allow anything else to start the usage of the brand new model of the Code block. It\u2019s already to be had to make use of. Simply insert the Code block any place within the block editor and upload your code.<\/p>\n<p>By way of default, when including a Code block and putting code, you&#8217;re going to see your code in Simple Textual content:<\/p>\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" data-attachment-id=\"83016\" data-permalink=\"https:\/\/wordpress.com\/blog\/2026\/01\/19\/introducing-the-enhanced-code-block\/enhanced-code-block-plain-text-example\/\" data-orig-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-plain-text-example.jpg\" data-orig-size=\"1999,1039\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Enhanced Code Block \u2013 Plain Text Example\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-plain-text-example.jpg?w=300\" data-large-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-plain-text-example.jpg?w=1024\" width=\"1999\" height=\"1039\" src=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-plain-text-example.jpg\" alt=\"Example of code displayed in a blog post using plain text formatting. \" class=\"wp-image-83016\" style=\"box-shadow:var(--wp--preset--shadow--natural)\" srcset=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-plain-text-example.jpg 1999w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-plain-text-example.jpg?w=150&amp;h=78 150w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-plain-text-example.jpg?w=300&amp;h=156 300w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-plain-text-example.jpg?w=768&amp;h=399 768w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-plain-text-example.jpg?w=1024&amp;h=532 1024w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-plain-text-example.jpg?w=1440&amp;h=748 1440w\" sizes=\"(max-width: 1999px) 100vw, 1999px\"\/><\/figure>\n<p>After all, Simple Textual content doesn\u2019t come with any syntax highlighting because it\u2019s no longer a language. To modify this, make a choice a code language from the <strong>Settings \u2192 Language<\/strong> dropdown within the sidebar:<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" data-attachment-id=\"83018\" data-permalink=\"https:\/\/wordpress.com\/blog\/2026\/01\/19\/introducing-the-enhanced-code-block\/enhanced-code-block-syntax-highlighting-example\/\" data-orig-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-syntax-highlighting-example.jpg\" data-orig-size=\"1999,1039\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Enhanced Code Block \u2013 Syntax Highlighting Example\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-syntax-highlighting-example.jpg?w=300\" data-large-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-syntax-highlighting-example.jpg?w=1024\" width=\"1999\" height=\"1039\" src=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-syntax-highlighting-example.jpg\" alt=\"Example of the Code block displaying code using a language preset. \" class=\"wp-image-83018\" style=\"box-shadow:var(--wp--preset--shadow--natural)\" srcset=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-syntax-highlighting-example.jpg 1999w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-syntax-highlighting-example.jpg?w=150&amp;h=78 150w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-syntax-highlighting-example.jpg?w=300&amp;h=156 300w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-syntax-highlighting-example.jpg?w=768&amp;h=399 768w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-syntax-highlighting-example.jpg?w=1024&amp;h=532 1024w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-syntax-highlighting-example.jpg?w=1440&amp;h=748 1440w\" sizes=\"(max-width: 1999px) 100vw, 1999px\"\/><\/figure>\n<p>Syntax highlighting will then be carried out in response to the language that you just decided on, making the code a lot more readable for each you and your guests!<\/p>\n<p class=\"has-primary-light-background-color has-background\"><strong>Professional tip:<\/strong> When you kind 3 backticks adopted by way of the language identify (e.g., <code>```php<\/code>) after which hit <strong>Input<\/strong>, the editor will mechanically create a brand new Code block example and auto-fill the <strong>Language<\/strong> atmosphere.<\/p>\n<p>If you wish to kick your Code block\u2019s options up a notch, you&#8217;ll be able to additionally configure a number of different settings but even so the language:<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Filename:<\/strong> Upload a customized filename to show within the best left of the code block (helpful when strolling readers via tutorials).<\/li>\n<li><strong>Display language identify:<\/strong> Presentations the language identify within the best proper nook of the block.<\/li>\n<li><strong>Display replica button:<\/strong> Inserts a Reproduction button within the best proper of the block, permitting web page guests to duplicate everything of the code.<\/li>\n<li><strong>Display line numbers:<\/strong> Presentations line numbers subsequent on your code at the left.<\/li>\n<li><strong>Line numbers get started at:<\/strong> Make a choice a beginning line quantity.<\/li>\n<\/ul>\n<p>This will likely make your web page\u2019s code examples a lot more reader pleasant:<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" data-attachment-id=\"83020\" data-permalink=\"https:\/\/wordpress.com\/blog\/2026\/01\/19\/introducing-the-enhanced-code-block\/enhanced-code-block-extra-display-settings\/\" data-orig-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-extra-display-settings.jpg\" data-orig-size=\"1999,1039\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Enhanced Code Block \u2013 Extra Display Settings\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-extra-display-settings.jpg?w=300\" data-large-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-extra-display-settings.jpg?w=1024\" width=\"1999\" height=\"1039\" src=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-extra-display-settings.jpg\" alt=\"Example of the Code block displaying code using the additional language settings.\" class=\"wp-image-83020\" style=\"box-shadow:var(--wp--preset--shadow--natural)\" srcset=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-extra-display-settings.jpg 1999w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-extra-display-settings.jpg?w=150&amp;h=78 150w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-extra-display-settings.jpg?w=300&amp;h=156 300w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-extra-display-settings.jpg?w=768&amp;h=399 768w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-extra-display-settings.jpg?w=1024&amp;h=532 1024w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-extra-display-settings.jpg?w=1440&amp;h=748 1440w\" sizes=\"(max-width: 1999px) 100vw, 1999px\"\/><\/figure>\n<h2 class=\"wp-block-heading\">Customizing the Code block colours<\/h2>\n<p>There are more than one techniques to customise the syntax highlighting and colours proven with the improved Code block. On this phase, I\u2019ll stroll you via every from the fastest\/most simple to the extra complicated ways.<\/p>\n<h3 class=\"wp-block-heading\">Settling on a block taste<\/h3>\n<p>The Code block ships with 4 block types out of the field:<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Default:<\/strong> Will use the default types and colours out of your theme.<\/li>\n<li><strong>No Spotlight:<\/strong> Disables syntax highlighting.<\/li>\n<li><strong>Solarized Gentle:<\/strong> A gentle shade scheme.<\/li>\n<li><strong>Solarized Darkish:<\/strong> A dismal shade scheme.<\/li>\n<\/ul>\n<p>Topics too can check in further types. Settling on this type of types is the fastest approach to alternate how your Code block is output:<\/p>\n<figure data-carousel-extra=\"{&quot;blog_id&quot;:3584907,&quot;permalink&quot;:&quot;https:\/\/wordpress.com\/blog\/2026\/01\/19\/introducing-the-enhanced-code-block\/&quot;}\" class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;697083205d5e1&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"697083205d5e1\" class=\"wp-block-image size-full wp-lightbox-container\"><img decoding=\"async\" data-attachment-id=\"83023\" data-permalink=\"https:\/\/wordpress.com\/blog\/2026\/01\/19\/introducing-the-enhanced-code-block\/enhanced-code-block-solarized-light-preset-2\/\" data-orig-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-solarized-light-preset-1.jpg\" data-orig-size=\"1999,1039\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Enhanced Code Block \u2013 Solarized Light Preset\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-solarized-light-preset-1.jpg?w=300\" data-large-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-solarized-light-preset-1.jpg?w=1024\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" data-id=\"83023\" src=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-solarized-light-preset-1.jpg\" alt=\"Example of the Code block displaying code using the new Solarized Light preset.\" class=\"wp-image-83023\" style=\"box-shadow:var(--wp--preset--shadow--natural)\"\/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\"><br \/>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"\/>\n\t\t\t<\/svg><br \/>\n\t\t<\/button><\/figure>\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;697083205dc06&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"697083205dc06\" class=\"wp-block-image size-full wp-lightbox-container\"><img decoding=\"async\" data-attachment-id=\"83024\" data-permalink=\"https:\/\/wordpress.com\/blog\/2026\/01\/19\/introducing-the-enhanced-code-block\/enhanced-code-block-solarized-dark-preset\/\" data-orig-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-solarized-dark-preset.jpg\" data-orig-size=\"1999,1039\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Enhanced Code Block \u2013 Solarized Dark Preset\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-solarized-dark-preset.jpg?w=300\" data-large-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-solarized-dark-preset.jpg?w=1024\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" data-id=\"83024\" src=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-solarized-dark-preset.jpg\" alt=\"Example of the Code block displaying code using the new Solarized Dark preset.\" class=\"wp-image-83024\" style=\"box-shadow:var(--wp--preset--shadow--natural)\"\/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\"><br \/>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"\/>\n\t\t\t<\/svg><br \/>\n\t\t<\/button><\/figure>\n<\/figure>\n<h3 class=\"wp-block-heading\">Customizing colours from the editor<\/h3>\n<p>You&#8217;ll be able to additionally customise the colours immediately from the editor by way of the <strong>Kinds \u2192 Colour<\/strong> panel within the block sidebar. The block has an intensive array of shade choices for customizing each facet of the syntax highlighting:<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"83028\" data-permalink=\"https:\/\/wordpress.com\/blog\/2026\/01\/19\/introducing-the-enhanced-code-block\/enhanced-code-block-custom-colors\/\" data-orig-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-custom-colors.jpg\" data-orig-size=\"1999,1039\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Enhanced Code Block \u2013 Custom Colors\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-custom-colors.jpg?w=300\" data-large-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-custom-colors.jpg?w=1024\" loading=\"lazy\" width=\"1999\" height=\"1039\" src=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-custom-colors.jpg\" alt=\"Selecting custom colors for the Code Block syntax formatting. \" class=\"wp-image-83028\" style=\"box-shadow:var(--wp--preset--shadow--natural)\" srcset=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-custom-colors.jpg 1999w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-custom-colors.jpg?w=150&amp;h=78 150w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-custom-colors.jpg?w=300&amp;h=156 300w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-custom-colors.jpg?w=768&amp;h=399 768w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-custom-colors.jpg?w=1024&amp;h=532 1024w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-custom-colors.jpg?w=1440&amp;h=748 1440w\" sizes=\"auto, (max-width: 1999px) 100vw, 1999px\"\/><\/figure>\n<p>You aren&#8217;t restricted to just colours both. You&#8217;ll be able to customise any of the opposite to be had types, equivalent to Typography, Border, and extra. Those choices haven\u2019t modified with the newest enhancement.<\/p>\n<h3 class=\"wp-block-heading\">Customizing the Code block by way of theme.json<\/h3>\n<p>When you\u2019re a developer or theme creator, you\u2019ll in all probability need to outline default syntax colours and different types for the default output of the block. <code>theme.json<\/code> reinforce is integrated with this batch of improvements.<\/p>\n<p>Right here\u2019s what my customized Code block types appear to be after a couple of tweaks in <code>theme.json<\/code>:<\/p>\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"83029\" data-permalink=\"https:\/\/wordpress.com\/blog\/2026\/01\/19\/introducing-the-enhanced-code-block\/enhanced-code-block-customizing-styles-example\/\" data-orig-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-customizing-styles-example.jpg\" data-orig-size=\"1999,1039\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Enhanced Code Block \u2013 Customizing Styles Example\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-customizing-styles-example.jpg?w=300\" data-large-file=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-customizing-styles-example.jpg?w=1024\" loading=\"lazy\" width=\"1999\" height=\"1039\" src=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-customizing-styles-example.jpg\" alt=\"Example of the Code Block using custom colors. \" class=\"wp-image-83029\" style=\"box-shadow:var(--wp--preset--shadow--natural)\" srcset=\"https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-customizing-styles-example.jpg 1999w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-customizing-styles-example.jpg?w=150&amp;h=78 150w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-customizing-styles-example.jpg?w=300&amp;h=156 300w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-customizing-styles-example.jpg?w=768&amp;h=399 768w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-customizing-styles-example.jpg?w=1024&amp;h=532 1024w, https:\/\/en-blog.files.wordpress.com\/2026\/01\/enhanced-code-block-customizing-styles-example.jpg?w=1440&amp;h=748 1440w\" sizes=\"auto, (max-width: 1999px) 100vw, 1999px\"\/><\/figure>\n<p>For the reason that WordPress device itself doesn\u2019t reinforce customized colours by way of <code>theme.json<\/code>, the builders at WordPress.com in-built customized reinforce for this option. <\/p>\n<p>You&#8217;ll be able to customise any of the syntax colours by way of <code>settings.customized.core\/code<\/code> in <code>theme.json<\/code>. That is an object the place every secret&#8217;s the syntax shade identify and the worth is the colour itself.<\/p>\n<p>Right here\u2019s an instance snippet that you&#8217;ll be able to use to customise your individual colours:<\/p>\n<p>Any legitimate CSS shade is supported, so that you\u2019re no longer restricted to hex shade codes. Use CSS customized homes, RGBA, and extra.<\/p>\n<p>If you wish to borrow my complete <code>theme.json<\/code> customizations, replica and paste the next code. It comprises further customized types to make the Code block even nicer:<\/p>\n<h2 class=\"wp-block-heading\">Get started sharing code now.<\/h2>\n<p>Whether or not you\u2019re publishing snippets or full-blown tutorials, the improved Code block makes sharing and styling code in WordPress.com smoother and extra customizable than ever earlier than.\u00a0<\/p>\n<p>Syntax highlighting, block types, and customized shade choices put you in complete regulate of ways your code seems.\u00a0<\/p>\n<p>With those enhancements, you&#8217;ll be able to focal point much less on formatting and extra on writing nice content material that is helping your readers be told and construct.<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Closing yr, WordPress.com presented new code editors for the block editor and the Further CSS enter field within the WordPress admin. This was once the primary level of a bigger effort to make enhancing code a extra stress-free revel in. These days, I\u2019m satisfied to announce the release of the second one level of that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4630,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4628","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/thedigitalsagency.com\/services\/digital-downloadable\/wp-json\/wp\/v2\/posts\/4628","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thedigitalsagency.com\/services\/digital-downloadable\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thedigitalsagency.com\/services\/digital-downloadable\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thedigitalsagency.com\/services\/digital-downloadable\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thedigitalsagency.com\/services\/digital-downloadable\/wp-json\/wp\/v2\/comments?post=4628"}],"version-history":[{"count":1,"href":"https:\/\/thedigitalsagency.com\/services\/digital-downloadable\/wp-json\/wp\/v2\/posts\/4628\/revisions"}],"predecessor-version":[{"id":4629,"href":"https:\/\/thedigitalsagency.com\/services\/digital-downloadable\/wp-json\/wp\/v2\/posts\/4628\/revisions\/4629"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thedigitalsagency.com\/services\/digital-downloadable\/wp-json\/wp\/v2\/media\/4630"}],"wp:attachment":[{"href":"https:\/\/thedigitalsagency.com\/services\/digital-downloadable\/wp-json\/wp\/v2\/media?parent=4628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thedigitalsagency.com\/services\/digital-downloadable\/wp-json\/wp\/v2\/categories?post=4628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thedigitalsagency.com\/services\/digital-downloadable\/wp-json\/wp\/v2\/tags?post=4628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}