The Code Editors available across Cornerstone were updated to make them more accessible and significantly easier to work with. They can be found by clicking the Custom Code button located in the lower right section of Cornerstone.
If you are in the Theme Options and click on the Code Editor button, you will see the following editors appear as a popup:
The main difference with the new code editors is that no matter what context you are in, you will always be able to see and access the contextual code editor for the current resource you're viewing (e.g. post, page, et cetera) as well as the global code editor. Notice in the screenshot above that Page CSS and Page JS is right next to a label of Global CSS and Global JS. Selecting Global CSS will tab over to the sitewide CSS editor, allowing you to make easy adjustments with the click of a mouse:
The code editors have also been updated to be resizable by hovering over any of the edges of the editor, which will reveal a resize handle to alter its size:
Additionally, these new code editors "float" over the builder interface, meaning that they will remain open until closed out using the × button in the upper right corner. Additionally, they can be dragged around to reside anywhere on the screen by clicking in the header and moving it to your desired location. This increased flexibility makes adding custom code to your website much easier than its ever been.
Code Editor Preferences
@since Cornerstone 7.3.0 / Pro 6.3.0
In the preferences area you can change your Code Editor theme, font size, and key maps. Cornerstone comes with over 60+ code editor themes.
Changing the default Code Editor Preferences
The following filters will change the default Code Editor preferences for all users who have not changed their preferences.
Alternatively if you are changing multiple other preferences. You can add on to the filter
Adding Custom Code Editor Themes
cs_code_editor_themes you can add any CodeMirror theme you would like. See our example below.
See something inaccurate? Let us know