blockGap Default in theme.json not applied
-
I want to set the row gap so rows inside columns have a gap I like . One by default that is 0.625rem or
--wp-preset--spacing--30When I use the following style in
app.css.wp-block-group {
gap: 0.625rem; /* 10px */
}and
editor.css:.editor-styles-wrapper .wp-block-group {
gap: 0.625rem; /* --wp--preset--spacing--30 */
}the blocks are styled with that gap. When I add
...
"styles": {
"blocks": {
"core/group": {
"spacing": {
"blockGap": "0.625rem"
}
}
}
...to
bud.conf.jswhich is added totheme.jsonthe blocks do not take this styling at all. I did rebuild withyarn buildand thetheme.jsondid get updated. But the patterns, blocks added do not seem to pick up on these rules. Why is that?here the full Sage 10 starter theme
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('http://localhost:3000')
.setProxyUrl('https://cafejpcoen.test')
.watch(['resources/views', 'app']);
/**
* Generate WordPresstheme.json
*
* @note This overwritestheme.jsonon every build.
*
* @see {@link https://bud.js.org/extensions/sage/theme.json}
* @see {@link https://developer.ww.wp.xz.cn/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: '40rem',
wideSize: '54rem',
fullSize: '100%',
},
typography: {
customFontSize: false,
},
})
.useTailwindColors()
.useTailwindFontFamily()
.useTailwindFontSize();
};
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘blockGap Default in theme.json not applied’ is closed to new replies.