From ec1f33ca7d44059ea87516742b5f06ee87c9e8c0 Mon Sep 17 00:00:00 2001 From: MaggieCabrera Date: Fri, 10 Jun 2022 12:44:07 +0200 Subject: [PATCH 1/4] removed comments css and integrated comments block --- blockbase/assets/ponyfill.css | 137 ------------------ blockbase/block-templates/single.html | 38 ++++- blockbase/sass/blocks/_post-comments.scss | 163 ---------------------- blockbase/sass/ponyfill.scss | 1 - blockbase/theme.json | 30 ++++ 5 files changed, 67 insertions(+), 302 deletions(-) delete mode 100644 blockbase/sass/blocks/_post-comments.scss diff --git a/blockbase/assets/ponyfill.css b/blockbase/assets/ponyfill.css index 4d05f7e9d3..d734c3ab5e 100644 --- a/blockbase/assets/ponyfill.css +++ b/blockbase/assets/ponyfill.css @@ -619,143 +619,6 @@ p.has-drop-cap:not(:focus)::first-letter { font-weight: var(--wp--custom--post-author--font-weight); } -.wp-block-post-comments label, .wp-block-post-comments .comment-meta { - font-size: var(--wp--custom--form--label--typography--font-size); -} -.wp-block-post-comments .reply { - margin-top: var(--wp--custom--gap--vertical); - margin-bottom: 0; -} -.wp-block-post-comments .reply a { - display: inline-block; - text-decoration: underline; -} -.wp-block-post-comments .reply a:hover { - text-decoration: none; -} -.wp-block-post-comments form { - display: grid; - column-gap: 1em; - grid-template-rows: auto; - grid-template-areas: "misc misc" "notes notes" "author author" "email url" "comment comment" "cookies-consent cookies-consent" "form-submit form-submit"; -} -.wp-block-post-comments form input:not([type=submit]):not([type=checkbox]), -.wp-block-post-comments form textarea { - font-size: var(--wp--custom--font-sizes--normal); - background: var(--wp--custom--color--background); - border: var(--wp--custom--form--border--width) var(--wp--custom--form--border--style) var(--wp--custom--form--border--color); - width: 100%; -} -.wp-block-post-comments form textarea { - vertical-align: top; -} -.wp-block-post-comments form label:not([for=wp-comment-cookies-consent]) { - font-size: var(--wp--custom--form--label--typography--font-size); - font-weight: var(--wp--custom--form--label--typography--font-weight); - letter-spacing: var(--wp--custom--form--label--typography--letter-spacing); - margin-bottom: var(--wp--custom--form--label--spacing--margin--bottom); - text-transform: var(--wp--custom--form--label--typography--text-transform); -} -.wp-block-post-comments form p { - margin-top: 0; - margin-bottom: var(--wp--custom--gap--vertical); -} -.wp-block-post-comments form > * { - grid-area: misc; -} -.wp-block-post-comments form .comment-notes { - grid-area: notes; -} -.wp-block-post-comments form .comment-form-author { - grid-area: author; -} -.wp-block-post-comments form .comment-form-email { - grid-area: email; -} -.wp-block-post-comments form .comment-form-url { - grid-area: url; -} -.wp-block-post-comments form .comment-form-comment { - grid-area: comment; -} -.wp-block-post-comments form .comment-form-cookies-consent { - grid-area: cookies-consent; -} -.wp-block-post-comments form .form-submit { - grid-area: form-submit; -} -.wp-block-post-comments form .comment-form-cookies-consent input[type=checkbox] { - border: 0; - clip: rect(1px, 1px, 1px, 1px); - -webkit-clip-path: inset(50%); - clip-path: inset(50%); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute; - width: 1px; - word-wrap: normal !important; - margin-left: 0; -} -.wp-block-post-comments form .comment-form-cookies-consent input[type=checkbox] + label { - display: inline-block; - line-height: calc(var(--wp--custom--form--checkbox--unchecked--sizing--height) + 2 * var(--wp--custom--form--border--width)); - margin-left: 0; - padding-left: calc(var(--wp--custom--form--checkbox--unchecked--sizing--width) + var(--wp--custom--gap--baseline) / 1.5); - position: relative; -} -.wp-block-post-comments form .comment-form-cookies-consent input[type=checkbox] + label::before, .wp-block-post-comments form .comment-form-cookies-consent input[type=checkbox] + label::after { - box-sizing: border-box; -} -.wp-block-post-comments form .comment-form-cookies-consent input[type=checkbox] + ::before { - content: var(--wp--custom--form--checkbox--unchecked--content); - position: absolute; - top: var(--wp--custom--form--checkbox--unchecked--position--top); - left: var(--wp--custom--form--checkbox--unchecked--position--left); - width: var(--wp--custom--form--checkbox--unchecked--sizing--width); - height: var(--wp--custom--form--checkbox--unchecked--sizing--height); - border: var(--wp--custom--form--border--width) var(--wp--custom--form--border--style) var(--wp--custom--form--border--color); -} -.wp-block-post-comments form .comment-form-cookies-consent input[type=checkbox]:checked + ::after { - content: var(--wp--custom--form--checkbox--checked--content); - position: absolute; - top: var(--wp--custom--form--checkbox--checked--position--top); - left: var(--wp--custom--form--checkbox--checked--position--left); - width: var(--wp--custom--form--checkbox--checked--sizing--width); - height: var(--wp--custom--form--checkbox--checked--sizing--height); - font-size: var(--wp--custom--form--checkbox--checked--font-size); -} -.wp-block-post-comments form .comment-form-cookies-consent input[type=checkbox]:focus + ::before { - outline: 1px dotted currentColor; - outline-offset: 2px; -} -.wp-block-post-comments .comment-reply-title small { - float: right; - font-size: 14px; -} -.wp-block-post-comments .commentlist { - margin-bottom: calc(2 * var(--wp--style--block-gap)); -} -.wp-block-post-comments .commentlist .comment p { - font-size: var(--wp--custom--post-comment--typography--font-size); - line-height: var(--wp--custom--post-comment--typography--line-height); - margin-bottom: var(--wp--custom--gap--vertical); - margin-top: var(--wp--custom--gap--vertical); -} -.wp-block-post-comments .comment-body { - margin-bottom: calc(1.5 * var(--wp--style--block-gap)); -} -.wp-block-post-comments .commentmetadata { - margin-left: 0; - margin-bottom: calc(0.75 * var(--wp--style--block-gap)); -} -.wp-block-post-comments .comment-awaiting-moderation { - display: inline-block; - font-size: var(--wp--preset--font-size--small); - margin-bottom: var(--wp--custom--gap--baseline); -} - .wp-block-post-template { margin-top: 0; margin-bottom: 0; diff --git a/blockbase/block-templates/single.html b/blockbase/block-templates/single.html index 7a903a73e4..2398fb3b00 100644 --- a/blockbase/block-templates/single.html +++ b/blockbase/block-templates/single.html @@ -21,7 +21,43 @@ - + + +
+ + + +
+
+ + + +
+ + +
+ +
+ + + + +
+
+ + + + + + + + + + + +
+ + diff --git a/blockbase/sass/blocks/_post-comments.scss b/blockbase/sass/blocks/_post-comments.scss deleted file mode 100644 index b7c339cc5f..0000000000 --- a/blockbase/sass/blocks/_post-comments.scss +++ /dev/null @@ -1,163 +0,0 @@ -.wp-block-post-comments { - label, .comment-meta { - font-size: var(--wp--custom--form--label--typography--font-size); - } - - .reply { - margin-top: var(--wp--custom--gap--vertical); - margin-bottom: 0; - - a { - display: inline-block; - text-decoration: underline; - &:hover { - text-decoration: none; - } - } - } - - form { - display: grid; - column-gap: 1em; - grid-template-rows: auto; - grid-template-areas: - "misc misc" - "notes notes" - "author author" - "email url" - "comment comment" - "cookies-consent cookies-consent" - "form-submit form-submit"; - - input:not([type=submit]):not([type=checkbox]), - textarea { - font-size: var(--wp--custom--font-sizes--normal); - background: var(--wp--custom--color--background); - border: var(--wp--custom--form--border--width) var(--wp--custom--form--border--style) var(--wp--custom--form--border--color); - width: 100%; - } - - textarea { - vertical-align: top; - } - - label:not([for=wp-comment-cookies-consent]) { - font-size: var(--wp--custom--form--label--typography--font-size); - font-weight: var(--wp--custom--form--label--typography--font-weight); - letter-spacing: var(--wp--custom--form--label--typography--letter-spacing); - margin-bottom: var(--wp--custom--form--label--spacing--margin--bottom); - text-transform: var(--wp--custom--form--label--typography--text-transform); - } - - p { - margin-top: 0; - margin-bottom: var(--wp--custom--gap--vertical); - } - & > * { - grid-area: misc; - } - - .comment-notes { - grid-area: notes; - } - - .comment-form-author { - grid-area: author; - } - - .comment-form-email { - grid-area: email; - } - - .comment-form-url { - grid-area: url; - } - - .comment-form-comment { - grid-area: comment; - } - - .comment-form-cookies-consent { - grid-area: cookies-consent; - } - - .form-submit { - grid-area: form-submit; - } - - .comment-form-cookies-consent { - input[type="checkbox"] { - @include hide-accesibly; - margin-left: 0; - & + label { - display: inline-block; - line-height: calc( var(--wp--custom--form--checkbox--unchecked--sizing--height) + 2 * var(--wp--custom--form--border--width)); - margin-left: 0; - padding-left: calc( var(--wp--custom--form--checkbox--unchecked--sizing--width) + ( var(--wp--custom--gap--baseline) / 1.5 ) ); - position: relative; - } - & + label::before, - & + label::after { - box-sizing: border-box; - } - & + ::before { - content: var(--wp--custom--form--checkbox--unchecked--content); - position: absolute; - top: var(--wp--custom--form--checkbox--unchecked--position--top); - left: var(--wp--custom--form--checkbox--unchecked--position--left); - width: var(--wp--custom--form--checkbox--unchecked--sizing--width); - height: var(--wp--custom--form--checkbox--unchecked--sizing--height); - border: var(--wp--custom--form--border--width) var(--wp--custom--form--border--style) var(--wp--custom--form--border--color); - } - &:checked + ::after { - content: var(--wp--custom--form--checkbox--checked--content);; - position: absolute; - top: var(--wp--custom--form--checkbox--checked--position--top); - left: var(--wp--custom--form--checkbox--checked--position--left); - width: var(--wp--custom--form--checkbox--checked--sizing--width); - height: var(--wp--custom--form--checkbox--checked--sizing--height); - font-size: var(--wp--custom--form--checkbox--checked--font-size); - } - - &:focus + ::before { - outline: 1px dotted currentColor; - outline-offset: 2px; - } - } - } - } - - .comment-reply-title { - small { - float: right; - font-size: 14px; - } - } - - .commentlist { - margin-bottom: calc(2 * var(--wp--style--block-gap)); - .comment { - p { - font-size: var(--wp--custom--post-comment--typography--font-size); - line-height: var(--wp--custom--post-comment--typography--line-height); - margin-bottom: var(--wp--custom--gap--vertical); - margin-top: var(--wp--custom--gap--vertical); - } - } - } - - .comment-body { - margin-bottom: calc(1.5 * var( --wp--style--block-gap )); - } - - .commentmetadata { - margin-left: 0; - margin-bottom: calc(0.75 * var( --wp--style--block-gap )); - } - - .comment-awaiting-moderation { - display: inline-block; - font-size: var(--wp--preset--font-size--small); - margin-bottom: var(--wp--custom--gap--baseline); - } -} diff --git a/blockbase/sass/ponyfill.scss b/blockbase/sass/ponyfill.scss index 3e1863a2e3..d2d00f59b0 100644 --- a/blockbase/sass/ponyfill.scss +++ b/blockbase/sass/ponyfill.scss @@ -17,7 +17,6 @@ @import "blocks/navigation"; @import "blocks/paragraph"; @import "blocks/post-author"; -@import "blocks/post-comments"; @import "blocks/post-template"; @import "blocks/pullquote"; @import "blocks/query-pagination"; diff --git a/blockbase/theme.json b/blockbase/theme.json index 520fe57566..288164249f 100644 --- a/blockbase/theme.json +++ b/blockbase/theme.json @@ -433,6 +433,36 @@ "fontFamily": "monospace" } }, + "core/comment-author-name": { + "typography": { + "fontSize": "var(--wp--custom--font-sizes--x-small)" + } + }, + "core/comment-date": { + "typography": { + "fontSize": "var(--wp--custom--font-sizes--x-small)" + } + }, + "core/comment-edit-link": { + "typography": { + "fontSize": "var(--wp--custom--font-sizes--x-small)" + } + }, + "core/comment-reply-link": { + "color": { + "text": "var(--wp--custom--color--primary)" + }, + "typography": { + "fontSize": "var(--wp--custom--font-sizes--x-small)", + "textDecoration": "underline" + } + }, + "core/comment-content": { + "typography": { + "fontSize": "var(--wp--custom--post-comment--typography--font-size)", + "lineHeight": "var(--wp--custom--post-comment--typography--line-height)" + } + }, "core/gallery": { "spacing": { "margin": { From e18677635fe2eb7bc3f2136d0c1ecaf15347614f Mon Sep 17 00:00:00 2001 From: MaggieCabrera Date: Fri, 1 Jul 2022 16:56:22 +0200 Subject: [PATCH 2/4] fix git mess --- blockbase/assets/ponyfill.css | 13 +++++ blockbase/block-templates/page.html | 2 +- blockbase/block-templates/single.html | 37 +------------- blockbase/inc/patterns/comments.php | 61 +++++++++++++++++++++++ blockbase/sass/blocks/_post-comments.scss | 23 +++++++++ blockbase/sass/ponyfill.scss | 1 + blockbase/theme.json | 5 ++ 7 files changed, 105 insertions(+), 37 deletions(-) create mode 100644 blockbase/inc/patterns/comments.php create mode 100644 blockbase/sass/blocks/_post-comments.scss diff --git a/blockbase/assets/ponyfill.css b/blockbase/assets/ponyfill.css index d734c3ab5e..b534594369 100644 --- a/blockbase/assets/ponyfill.css +++ b/blockbase/assets/ponyfill.css @@ -619,6 +619,19 @@ p.has-drop-cap:not(:focus)::first-letter { font-weight: var(--wp--custom--post-author--font-weight); } +.wp-block-comments-query-loop form label { + font-size: var(--wp--custom--form--label--typography--font-size); + font-weight: var(--wp--custom--form--label--typography--font-weight); + letter-spacing: var(--wp--custom--form--label--typography--letter-spacing); +} +.wp-block-comments-query-loop form .comment-form-cookies-consent input[type=checkbox]#wp-comment-cookies-consent { + margin-left: 0; + margin-top: 1px; +} +.wp-block-comments-query-loop form .comment-form-cookies-consent input[type=checkbox]#wp-comment-cookies-consent + label { + margin-left: 0; +} + .wp-block-post-template { margin-top: 0; margin-bottom: 0; diff --git a/blockbase/block-templates/page.html b/blockbase/block-templates/page.html index c77fec86e7..25f17eff85 100644 --- a/blockbase/block-templates/page.html +++ b/blockbase/block-templates/page.html @@ -20,7 +20,7 @@ - + diff --git a/blockbase/block-templates/single.html b/blockbase/block-templates/single.html index 2398fb3b00..7d53a58e81 100644 --- a/blockbase/block-templates/single.html +++ b/blockbase/block-templates/single.html @@ -21,42 +21,7 @@ - - -
- - - -
-
- - - -
- - -
- -
- - - - -
-
- - - - - - - - - - - -
- + diff --git a/blockbase/inc/patterns/comments.php b/blockbase/inc/patterns/comments.php new file mode 100644 index 0000000000..0880ba8d3c --- /dev/null +++ b/blockbase/inc/patterns/comments.php @@ -0,0 +1,61 @@ + + +
+ + + + +
+ +
+ + + +
+ +
+ + + +
+ + + +
+ + + +
+ +
+ +
+ + + + + +
+ +
+ + + + + + + + + + + + +
+ \ No newline at end of file diff --git a/blockbase/sass/blocks/_post-comments.scss b/blockbase/sass/blocks/_post-comments.scss new file mode 100644 index 0000000000..6425ac55c5 --- /dev/null +++ b/blockbase/sass/blocks/_post-comments.scss @@ -0,0 +1,23 @@ +.wp-block-comments-query-loop { + + form { + + label { + font-size: var(--wp--custom--form--label--typography--font-size); + font-weight: var(--wp--custom--form--label--typography--font-weight); + letter-spacing: var(--wp--custom--form--label--typography--letter-spacing); + } + + .comment-form-cookies-consent { + + input[type="checkbox"]#wp-comment-cookies-consent { + margin-left: 0; + margin-top: 1px; + + & + label { + margin-left: 0; + } + } + } + } +} diff --git a/blockbase/sass/ponyfill.scss b/blockbase/sass/ponyfill.scss index d2d00f59b0..3e1863a2e3 100644 --- a/blockbase/sass/ponyfill.scss +++ b/blockbase/sass/ponyfill.scss @@ -17,6 +17,7 @@ @import "blocks/navigation"; @import "blocks/paragraph"; @import "blocks/post-author"; +@import "blocks/post-comments"; @import "blocks/post-template"; @import "blocks/pullquote"; @import "blocks/query-pagination"; diff --git a/blockbase/theme.json b/blockbase/theme.json index 288164249f..0b5224ae0e 100644 --- a/blockbase/theme.json +++ b/blockbase/theme.json @@ -457,6 +457,11 @@ "textDecoration": "underline" } }, + "core/comments-title": { + "typography": { + "fontSize": "var(--wp--preset--font-size--large)" + } + }, "core/comment-content": { "typography": { "fontSize": "var(--wp--custom--post-comment--typography--font-size)", From eecd0d0018a959dcdc17f0f340410cdcf8a21ceb Mon Sep 17 00:00:00 2001 From: MaggieCabrera Date: Fri, 1 Jul 2022 17:08:28 +0200 Subject: [PATCH 3/4] moved pattern folder --- blockbase/{inc => }/patterns/comments.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename blockbase/{inc => }/patterns/comments.php (100%) diff --git a/blockbase/inc/patterns/comments.php b/blockbase/patterns/comments.php similarity index 100% rename from blockbase/inc/patterns/comments.php rename to blockbase/patterns/comments.php From e1ae46da52e2c0167e8ebe1ffe9759c63f71f697 Mon Sep 17 00:00:00 2001 From: Jason Crist Date: Wed, 6 Jul 2022 15:03:55 -0400 Subject: [PATCH 4/4] Added missing '/' from comment pattern block usage --- blockbase/block-templates/page.html | 2 +- blockbase/block-templates/single.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/blockbase/block-templates/page.html b/blockbase/block-templates/page.html index 25f17eff85..018d28c5a3 100644 --- a/blockbase/block-templates/page.html +++ b/blockbase/block-templates/page.html @@ -20,7 +20,7 @@ - + diff --git a/blockbase/block-templates/single.html b/blockbase/block-templates/single.html index 7d53a58e81..bdfc729607 100644 --- a/blockbase/block-templates/single.html +++ b/blockbase/block-templates/single.html @@ -21,7 +21,7 @@ - +