Rename default block styles to "Default"#13670
Conversation
Resolves #13660. This aligns the classname with the actual name we're using in the UI, and also allows for a bit more flexibility for default block styles per theme.
|
Love it, thank you! 🤟 from me, I guess it just needs a code sanity check. Pretty sure this doesn't require deprecation handlers. |
|
|
||
| styles: [ | ||
| { name: 'default', label: _x( 'Rounded', 'block style' ), isDefault: true }, | ||
| { name: 'default', label: _x( 'Default', 'block style' ), isDefault: true }, |
There was a problem hiding this comment.
I think we landed a PR recently where we could drop these entirely from here and they will be added automatically (needs verification)
There was a problem hiding this comment.
Can we get a reference to that PR here? What exactly can we drop?
There was a problem hiding this comment.
Sure sorry it wasn't that clear.
Here's the PR #12519
I think the entire line can be dropped (the default style)
There was a problem hiding this comment.
I just tested this, and it almost works. The block has the correct styles by default, but the "Default" style option does not appear in the style picker:
Since it's not there, if you select an alternate style, there'd be no way to switch back to the default. 😕
So for now at least, I think we do need these lines.
There was a problem hiding this comment.
Mmm weird, I though it was the intent of the linked PR. pinging @swissspidy to check my assumptions :) but feel free to move forward with the PR.
There was a problem hiding this comment.
Yeah that was the goal of #12519 🤔 No idea why it doesn't work, I would have to investigate.
|
Since the "Rounded" style for buttons is now just "Default", wouldn't it make sense to also add a dedicated "Rounded" style that themes can choose to support if their default isn't rounded? Same for other blocks where the default style wasn't previously just called "Regular". |
|
@ZebulanStanphill nothing stops themes from registering custom style variations. |
|
@youknowriad I know, but I thought it was kind of weird to provide a core style for a long line separator but not a dedicated core style for a short line separator. |
mapk
left a comment
There was a problem hiding this comment.
Just tested and everything appears to be working great! I've a few notes.
- The
is-style-defaultclass didn't appear when I added the block. It only appeared when I selected it from the block style variations. Maybe this is how it always worked? - The Table block show
defaultin the Block Styles, but uses the classis-style-regularin the HTML. Is this right?
Yeah, that's how it behaves today.
Hmm... you're right. That's not ideal. Ideally we should be using |
|
Thanks for addressing those points, @kjellr. |
|
Thanks, everyone! |
|
Hi guys, I'm really too late to the party here, sorry, but still I can see an issue with Separator block styles (and probably other blocks too): If a theme styles Wouldn't this cause UX issues? |
|
@webmandesign See #14102. |
|
Thanks @swissspidy |
Resolves #13660. This aligns the classname with the actual name we're using in the UI, and also allows for a bit more flexibility for default block styles per theme.
Resolves #13660. This aligns the classname with the actual name we're using in the UI, and also allows for a bit more flexibility for default block styles per theme.

Resolves #13660.
This aligns name we're using in the UI with the classname, and also lets us be a little less prescriptive about what exactly the default block styles per theme should look like.
Short Line➡️DefaultRegular➡️DefaultRegular➡️DefaultRegular➡️DefaultRounded➡️Default