$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>block editor - Is the `layout` settings in `theme.json` applied only to Gutenberg or also on the client side?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

block editor - Is the `layout` settings in `theme.json` applied only to Gutenberg or also on the client side?

matteradmin12PV0评论

Here’s how you can convert your inquiry into a Stack Overflow question:

I have the following configuration in my theme.json file:

"settings": {
    "layout": {
        "contentSize": "650px",
        "wideSize": "800px"
    }
}

My question is: Does this layout setting apply exclusively to the Gutenberg editor, or does it also affect the client-side frontend of the site?

Here’s how you can convert your inquiry into a Stack Overflow question:

I have the following configuration in my theme.json file:

"settings": {
    "layout": {
        "contentSize": "650px",
        "wideSize": "800px"
    }
}

My question is: Does this layout setting apply exclusively to the Gutenberg editor, or does it also affect the client-side frontend of the site?

Share Improve this question asked Apr 14 at 12:29 WordCentWordCent 1,9646 gold badges34 silver badges60 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 3

Yes, it affects the front end.

In a properly written block or hybrid theme it sets the maximum width of any content inside a block that has the constrained layout. The most obvious example of this is the Group or Content blocks when Inner blocks use content width is enabled. The wide size is the size used when one of those inner blocks has its alignment set to Wide.

WordPress will output this CSS in a <style> tag to apply the size:

.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
    max-width: var(--wp--style--global--content-size);
    margin-left: auto !important;
    margin-right: auto !important;
}
Post a comment

comment list (0)

  1. No comments so far