mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-03 22:27:04 +00:00
Customize: Introduce extensible code editor Customizer control for CodeMirror.
* Adds `WP_Customize_Code_Editor_Control` and `wp.customize.CodeEditorControl()`. * Control respects user preference for syntax highlighting, showing a textarea when user opts out. * Code editor control takes the ad hoc code for Additional CSS and makes it reusable and extensible, for Additional CSS in core and plugins to use (such as Jetpack). * Replace `settings` arg in `wp_enqueue_code_editor()` with separate args for `codemirror`, `csslint`, `jshint`, and `htmlhint`. * Prefix `codemirror` script and style handles with `wp-` to prevent collisions, as also the object is exported as `wp.CodeMirror` in JS. * Reduce indent size in Customizer code editor instances and Custom HTML widget to use tab size of 2 instead of 4 to save on space. See #12423, #38707, #35395. Fixes #41897. git-svn-id: https://develop.svn.wordpress.org/trunk@41558 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1164,12 +1164,26 @@ p.customize-section-description {
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom CSS Section
|
||||
* Code Editor Control and Custom CSS Section
|
||||
*
|
||||
* Modifications to the Section Container to make the textarea full-width and
|
||||
* full-height, if the control is the only control in the section.
|
||||
*/
|
||||
|
||||
.customize-control-code_editor textarea {
|
||||
width: 100%;
|
||||
font-family: Consolas, Monaco, monospace;
|
||||
font-size: 12px;
|
||||
padding: 6px 8px;
|
||||
-moz-tab-size: 2;
|
||||
-o-tab-size: 2;
|
||||
tab-size: 2;
|
||||
}
|
||||
.customize-control-code_editor textarea,
|
||||
.customize-control-code_editor .CodeMirror {
|
||||
height: 14em;
|
||||
}
|
||||
|
||||
#customize-controls .customize-section-description-container.section-meta.customize-info {
|
||||
border-bottom: none;
|
||||
}
|
||||
@@ -1180,13 +1194,7 @@ p.customize-section-description {
|
||||
|
||||
#customize-control-custom_css textarea {
|
||||
display: block;
|
||||
font-family: Consolas, Monaco, monospace;
|
||||
font-size: 12px;
|
||||
padding: 6px 8px;
|
||||
height: 500px;
|
||||
-moz-tab-size: 4;
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
}
|
||||
|
||||
.customize-section-description-container + #customize-control-custom_css:last-child textarea {
|
||||
|
||||
Reference in New Issue
Block a user