-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
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. |
@@ -78,7 +78,7 @@ export const settings = { | |||
}, | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get a reference to that PR here? What exactly can we drop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested and everything appears to be working great! I've a few notes.
- The
is-style-default
class 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
default
in the Block Styles, but uses the classis-style-regular
in 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alrighty,
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
➡️Default
Regular
➡️Default
Regular
➡️Default
Regular
➡️Default
Rounded
➡️Default