From d67a7a20951589461812ad9079889293898aa0af Mon Sep 17 00:00:00 2001 From: Max Turer Date: Thu, 7 Mar 2024 19:19:20 +0000 Subject: [PATCH] text line limits and centering in recent documents --- .../scholarspace/components/_homepage.scss | 57 +++++++++++++++---- .../hyrax/homepage/_recent_document.html.erb | 16 ++++-- 2 files changed, 56 insertions(+), 17 deletions(-) diff --git a/app/assets/stylesheets/scholarspace/components/_homepage.scss b/app/assets/stylesheets/scholarspace/components/_homepage.scss index 617067a3..98b240b5 100644 --- a/app/assets/stylesheets/scholarspace/components/_homepage.scss +++ b/app/assets/stylesheets/scholarspace/components/_homepage.scss @@ -201,18 +201,18 @@ height: 100%; #recent_docs { - height: 100%; display: flex; flex-direction: row; justify-content: space-between; - align-items: center; + align-items: baseline; + padding-top: 0.5em; .recent-work { width: 12vw; margin: 0.5em 0.5em; display: flex; align-items: baseline; - height: 18.5vw; + min-height: 18.5vw; .image-wrapper { position: relative; @@ -258,18 +258,49 @@ align-items: center; justify-content: center; background-color: $gw-light-blue; - - h3 { - font-size: 1em; - text-decoration: underline; - &:hover { - color: $gw-hover-buff; + .title-wrapper { + -webkit-box-orient: vertical; + display: -webkit-box; + -webkit-line-clamp: 4; + padding: 0 1em; + overflow: hidden; + max-width: 100%; + text-align: center; + + h3 { + font-size: 1em; + text-decoration: underline; + --max-lines: 4; + --line-height: 1.2; + max-height: calc(var(--max-lines) * 1em * var(--line-height)); + line-height: var(--line-height); + position: relative; + + &:hover { + color: $gw-hover-buff; + } } } } } + .keyword-wrapper { + -webkit-box-orient: vertical; + display: -webkit-box; + -webkit-line-clamp: 2; + overflow: hidden; + max-width: 100%; + + .recent-field { + --max-lines: 2; + --line-height: 1.4; + height: calc(var(--max-lines) * 1em * var(--line-height)); + line-height: var(--line-height); + position: relative; + } + } + @media (max-width: 1300px) { width: 14vw; @@ -305,10 +336,14 @@ @media (max-width: $mobile-max) { flex-direction: column; + width: 80%; + align-items: center; .recent-work { - width: 100%; margin: 2em 0; + display: flex; + flex-direction: column; + align-items: center; .image-wrapper { height: 90.5vw; @@ -453,4 +488,4 @@ } } } -} \ No newline at end of file +} diff --git a/app/views/hyrax/homepage/_recent_document.html.erb b/app/views/hyrax/homepage/_recent_document.html.erb index a3cff852..24dae681 100644 --- a/app/views/hyrax/homepage/_recent_document.html.erb +++ b/app/views/hyrax/homepage/_recent_document.html.erb @@ -7,14 +7,18 @@ <%= render_thumbnail_tag(recent_document, {alt: "#{recent_document} #{ t('hyrax.homepage.admin_sets.thumbnail')}" }, {suppress_link: true}) %>
-

- <%= recent_document %> -

+
+

+ <%= recent_document %> +

+
<% end %> -

- <%= t('hyrax.homepage.recently_uploaded.document.keyword_label') %>: <%= link_to_facet_list(recent_document.keyword, 'keyword', t('hyrax.homepage.recently_uploaded.document.keyword_missing')).html_safe %> -

+
+

+ <%= t('hyrax.homepage.recently_uploaded.document.keyword_label') %>: <%= link_to_facet_list(recent_document.keyword, 'keyword', t('hyrax.homepage.recently_uploaded.document.keyword_missing')).html_safe %> +

+