From f04de4b42f5646f18ee0623f925b34dedde46adf Mon Sep 17 00:00:00 2001 From: Laurel Date: Thu, 18 May 2023 18:13:23 -0700 Subject: [PATCH] feat: initial pass at comments styles (#27) --- parts/comments.html | 18 +++++--- src/scss/_gutenberg-shim.scss | 30 ++++++++++++++ src/scss/blocks/_blocks.scss | 1 + src/scss/blocks/_post_comments.scss | 58 ++++++++++++++++++++++++++ theme.json | 64 ++++++++++++++++++++++++++++- 5 files changed, 164 insertions(+), 7 deletions(-) create mode 100644 src/scss/blocks/_post_comments.scss diff --git a/parts/comments.html b/parts/comments.html index ee3e57ad..8cef994e 100644 --- a/parts/comments.html +++ b/parts/comments.html @@ -1,10 +1,11 @@
- - -
-
+ + +
+
+
@@ -20,10 +21,11 @@
+
- + @@ -31,5 +33,9 @@ + + + +
- \ No newline at end of file + diff --git a/src/scss/_gutenberg-shim.scss b/src/scss/_gutenberg-shim.scss index 39484068..f50c7c98 100644 --- a/src/scss/_gutenberg-shim.scss +++ b/src/scss/_gutenberg-shim.scss @@ -38,3 +38,33 @@ a { .has-text-color a { color: inherit; } + +/* + * Form Styles + * https://github.com/WordPress/gutenberg/issues/34198 + */ +label { + color: var(--wp--preset--color--contrast); + display: inline-block; + margin-bottom: calc( var(--wp--preset--spacing--20) / 2 ) 0; +} + +input[type='text'], +input[type='email'], +input[type='url'], +input[type='password'], +input[type='search'], +input[type='number'], +input[type='tel'], +input[type='range'], +input[type='date'], +input[type='month'], +input[type='week'], +input[type='time'], +input[type='datetime'], +input[type='datetime-local'], +input[type='zip'], +input[type='color'], +textarea { + border-radius: 6px; +} diff --git a/src/scss/blocks/_blocks.scss b/src/scss/blocks/_blocks.scss index 0229bebc..92bc80b0 100644 --- a/src/scss/blocks/_blocks.scss +++ b/src/scss/blocks/_blocks.scss @@ -1,2 +1,3 @@ @import url( './_navigation.scss' ); @import url( './_post-author-name.scss' ); +@import url( './_post-comments.scss' ); diff --git a/src/scss/blocks/_post_comments.scss b/src/scss/blocks/_post_comments.scss new file mode 100644 index 00000000..b4883029 --- /dev/null +++ b/src/scss/blocks/_post_comments.scss @@ -0,0 +1,58 @@ +.wp-block-post-comments-form { + form { + display: flex; + flex-direction: column; + gap: var(--wp--preset--spacing--50); + margin-top: var(--wp--preset--spacing--50); + + p { + margin-top: 0; + margin-bottom: 0; + } + } + + p { + color: var( --wp--custom--color--gray-700 ); + font-size: var(--wp--preset--font-size--small); + + a { + color: inherit; + } + } + + .bypostauthor { // we probably don't want to inline text via CSS; can we filter the author post? + + } +} + +.wp-block-comment-template { + > li { + &:not(:first-of-type) { + padding-top: var(--wp--preset--spacing--50); + } + + &:not(:last-of-type) { + border-bottom: 1px solid var( --wp--custom--color--gray-300 ); + padding-bottom: var(--wp--preset--spacing--50); + } + } + + ol { + border-left: 1px solid var( --wp--custom--color--gray-300 ); + margin: var(--wp--preset--spacing--50) 0 0; + padding-left: var(--wp--preset--spacing--50); + } +} + +.wp-block-comments-pagination-numbers { + a, + span { + border-radius: 6px; + padding: 0.5rem 0.8rem; + } + + .current { + background: var(--wp--preset--color--primary); + color: var(--wp--preset--color--base); + } +} diff --git a/theme.json b/theme.json index 9db1d651..5abf1cce 100644 --- a/theme.json +++ b/theme.json @@ -216,21 +216,61 @@ } }, "core/comment-author-name": { + "elements": { + "link": { + "color": { + "text": "var( --wp--custom--color--gray-900 )" + }, + "typography": { + "textDecoration": "none" + } + } + }, "typography": { - "fontSize": "var(--wp--preset--font-size--small)" + "fontSize": "var(--wp--preset--font-size--medium)", + "fontWeight": "bold" } }, "core/comment-date": { + "elements": { + "link": { + "color": { + "text": "var( --wp--custom--color--gray-700 )" + }, + ":hover": { + "typography": { + "textDecoration": "underline" + } + }, + "typography": { + "textDecoration": "none" + } + } + }, "typography": { "fontSize": "var(--wp--preset--font-size--small)" } }, "core/comment-edit-link": { + "elements": { + "link": { + "color": { + "text": "var( --wp--custom--color--gray-700 )" + } + } + }, "typography": { "fontSize": "var(--wp--preset--font-size--small)" } }, "core/comment-reply-link": { + "elements": { + "link": { + "color": { + "text": "var( --wp--custom--color--gray-700 )" + } + } + }, "typography": { "fontSize": "var(--wp--preset--font-size--small)" } @@ -313,6 +353,28 @@ "fontSize": "var(--wp--preset--font-size--small)" } }, + "core/comments-pagination": { + "elements": { + "link": { + "color": { + "text": "var( --wp--preset--color--contrast )" + }, + ":hover": { + "typography": { + "textDecoration": "underline" + } + }, + "typography": { + "textDecoration": "none" + } + } + }, + "typography": { + "fontSize": "var(--wp--preset--font-size--small)" + } + }, + "core/comments-pagination-numbers": { + }, "core/post-date": { "color": { "text": "var(--wp--custom--color--gray-700)"