diff --git a/core/modules/comment/js/comment-new-indicator.js b/core/modules/comment/js/comment-new-indicator.js index b15e67c..08ec258 100644 --- a/core/modules/comment/js/comment-new-indicator.js +++ b/core/modules/comment/js/comment-new-indicator.js @@ -61,7 +61,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..638b421 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,12 @@
- {{ 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..797d86b 100644 --- a/core/themes/bartik/css/components/comments.css +++ b/core/themes/bartik/css/components/comments.css @@ -12,14 +12,15 @@ display: table; vertical-align: top; } -.comment__attribution { - display: table-cell; +[dir="rtl"] .comment { + direction: rtl; +} + +.comment__meta { + font-size: 1.071em; padding: 0 30px 0 0; /* LTR */ - vertical-align: top; - overflow: hidden; } -[dir="rtl"] .comment__attribution { - float: right; +[dir="rtl"] .comment__meta { padding: 0 0 0 30px; } .comment__attribution img { @@ -29,27 +30,27 @@ .comment .field-name-user-picture img { margin: 0; } -.comment__author .username { +.comment__meta__author .username { white-space: nowrap; } -.comment__submitted__data { +.comment__meta__author { margin: 4px 0; - font-size: 1.071em; line-height: 1.2; } -.comment__time { +.comment__meta__time { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 0.786em; + font-size: 0.733em; + line-height: 1.2; color: #68696b; + margin-bottom: 4px; } -.comment__permalink { - font-size: 0.786em; +.comment__meta__permalink { + 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; @@ -57,7 +58,12 @@ position: relative; width: 100%; } -.comment__text:before { + +.comment__content h3 { + font-size: 1.175em; +} + +.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; @@ -97,10 +103,12 @@ margin-right: 40px; margin-left: 0; } -.comment ul.links { +.comment ul.links, +[dir="rtl"] .comment ul.links { padding: 0 0 0.25em 0; } .comment ul.links li { + font-size: 1.08em; padding: 0 0.5em 0 0; /* LTR */ } [dir="rtl"] .comment ul.links li { @@ -116,14 +124,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..989d7d9 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..f0d6505 100644 --- a/core/themes/classy/templates/content/comment.html.twig +++ b/core/themes/classy/templates/content/comment.html.twig @@ -70,6 +70,7 @@ {% 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', @@ -77,31 +78,21 @@ ] %} - {% 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 %} - - -