Allow sourcecode font size to be configurable

  • Author
  • #1027418


    I wanted make a feature request regarding the ‘[sourcecode]‘ markup.

    At present, for most (all?) themes, this defaults to 11px font size. However, at this size it makes the source code difficult to follow — and source code tends to be difficult to follow in the best of cases.

    I wanted to ask if you could introduce an additional parameter for the ‘sourcecode’ markup that allows us to set the font size? Or alternatively, have the sourcecode default to the same size as the body text of a given theme, or even simply just default to a larger type, such as 13px.

    Whilst I could get around this by purchasing the custom CSS upgrade, it would certainly be nice to have a more readable default for this.
    Blog url:

    The blog I need help with is



    Actually that’s not correct. The font family and the font size used for regular text in posts and static pages varies from theme to theme.



    I’m speaking only of the font size of codeblocks produced by using the ‘[sourcecode] … [/sourcecode]‘ markup. In all the themes I’ve tested, this has been 11px in size, irrespective of the theme’s default font size.



    Okay, I’ve flagged this thread so it will be moved to the Ideas Forum where we make suggestions for improvements to Staff.


    The font size is indeed set by the plugin. It does appear to be a font size intentionally set for the best overall experience across a wide range of design scenarios and themes.

    You do have the option to customize the font size in the sourcecode shortcode with the Custom Design upgrade. to do that, add the following to your Appearance → Custom Design → CSS editor:

    div.syntaxhighlighter div,
    div.syntaxhighlighter code,
    div.syntaxhighlighter table,
    div.syntaxhighlighter table td,
    div.syntaxhighlighter table tr,
    div.syntaxhighlighter table tbody {
    	font-size: 13px !important;

    And adjust it from there to get the best result for your case.

The topic ‘Allow sourcecode font size to be configurable’ is closed to new replies.