Skip to content

Commit

Permalink
Do not use minified CSS on WordPress.com
Browse files Browse the repository at this point in the history
wpcom does its own concatenation / minification, so we don't need to enqueue a minified file there.
  • Loading branch information
jeherve committed Oct 11, 2019
1 parent f93cd56 commit 288254c
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions modules/theme-tools/site-logo/inc/class-site-logo-control.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,21 @@ public function enqueue() {
// Enqueues all needed media resources.
wp_enqueue_media();

// Enqueue our control script and styles.
$min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
/*
* Enqueue our control script and styles.
*/

// We only enqueue a minified version of the file on prod. Jetpack.
$min = (
( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG )
|| ( defined( 'IS_WPCOM' ) && IS_WPCOM )
)
? ''
: '.min';

wp_enqueue_style(
'site-logo-control',
plugins_url( "../css/site-logo-control{$min}.css", __FILE__ ),
plugins_url( '../css/site-logo-control.css', __FILE__ ),
array(),
JETPACK__VERSION
);
Expand Down

0 comments on commit 288254c

Please sign in to comment.