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

Rename default block styles to "Default" #13670

Merged
merged 2 commits into from
Feb 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/block-library/src/button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Copy link
Contributor

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)

Copy link
Contributor

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?

Copy link
Contributor

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)

Copy link
Contributor Author

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:

screen shot 2019-02-05 at 12 51 47 pm

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.

Copy link
Contributor

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.

Copy link
Member

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.

{ name: 'outline', label: __( 'Outline' ) },
{ name: 'squared', label: _x( 'Squared', 'block style' ) },
],
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/pullquote/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const settings = {
attributes: blockAttributes,

styles: [
{ name: 'default', label: _x( 'Regular', 'block style' ), isDefault: true },
{ name: 'default', label: _x( 'Default', 'block style' ), isDefault: true },
{ name: SOLID_COLOR_STYLE_NAME, label: __( 'Solid Color' ) },
],

Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/quote/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const settings = {
attributes: blockAttributes,

styles: [
{ name: 'default', label: _x( 'Regular', 'block style' ), isDefault: true },
{ name: 'default', label: _x( 'Default', 'block style' ), isDefault: true },
{ name: 'large', label: _x( 'Large', 'block style' ) },
],

Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/separator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const settings = {
keywords: [ __( 'horizontal-line' ), 'hr', __( 'divider' ) ],

styles: [
{ name: 'default', label: __( 'Short Line' ), isDefault: true },
{ name: 'default', label: __( 'Default' ), isDefault: true },
{ name: 'wide', label: __( 'Wide Line' ) },
{ name: 'dots', label: __( 'Dots' ) },
],
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const settings = {
},

styles: [
{ name: 'regular', label: _x( 'Regular', 'block style' ), isDefault: true },
{ name: 'regular', label: _x( 'Default', 'block style' ), isDefault: true },
{ name: 'stripes', label: __( 'Stripes' ) },
],

Expand Down