[wp-trac] [WordPress Trac] #54550: The margin added at the top level styles (for body) in theme.json is override by a margin added from Gutenberg

WordPress Trac noreply at wordpress.org
Mon Dec 6 21:07:49 UTC 2021


#54550: The margin added at the top level styles (for body) in theme.json is
override by a margin added from Gutenberg
------------------------------+---------------------
 Reporter:  get_dave          |       Owner:  (none)
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  5.9
Component:  General           |     Version:  trunk
 Severity:  minor             |  Resolution:
 Keywords:  has-patch commit  |     Focuses:
------------------------------+---------------------
Changes (by hellofromTonya):

 * keywords:  has-patch needs-testing => has-patch commit


Comment:

 = Test Report

 Env:
 * OS: macOS
 * Localhost: wp-env
 * Theme: TT2
 * Plugins: none
 * WordPress: trunk

 == Steps

 1. Add the following to the TT2's `src/wp-
 content/themes/twentytwentytwo/theme.json` file in the `"styles"` section
 on about line 333:

 {{{
                 "spacing": {
                         "blockGap": "1.5rem",
                         "margin": "0 5rem",
                         "padding": "0"
                 },
 }}}

 2. Run in the following commands in the console (terminal):

 {{{
 npm run build
 npm run env:start
 npm run env:install
 }}}

 3. Open the site in your favorite browser http://localhost:8889/
 4. In your browser, open the dev tools to the Elements tab and click on
 the `<body>` element. Look at the `Styles`.

 Before the patch, the `<body>` `margin` will be `0` with the `margin: 0
 5rem;` from the theme crossed out.

 After applying the patch, the `<body>` `margin: 0;` is crossed out and the
 theme's `margin: 0 5rem;` is active.

 == Results

 I can reproduce the issue.

 Applying the patch resolves it.

 Marking for commit.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54550#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list