Skip to content

Commit e4acb76

Browse files
Adjust Gutenberg support
1 parent 627395e commit e4acb76

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

app/integrations/gutenberg/class-gutenberg.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function add_theme_support() {
6868
add_theme_support( 'editor-styles' );
6969

7070
// Add editor style.
71-
add_editor_style( 'public/css/gutenberg.min.css' );
71+
add_editor_style( 'public/css/gutenberg-css.min.css' );
7272

7373
$palette = [];
7474
$colors = bigbox_get_theme_colors();
@@ -162,6 +162,10 @@ public function inline_editor_css( $settings ) {
162162
$weight_base = bigbox_get_theme_font_weight( 'base' );
163163
$weight_bold = bigbox_get_theme_font_weight( 'bold' );
164164

165+
if ( 'default' === $family ) {
166+
$family = "-apple-system, blinkmacsystemfont, 'Segoe UI', roboto, 'Helvetica Neue', arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'";
167+
}
168+
165169
$config = [];
166170

167171
// Base.
@@ -173,7 +177,7 @@ public function inline_editor_css( $settings ) {
173177
'declarations' => [
174178
'color' => esc_attr( $gray700 ),
175179
'font-size' => ( $size * 16 ) . 'px',
176-
'font-family' => esc_attr( $family ),
180+
'font-family' => $family,
177181
'font-weight' => $weight_base,
178182
],
179183
];
@@ -215,12 +219,6 @@ public function inline_editor_css( $settings ) {
215219
'selectors' => [
216220
'.editor-post-title__block .editor-post-title__input',
217221
'a',
218-
'h1',
219-
'h2',
220-
'h3',
221-
'h4',
222-
'h5',
223-
'h6',
224222
],
225223
'declarations' => [
226224
'color' => esc_attr( $gray800 ),
@@ -255,8 +253,7 @@ public function inline_editor_css( $settings ) {
255253
}
256254

257255
$settings['styles'][] = [
258-
'baseUrl' => null,
259-
'css' => $css->build(),
256+
'css' => $css->build(),
260257
];
261258

262259
return $settings;

resources/assets/scss/gutenberg.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ $use-margins: false;
3535
font-size: font-size("md");
3636

3737
.editor-post-title__input {
38-
font-family: $font-family-sans-serif;
3938
font-size: font-size("lg");
4039

4140
@include media-breakpoint-up(md) {

0 commit comments

Comments
 (0)