It seems for iframe display you need to use enqueue_block_editor_assets
but when I use
add_action('enqueue_block_assets', function () {
bundle('editor')->enqueue();
}, 100);
instead of
add_action('enqueue_block_editor_assets', function () {
bundle('editor')->enqueue();
}, 100);
I lose all font styling in the block editor for all views, not just tablet and mobile alone. But the editor.css is enqueued in bud.conf.js
/**
* Compiler configuration
*
* @see {@link https://roots.io/sage/docs sage documentation}
* @see {@link https://bud.js.org/learn/config bud.js configuration guide}
*
* @type {import('@roots/bud').Config}
*/
export default async (app) => {
/**
* Application assets & entrypoints
*
* @see {@link https://bud.js.org/reference/bud.entry}
* @see {@link https://bud.js.org/reference/bud.assets}
*/
app
.entry('app', ['@scripts/app', '@styles/app'])
.entry('editor', ['@scripts/editor', '@styles/editor'])
.assets(['images']);
/**
* Set public path
*
* @see {@link https://bud.js.org/reference/bud.setPublicPath}
*/
app.setPublicPath('/wp-content/themes/cafejp/public/');
/**
* Development server settings
*
* @see {@link https://bud.js.org/reference/bud.setUrl}
* @see {@link https://bud.js.org/reference/bud.setProxyUrl}
* @see {@link https://bud.js.org/reference/bud.watch}
*/
app
.setUrl('https://localhost:3000')
.setProxyUrl('https://cafejpcoen.test')
.watch(['resources/views', 'app']);
/**
* Generate WordPress
theme.json
*
* @note This overwrites theme.json
on every build.
*
* @see {@link https://bud.js.org/extensions/sage/theme.json}
* @see {@link https://developer.www.ads-software.com/block-editor/how-to-guides/themes/theme-json}
*/
app.wpjson
.setSettings({
background: {
backgroundImage: true,
},
color: {
custom: false,
customDuotone: false,
customGradient: false,
defaultDuotone: false,
defaultGradients: false,
defaultPalette: false,
duotone: [],
},
custom: {
spacing: {},
typography: {
'font-size': {},
'line-height': {},
},
},
spacing: {
blockGap: true,
margin: true,
padding: true,
// If custom spacing sizes are not needed, remove or comment out this block
// spacingSizes: [],
units: ['px', '%', 'em', 'rem', 'vw', 'vh'],
},
layout: {
contentSize: '55rem',
wideSize: '64rem',
fullSize: '100%',
},
typography: {
customFontSize: false,
},
})
.useTailwindColors()
.useTailwindFontFamily()
.useTailwindFontSize();
};
and has
/*---------------------------------------------------
* Fonts
----------------------------------------------------*/
@import 'common/fonts';
/*---------------------------------------------------
* Drinks Menu
----------------------------------------------------*/
.editor-styles-wrapper .wp-block-group {
gap: 0.625rem; /* --wp--preset--spacing--30 */
}
/* Desktop: Three columns */
.editor-styles-wrapper .wp-block-cover .block-editor-block-list__block.wp-block-columns {
display: flex;
flex: 1 1 calc(33.333% - 20px);
}
/* Tablets: Two columns */
@media (max-width: 1024px) {
.editor-styles-wrapper .wp-block-cover .block-editor-block-list__block.wp-block-columns {
flex: 1 1 calc(50% - 20px);
}
}
/* Mobile: One column */
@media (max-width: 767px) {
.editor-styles-wrapper .wp-block-cover .block-editor-block-list__block.wp-block-columns {
flex: 1 1 100%;
}
}
/*---------------------------------------------------
* Cover Block Extension
----------------------------------------------------*/
.play-button {
background-color: rgba(0, 0, 0, 0.5);
color: white;
border: none;
padding: 10px;
cursor: pointer;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
including font import. So what is going on here?
-
This reply was modified 5 months ago by
Yui.
-
This reply was modified 5 months ago by
Rhand.