diff --git a/core/modules/comment/js/comment-new-indicator.js b/core/modules/comment/js/comment-new-indicator.js index 8a2bf07..7567963 100644 --- a/core/modules/comment/js/comment-new-indicator.js +++ b/core/modules/comment/js/comment-new-indicator.js @@ -65,7 +65,7 @@ var $comment = $(placeholder) .removeClass('hidden') .text(newCommentString) - .closest('.comment') + .closest('.js-comment') // Add 'new' class to the comment, so it can be styled. .addClass('new'); diff --git a/core/modules/comment/templates/comment.html.twig b/core/modules/comment/templates/comment.html.twig index 31b82e2..14c52eb 100644 --- a/core/modules/comment/templates/comment.html.twig +++ b/core/modules/comment/templates/comment.html.twig @@ -67,32 +67,22 @@ */ #} - - {% if title %} - {{ title_prefix }} - {% endif %} - + {# - Hide the "new" indicator by default, let a piece of JavaScript ask - the server which comments are new for the user. Rendering the final - "new" indicator here would break the render cache. + Hide the "new" indicator by default, let a piece of JavaScript ask the + server which comments are new for the user. Rendering the final "new" + indicator here would break the render cache. #} - {% if title %} - {{ title }} - {{ title_suffix }} - {% endif %} - -
{{ user_picture }}

{{ submitted }}

{# - Indicate the semantic relationship between parent and child comments - for accessibility. The list is difficult to navigate in a screen - reader without this information. + Indicate the semantic relationship between parent and child comments for + accessibility. The list is difficult to navigate in a screen reader + without this information. #} {% if parent %}

{{ parent }}

@@ -102,9 +92,11 @@
- {{ content|without('links') }} + {% if title %} + {{ title_prefix }} + {{ title }} + {{ title_suffix }} + {% endif %} + {{ content }} - {% if content.links %} - {{ content.links }} - {% endif %} diff --git a/core/themes/bartik/css/components/comments.css b/core/themes/bartik/css/components/comments.css index 9f22c51..8515cd9 100644 --- a/core/themes/bartik/css/components/comments.css +++ b/core/themes/bartik/css/components/comments.css @@ -7,19 +7,23 @@ #content .comment-wrapper h2 { margin-bottom: 1em; } +#content .comment-wrapper h2.comment-form__title { + margin-bottom: 1em; +} .comment { - margin-bottom: 20px; + margin-bottom: 19px; + vertical-align: top; display: table; - vertical-align: top; } -.comment__attribution { - display: table-cell; +[dir="rtl"] .comment { + direction: rtl; +} + +.comment__meta { padding: 0 30px 0 0; /* LTR */ - vertical-align: top; - overflow: hidden; + font-size: 1.071em; } -[dir="rtl"] .comment__attribution { - float: right; +[dir="rtl"] .comment__meta { padding: 0 0 0 30px; } .comment__attribution img { @@ -32,32 +36,34 @@ .comment__author .username { white-space: nowrap; } -.comment__submitted__data { +.comment__author { margin: 4px 0; - font-size: 1.071em; line-height: 1.2; } .comment__time { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 0.786em; + margin-bottom: 4px; color: #68696b; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 0.733em; + line-height: 1.2; + } .comment__permalink { - font-size: 0.786em; + font-size: 0.733em; + line-height: 1.2; } .comment__content { - font-size: 0.929em; - line-height: 1.6; -} -.comment__text { - padding: 10px 25px; - border: 1px solid #d3d7d9; - display: table-cell; - vertical-align: top; position: relative; + display: table-cell; + padding: 10px 25px 10px 25px; + vertical-align: top; width: 100%; + border: 1px solid #d3d7d9; + font-size: 0.929em; + line-height: 1.6; } -.comment__text:before { + +.comment__content:before { content: ''; position: absolute; right: 100%; /* LTR */ @@ -66,13 +72,13 @@ border-right: 20px solid #d3d7d9; /* LTR */ border-bottom: 20px solid transparent; } -[dir="rtl"] .comment__text:before { +[dir="rtl"] .comment__content:before { right: auto; left: 100%; border-right: none; border-left: 20px solid #d3d7d9; } -.comment__text:after { +.comment__content:after { content: ''; position: absolute; right: 100%; /* LTR */ @@ -82,7 +88,7 @@ border-bottom: 20px solid transparent; margin-right: -1px; /* LTR */ } -[dir="rtl"] .comment__text:after { +[dir="rtl"] .comment__content:after { right: auto; left: 100%; border-right: none; @@ -90,6 +96,14 @@ margin-right: 0; margin-left: -1px; } +.comment__content h3 { + margin-top: 0.94em; + margin-bottom: 0.45em; + font-size: 1.171em; +} +.comment__content nav { + padding-top: 1px; +} .comment .indented { margin-left: 40px; /* LTR */ } @@ -97,13 +111,14 @@ margin-right: 40px; margin-left: 0; } -.comment ul.links { +.comment .links { padding: 0 0 0.25em 0; } -.comment ul.links li { +.comment .links li { padding: 0 0.5em 0 0; /* LTR */ + font-size: 1.08em; } -[dir="rtl"] .comment ul.links li { +[dir="rtl"] .comment .links li { padding: 0 0 0 0.5em; } .comment--unpublished { @@ -116,14 +131,11 @@ margin-right: 0; padding: 5px 5px 5px 2px; } -.comment-footer { - display: table-row; -} -.comment--unpublished .comment__text:after, -.node--unpublished .comment__text:after { +.comment--unpublished .comment__content:after, +.node--unpublished .comment__content:after { border-right-color: #fff4f4; /* LTR */ } -[dir="rtl"] .comment--unpublished .comment__text:after, -[dir="rtl"] .node--unpublished .comment__text:after { +[dir="rtl"] .comment--unpublished .comment__content:after, +[dir="rtl"] .node--unpublished .comment__content:after { border-left-color: #fff4f4; } diff --git a/core/themes/bartik/templates/comment.html.twig b/core/themes/bartik/templates/comment.html.twig index 2dac831..8927db4 100644 --- a/core/themes/bartik/templates/comment.html.twig +++ b/core/themes/bartik/templates/comment.html.twig @@ -70,6 +70,7 @@ {% set classes = [ 'comment', + 'js-comment', status != 'published' ? 'comment--' ~ status, comment.owner.anonymous ? 'by-anonymous', author_id and author_id == commented_entity.getOwnerId() ? 'by-' ~ commented_entity.getEntityTypeId() ~ '-author', @@ -77,43 +78,37 @@ ] %}
-
-
- {{ user_picture }} - -
-
-
+ {# + Hide the "new" indicator by default, let a piece of JavaScript ask the + server which comments are new for the user. Rendering the final "new" + indicator here would break the render cache. + #} + + +
+ {{ user_picture }} +

{{ author }}

+

{{ created }}

+ {# - Hide the "new" indicator by default, let a piece of JavaScript ask - the server which comments are new for the user. Rendering the final - "new" indicator here would break the render cache. + Indicate the semantic relationship between parent and child comments + for accessibility. The list is difficult to navigate in a screen + reader without this information. #} - + {% if parent %} +

{{ parent }}

+ {% endif %} +
+ + {% if title %} {{ title_prefix }} - {{ title }} + {{ title }} {{ title_suffix }} {% endif %} - - {{ content|without('links') }} -
-
- {% if content.links %} - - {% endif %} -
+ {{ content|without('links') }} + {% if content.links %} + + {% endif %}
diff --git a/core/themes/classy/templates/content/comment.html.twig b/core/themes/classy/templates/content/comment.html.twig index bb06364..25e7d37 100644 --- a/core/themes/classy/templates/content/comment.html.twig +++ b/core/themes/classy/templates/content/comment.html.twig @@ -70,38 +70,28 @@ {% set classes = [ 'comment', + 'js-comment', status != 'published' ? status, comment.owner.anonymous ? 'by-anonymous', author_id and author_id == commented_entity.getOwnerId() ? 'by-' ~ commented_entity.getEntityTypeId() ~ '-author', - 'clearfix', ] %} - {% if title %} - {{ title_prefix }} - {% endif %} - {# - Hide the "new" indicator by default, let a piece of JavaScript ask - the server which comments are new for the user. Rendering the final - "new" indicator here would break the render cache. + Hide the "new" indicator by default, let a piece of JavaScript ask the + server which comments are new for the user. Rendering the final "new" + indicator here would break the render cache. #} - {% if title %} - {{ title }} - {{ title_suffix }} - {% endif %} - - -