From 49a438f4ec6f188db2a4a7024f5d3d3cf4de811b Mon Sep 17 00:00:00 2001 From: Ben Halpern Date: Tue, 12 May 2020 12:42:49 -0400 Subject: [PATCH] [deploy] Adjust overflow in comments and revert inline css (#7799) * Adjust overflow in comments and revert inline css * Fix color --- .../stylesheets/components/comments.scss | 19 +++++++++++++++-- .../stylesheets/components/stories.scss | 3 ++- .../__snapshots__/Article.test.jsx.snap | 6 ++++++ .../articles/components/CommentListItem.jsx | 1 + .../__snapshots__/CommentsList.test.jsx.snap | 21 +++++++++++++++++++ app/views/articles/index.html.erb | 8 ------- 6 files changed, 47 insertions(+), 11 deletions(-) diff --git a/app/assets/stylesheets/components/comments.scss b/app/assets/stylesheets/components/comments.scss index c3b4d9c3b..286293d49 100644 --- a/app/assets/stylesheets/components/comments.scss +++ b/app/assets/stylesheets/components/comments.scss @@ -16,19 +16,34 @@ &__body { margin-top: calc(var(--su-1) * -1); padding-left: var(--su-7); + padding-bottom: var(--su-2); + max-height:330px; + overflow: hidden; a:hover { text-decoration: underline; //todo: default for all in-content links } - p { + p, div.highlight { + margin: 6px auto; + } + + * { display: -webkit-box; - -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; + max-width: 100%; + width: auto; + object-fit: contain; } } + &__footer { + box-shadow: 0px 0px var(--su-2) var(--su-2) var(--story-comments-bg); + z-index: 5; + position: relative; + } + & + & { margin-top: var(--su-4); } diff --git a/app/assets/stylesheets/components/stories.scss b/app/assets/stylesheets/components/stories.scss index e56e4c4db..fc3aa5b21 100644 --- a/app/assets/stylesheets/components/stories.scss +++ b/app/assets/stylesheets/components/stories.scss @@ -174,7 +174,8 @@ &__actions { padding-left: calc(var(--su-6) + var(--su-4)); - padding-top: var(--su-4); + z-index: 6; + position:relative; } } diff --git a/app/javascript/articles/__tests__/__snapshots__/Article.test.jsx.snap b/app/javascript/articles/__tests__/__snapshots__/Article.test.jsx.snap index d5fa32116..4363122b4 100644 --- a/app/javascript/articles/__tests__/__snapshots__/Article.test.jsx.snap +++ b/app/javascript/articles/__tests__/__snapshots__/Article.test.jsx.snap @@ -1285,6 +1285,9 @@ exports[`
component should render as saved on reading list 1`] = ` } } /> +
component should render with comments 1`] = ` } } /> +
( // eslint-disable-next-line react/no-danger dangerouslySetInnerHTML={{ __html: comment.safe_processed_html }} /> +
); diff --git a/app/javascript/articles/components/__tests__/__snapshots__/CommentsList.test.jsx.snap b/app/javascript/articles/components/__tests__/__snapshots__/CommentsList.test.jsx.snap index 1ef63bd14..260c60832 100644 --- a/app/javascript/articles/components/__tests__/__snapshots__/CommentsList.test.jsx.snap +++ b/app/javascript/articles/components/__tests__/__snapshots__/CommentsList.test.jsx.snap @@ -46,6 +46,9 @@ exports[` should not render "See all comments" button when there } } /> +
should not render "See all comments" button when there } } /> +
`; @@ -139,6 +145,9 @@ exports[` should not render "See all comments" button when there } } /> +
`; @@ -193,6 +202,9 @@ exports[` should render "See all comments" button when there are } } /> +
should render "See all comments" button when there are } } /> +
should render comments 1`] = ` } } /> +
should render comments 1`] = ` } } /> +
<% end %> -<% cache "included-crayons_#{ApplicationConfig['HEROKU_SLUG_COMMIT']}", expires_in: 8.hours do %> - <%# This is a temporary inclusion of crayons on the page while new styles may not be included in shell %> - <%# provides redundency to make sure new styles are included during major transition %> - -<% end %> <%= javascript_packs_with_chunks_tag "homePage", defer: true %> <% cache(cache_key_heroku_slug("main-stories-index-#{params}-#{user_signed_in?}"), expires_in: 90.seconds) do %>