WordPress.org

Make WordPress Core

Opened 6 weeks ago

Last modified 6 weeks ago

#50205 new feature request

Add full screen mode to the customizer's additional css control

Reported by: hayatbiralem Owned by:
Milestone: Future Release Priority: normal
Severity: minor Version:
Component: Customize Keywords: close
Focuses: Cc:

Description

Hello,

Sometimes our CSS rules and its contents could be long than the width of the customizer sidebar. Sometimes when doing some search and refactoring we need to toggle full screen. I think it could be very useful.

And it could be implemented easily by adding following settings to the related code mirror creation:

Javascript

CodeMirror.fromTextArea(element, {
    // ...
    extraKeys: {
        "F11": function(cm) {
            cm.setOption("fullScreen", !cm.getOption("fullScreen"));
        },
        "Esc": function(cm) {
            if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
        }
    }
});

CSS

html body .CodeMirror-fullscreen {
    z-index: 1000;
}

I tried it on a custom textarea control and it worked without any other addition and that would be great if the default additional css control has that functionality.

Thanks in advance.

Change History (3)

#2 @hayatbiralem
6 weeks ago

You can see it in action at here: https://github.com/hayatbiralem/wp-customizer-tracking-codes

This plugin's code panels supports F11 to toggle full screen.

#3 @dlh
6 weeks ago

  • Focuses ui css removed
  • Keywords close added
  • Milestone changed from Awaiting Review to Future Release

Hi @hayatbiralem, and welcome to WordPress Trac!

Resizable controls have been discussed previously in #32296. The consensus was to avoid introducing them into core without a wide range of theme- and plugin-specific testing (see ticket:32296#comment:39), and I don't anticipate there being resources available to do that anytime soon. Additionally, new keyboard shortcuts in core might be best implemented with core's own shortcuts library. In the meantime, this sounds like it would make a great plugin for users who are using the Additional CSS control extensively.

Note: See TracTickets for help on using tickets.