From 3a73d5f79708f79698283159778cd5ec7115e9ba Mon Sep 17 00:00:00 2001 From: Matias Benedetto Date: Wed, 29 Jun 2022 17:13:16 +0200 Subject: [PATCH 01/10] Post comments form: removing styles targeting submit button because they are overriding the core/block button styles. --- .../block-library/src/post-comments-form/style.scss | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/block-library/src/post-comments-form/style.scss b/packages/block-library/src/post-comments-form/style.scss index 0d529a303843f..78edc1c192e1b 100644 --- a/packages/block-library/src/post-comments-form/style.scss +++ b/packages/block-library/src/post-comments-form/style.scss @@ -19,16 +19,6 @@ letter-spacing: inherit; } - // Styles copied from button block styles. - input[type="submit"] { - border: none; - box-shadow: none; - cursor: pointer; - display: inline-block; - text-align: center; - overflow-wrap: break-word; - } - textarea, input:not([type="submit"]) { border: 1px solid $gray-600; From c5429d935a4763fe2ac95d2c7baa66f530d90efd Mon Sep 17 00:00:00 2001 From: Matias Benedetto Date: Wed, 29 Jun 2022 20:17:50 +0200 Subject: [PATCH 02/10] Removing just the properties provided by theme.json --- packages/block-library/src/post-comments-form/style.scss | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/block-library/src/post-comments-form/style.scss b/packages/block-library/src/post-comments-form/style.scss index 78edc1c192e1b..4e70906063d6f 100644 --- a/packages/block-library/src/post-comments-form/style.scss +++ b/packages/block-library/src/post-comments-form/style.scss @@ -19,6 +19,15 @@ letter-spacing: inherit; } + // Styles copied from button block styles. + input[type="submit"] { + box-shadow: none; + cursor: pointer; + display: inline-block; + text-align: center; + overflow-wrap: break-word; + } + textarea, input:not([type="submit"]) { border: 1px solid $gray-600; From e3efdeb625f0ff0e1fe6faa58765c6302daf9e1c Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Fri, 1 Jul 2022 20:12:15 +0100 Subject: [PATCH 03/10] Elements: Buttons: Style the cursor for all button elements --- packages/block-editor/src/elements/style.scss | 3 +++ packages/block-editor/src/style.scss | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 packages/block-editor/src/elements/style.scss diff --git a/packages/block-editor/src/elements/style.scss b/packages/block-editor/src/elements/style.scss new file mode 100644 index 0000000000000..d498e5193818f --- /dev/null +++ b/packages/block-editor/src/elements/style.scss @@ -0,0 +1,3 @@ +.wp-element-button { + cursor: pointer; +} diff --git a/packages/block-editor/src/style.scss b/packages/block-editor/src/style.scss index 6295015ca6387..2f8f00c6e8541 100644 --- a/packages/block-editor/src/style.scss +++ b/packages/block-editor/src/style.scss @@ -64,4 +64,6 @@ @import "./components/inserter/style.scss"; @import "./components/preview-options/style.scss"; +@import "./elements/style.scss"; + @include wordpress-admin-schemes(); From 64b2a8ea52fbdd62b55494333713e91ee0104e5e Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Fri, 1 Jul 2022 20:24:25 +0100 Subject: [PATCH 04/10] move to block library --- packages/block-editor/src/style.scss | 2 -- packages/block-library/src/common.scss | 2 ++ .../elements/style.scss => block-library/src/elements.scss} | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) rename packages/{block-editor/src/elements/style.scss => block-library/src/elements.scss} (60%) diff --git a/packages/block-editor/src/style.scss b/packages/block-editor/src/style.scss index 2f8f00c6e8541..6295015ca6387 100644 --- a/packages/block-editor/src/style.scss +++ b/packages/block-editor/src/style.scss @@ -64,6 +64,4 @@ @import "./components/inserter/style.scss"; @import "./components/preview-options/style.scss"; -@import "./elements/style.scss"; - @include wordpress-admin-schemes(); diff --git a/packages/block-library/src/common.scss b/packages/block-library/src/common.scss index 5819a43c93ed5..b39bffb3b7885 100644 --- a/packages/block-library/src/common.scss +++ b/packages/block-library/src/common.scss @@ -152,3 +152,5 @@ html :where(img[class*="wp-image-"]) { height: auto; max-width: 100%; } + +@import "./elements.scss"; diff --git a/packages/block-editor/src/elements/style.scss b/packages/block-library/src/elements.scss similarity index 60% rename from packages/block-editor/src/elements/style.scss rename to packages/block-library/src/elements.scss index d498e5193818f..520ca7b7dd82a 100644 --- a/packages/block-editor/src/elements/style.scss +++ b/packages/block-library/src/elements.scss @@ -1,3 +1,6 @@ +/** + * Element styles. + */ .wp-element-button { cursor: pointer; } From 58e05e7d7764ab9b89a3abc4200ab3295d5cb64a Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Fri, 1 Jul 2022 20:26:26 +0100 Subject: [PATCH 05/10] move to style.scss --- packages/block-library/src/common.scss | 2 -- packages/block-library/src/style.scss | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/block-library/src/common.scss b/packages/block-library/src/common.scss index b39bffb3b7885..5819a43c93ed5 100644 --- a/packages/block-library/src/common.scss +++ b/packages/block-library/src/common.scss @@ -152,5 +152,3 @@ html :where(img[class*="wp-image-"]) { height: auto; max-width: 100%; } - -@import "./elements.scss"; diff --git a/packages/block-library/src/style.scss b/packages/block-library/src/style.scss index 05338e7cef18e..c7013a739933a 100644 --- a/packages/block-library/src/style.scss +++ b/packages/block-library/src/style.scss @@ -50,3 +50,4 @@ @import "./video/style.scss"; @import "common.scss"; +@import "./elements.scss"; From 49445d2f1d9b591576bcbe9420005c1fa3744798 Mon Sep 17 00:00:00 2001 From: Matias Benedetto Date: Mon, 4 Jul 2022 18:02:13 +0200 Subject: [PATCH 06/10] Element styles: Load them in the common.scss file instead of the style.scss file to make them available on the frontend. --- packages/block-library/src/common.scss | 2 ++ packages/block-library/src/style.scss | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/common.scss b/packages/block-library/src/common.scss index 5819a43c93ed5..59baf59b53d74 100644 --- a/packages/block-library/src/common.scss +++ b/packages/block-library/src/common.scss @@ -1,3 +1,5 @@ +@import "./elements.scss"; + // The following selectors have increased specificity (using the :root prefix) // to assure colors take effect over another base class color, mainly to let // the colors override the added specificity by link states such as :hover. diff --git a/packages/block-library/src/style.scss b/packages/block-library/src/style.scss index c7013a739933a..05338e7cef18e 100644 --- a/packages/block-library/src/style.scss +++ b/packages/block-library/src/style.scss @@ -50,4 +50,3 @@ @import "./video/style.scss"; @import "common.scss"; -@import "./elements.scss"; From 138b1648e22010c332e99b8738002f8e69fc7c30 Mon Sep 17 00:00:00 2001 From: Matias Benedetto Date: Mon, 4 Jul 2022 20:07:50 +0200 Subject: [PATCH 07/10] Removing elements.scss from style.scss --- packages/block-library/src/style.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/block-library/src/style.scss b/packages/block-library/src/style.scss index c7013a739933a..05338e7cef18e 100644 --- a/packages/block-library/src/style.scss +++ b/packages/block-library/src/style.scss @@ -50,4 +50,3 @@ @import "./video/style.scss"; @import "common.scss"; -@import "./elements.scss"; From aeef36faf3ef94dd7d08746e5038fe927685780b Mon Sep 17 00:00:00 2001 From: Matias Benedetto Date: Tue, 5 Jul 2022 19:27:57 +0200 Subject: [PATCH 08/10] core/post-comments-form: removing unneeded class from submit button to avoid unwanted styles --- packages/block-library/src/post-comments-form/form.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/block-library/src/post-comments-form/form.js b/packages/block-library/src/post-comments-form/form.js index 48a38d8e8a562..3eee101a117b4 100644 --- a/packages/block-library/src/post-comments-form/form.js +++ b/packages/block-library/src/post-comments-form/form.js @@ -34,7 +34,6 @@ const CommentsForm = () => { name="submit" type="submit" className={ classnames( - 'submit', 'wp-block-button__link', __experimentalGetElementClassName( 'button' ) ) } From 7457a0f849403475a343ff06e331a70a6a73bd95 Mon Sep 17 00:00:00 2001 From: Matias Benedetto Date: Tue, 5 Jul 2022 19:33:36 +0200 Subject: [PATCH 09/10] default theme.json button element settings: adding border 0. --- lib/compat/wordpress-6.1/theme.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/compat/wordpress-6.1/theme.json b/lib/compat/wordpress-6.1/theme.json index 928758be88e12..4ef52c7cc23b7 100644 --- a/lib/compat/wordpress-6.1/theme.json +++ b/lib/compat/wordpress-6.1/theme.json @@ -262,6 +262,9 @@ "fontFamily": "inherit", "lineHeight": "inherit", "textDecoration": "none" + }, + "border": { + "width": "0" } }, "link": { From 4912608ee39daeb16739448746f907e61b94e5ed Mon Sep 17 00:00:00 2001 From: Matias Benedetto Date: Fri, 15 Jul 2022 13:30:07 +0200 Subject: [PATCH 10/10] post comments form server side rendering: removing the 'submit' css class --- packages/block-library/src/post-comments-form/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/post-comments-form/index.php b/packages/block-library/src/post-comments-form/index.php index 09183c9f479a1..40dad1a530495 100644 --- a/packages/block-library/src/post-comments-form/index.php +++ b/packages/block-library/src/post-comments-form/index.php @@ -72,7 +72,7 @@ function register_block_core_post_comments_form() { */ function post_comments_form_block_form_defaults( $fields ) { if ( wp_is_block_theme() ) { - $fields['submit_button'] = ''; + $fields['submit_button'] = ''; $fields['submit_field'] = '

%1$s %2$s

'; }