WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.57k stars 4.22k forks source link

Theme Style Variations: The chosen style variation becomes "detached" when developing a theme locally #62210

Open ndiego opened 6 months ago

ndiego commented 6 months ago

Description

This bug is tricky to explain in words, so I recommend watching the video below. Basically, if you have set your site to a specific style variation and then make a change to the JSON file that handles that variation, your site will become "detached" from the variation, and your changes will not be reflected. This does not occur in 6.5, only with the latest changes in Gutenberg that introduced the color and typography presets.

I have noted this as a regression because while this bug does not impact site users, it's a regression in block theme developer experience.

Step-by-step reproduction instructions

  1. Open a theme like TT4 in a local development environment
  2. In the Site Editor, choose a style variation other than the default (perhaps Ember) and save
  3. Open the file for that style variation and make a change (perhaps change the border-radius on buttons)
  4. Save the file, then go back to the Site Editor and refresh
  5. Notice that the style variation is no longer selected, yet the color and typography settings are (sometimes these get deselected as well)
  6. Also notice that the change you made in the style variation JSON file is not reflected on the site.
  7. Now, choose the style variation again and save. You changes should now display

Screenshots, screen recording, code snippet

https://github.com/WordPress/gutenberg/assets/4832319/6b659aaa-ed56-4286-8fc7-bc539516972f

Environment info

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

talldan commented 6 months ago

I'm keeping a look out for any incoming block style variation issues. Changed the title of this one slightly to help distinguish it more.

ndiego commented 6 months ago

After some more research, I discovered that this is not, in fact, a regression. Therefore, I have removed the label, and given how far along we are in the 6.6 release cycle, I have removed it from the board.

Once a style variation is selected, it loses all connection to the JSON file that provided it. In my opinion, this remains a significant issue for block theme developers.

carolinan commented 1 month ago

this remains a significant issue for block theme developers.

I second this, working with variations is very time consuming.