Skip to content

Commit 97e07c6

Browse files
authored
Merge branch 'master' into feature/better-gut-ux
2 parents 1e989e1 + 0c55be7 commit 97e07c6

File tree

13 files changed

+474
-722
lines changed

13 files changed

+474
-722
lines changed

inc/async/loadfont.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<!-- Polyfill.io -->
2+
<script src="https://cdn.polyfill.io/v3/polyfill.min.js?features=es5,es6,fetch,Array.prototype.includes,CustomEvent,Element.prototype.closest,NodeList.prototype.forEach"></script>
3+
14
<script>
25
// inline loadJS
36
function loadJS(e,t){"use strict";var n=window.document.getElementsByTagName("script")[0],o=window.document.createElement("script");return o.src=e,o.async=!0,n.parentNode.insertBefore(o,n),t&&"function"==typeof t&&(o.onload=t),o}

inc/services/assets.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ public function get_min_file( $type ) {
145145
case 'css':
146146
$file = $assets['app.css'];
147147
break;
148+
case 'editor-style':
149+
$file = $assets['editor-style.css'];
150+
break;
148151
case 'js':
149152
$file = $assets['app.js'];
150153
break;

inc/services/theme.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
namespace BEA\Theme\Framework\Services;
4+
use BEA\Theme\Framework\Framework;
45
use BEA\Theme\Framework\Service;
56
use BEA\Theme\Framework\Service_Container;
67

@@ -75,6 +76,22 @@ private function i18n() {
7576
* editor style
7677
*/
7778
private function editor_style() {
78-
add_editor_style('dist/assets/editor-style.css');
79+
/**
80+
* Default file
81+
**/
82+
$file = 'editor-style.css';
83+
84+
if ( ! defined( 'SCRIPT_DEBUG' ) || false === SCRIPT_DEBUG ) {
85+
$file = Framework::get_container()->get_service( 'assets' )->get_min_file( 'editor-style' );
86+
}
87+
88+
/**
89+
* Do not enqueue a inexistant file on admin
90+
*/
91+
if ( ! is_file( get_theme_file_path( 'dist/assets/' . $file ) ) ) {
92+
return;
93+
}
94+
95+
add_editor_style( 'dist/assets/' . $file );
7996
}
8097
}

0 commit comments

Comments
 (0)