Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocks can get published without a Style, but once you select a Style, you can never de-select a Style #37897

Closed
MadtownLems opened this issue Jan 11, 2022 · 5 comments
Labels
[Feature] Theme Style Variations Related to style variations provided by block themes General Interface Parts of the UI which don't fall neatly under other labels. [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Enhancement A suggestion for improvement. [Type] Question Questions about the design or development of the editor.

Comments

@MadtownLems
Copy link

Description

Take, for example, the Table Block - which has Default and Stripes as Styles by default.

If I add a Table Block to a Page and publish it, I have a Table with no style selected.

(with no is-style-xxx)

However, once I click on Default or Stripes, I can never NOT have a style selected again. The UI simply doesn't support it. I can only toggle between the two Styles.

This feels incredibly inconsistent. Either I should be able to have a Table Block with no style (and be able to select that in the UI), or I should NOT be able to have a style-less Table Block and one should always be applied. I should NOT be permanently locked into a Style once I try one.

Step-by-step reproduction instructions

  1. Add a Table Block.
  2. Publish the Post.
  3. See that the Table Block has no style in the markup (with no is-style-xxx)
  4. Edit the post, and select a Style.
  5. See that you can no longer get back to a style-less state with the UI.

Screenshots, screen recording, code snippet

No response

Environment info

WordPress 5.8.3 (and 5.9-RC2). Not using the Gutenberg plugin. Confirmed on 2021 theme.

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

@annezazu
Copy link
Contributor

Hey @MadtownLems. I could be missing something but, from what I understand, the Style options automatically are set to "default". For example, if I add an image block, it's automatically set to Default but I can switch to Rounded and back again. This is also the case, from what I can see, with the Table block, Buttons block, and more. Is your issue about the UX of this or the fact that you want to have something other than the Default as the initial option or something else entirely?

Thanks for following up with extra info so I can better understand!

@annezazu annezazu added [Status] Needs More Info Follow-up required in order to be actionable. [Type] Enhancement A suggestion for improvement. General Interface Parts of the UI which don't fall neatly under other labels. labels Jan 11, 2022
@MadtownLems
Copy link
Author

When you first add the Table Block, the UI actually SHOWS 'Default' as selected. However, if you just publish the post, you'll see the table doesn't actually have the "is-style-regular" class. If you click on the already-selected 'Default' style, and publish/update the post, only NOW does the table have the "is-style-regular" class.

thanks for the quick reply - let me know if you still need more info!

@annezazu
Copy link
Contributor

Ah ha! Thanks for clarifying. I'll update the labeling and see if others can provide more context as to why it's setup like this :)

@annezazu annezazu added [Type] Question Questions about the design or development of the editor. and removed [Status] Needs More Info Follow-up required in order to be actionable. labels Jan 11, 2022
@glendaviesnz
Copy link
Contributor

It is possible to remove the is-style-x under the advanced tab in block settings panel, but this isn't at all obvious - a 'Clear' option might be useful in the Styles tab, but I am not aware of why it initially defaults to 'default' but doesn't add the class, so not sure of the implications of adding this.
styles

@talldan
Copy link
Contributor

talldan commented Jan 12, 2022

This is a flaw of the way default styles work in the style variations system. Not an easy issue to fix unfortunately, as previously attempted fixes have broken styles provided by plugins.

It was also reported at #20706, so I'll close this as a duplicate.

@talldan talldan closed this as completed Jan 12, 2022
@talldan talldan added [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Feature] Theme Style Variations Related to style variations provided by block themes labels Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Theme Style Variations Related to style variations provided by block themes General Interface Parts of the UI which don't fall neatly under other labels. [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Enhancement A suggestion for improvement. [Type] Question Questions about the design or development of the editor.
Projects
None yet
Development

No branches or pull requests

4 participants