aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar maTh <math-home@web.de> 2022-10-03 17:07:15 +0200
committerGravatar GitHub <noreply@github.com> 2022-10-03 17:07:15 +0200
commit117b9c115d3fb421820fbef44e39ac4328f3c7c1 (patch)
treeb76cb24567ddcf26e2788ecfaa1875302718625c
parent60e723435e2d1b1b06b355b2e67c5975825c7cc7 (diff)
Improved: Article summary. Cut the text with better CSS (#4666)
* phtml + css * trim the white spaces that comes from stripping
-rw-r--r--app/views/helpers/index/normal/entry_header.phtml4
-rw-r--r--p/themes/base-theme/frss.css7
-rw-r--r--p/themes/base-theme/frss.rtl.css7
3 files changed, 9 insertions, 9 deletions
diff --git a/app/views/helpers/index/normal/entry_header.phtml b/app/views/helpers/index/normal/entry_header.phtml
index 6968bae85..38d81f5c9 100644
--- a/app/views/helpers/index/normal/entry_header.phtml
+++ b/app/views/helpers/index/normal/entry_header.phtml
@@ -62,9 +62,7 @@
?></span><?php
endif;
if ($topline_summary):
- ?><div class="summary">
- <?= mb_substr(strip_tags($this->entry->content()), 0, 500, 'UTF-8') ?>
- </div><?php
+ ?><div class="summary"><?= trim(mb_substr(strip_tags($this->entry->content()), 0, 500, 'UTF-8')) ?></div><?php
endif;
?></a></li>
<?php if ($topline_date) { ?><li class="item date"><time datetime="<?= $this->entry->machineReadableDate() ?>"><?= $this->entry->date() ?></time>&nbsp;</li><?php } ?>
diff --git a/p/themes/base-theme/frss.css b/p/themes/base-theme/frss.css
index 879dcdd2c..46fffb826 100644
--- a/p/themes/base-theme/frss.css
+++ b/p/themes/base-theme/frss.css
@@ -1204,13 +1204,14 @@ a.website:hover .favicon {
}
.flux .item.title .summary {
- max-height: 3em;
+ display: -webkit-box;
color: var(--frss-font-color-grey-dark);
font-size: 0.9rem;
font-weight: normal;
- white-space: initial;
- overflow: hidden;
text-overflow: ellipsis;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ white-space: break-spaces;
}
.flux .item.title .author {
diff --git a/p/themes/base-theme/frss.rtl.css b/p/themes/base-theme/frss.rtl.css
index 4486e7745..4d731e6f7 100644
--- a/p/themes/base-theme/frss.rtl.css
+++ b/p/themes/base-theme/frss.rtl.css
@@ -1204,13 +1204,14 @@ a.website:hover .favicon {
}
.flux .item.title .summary {
- max-height: 3em;
+ display: -webkit-box;
color: var(--frss-font-color-grey-dark);
font-size: 0.9rem;
font-weight: normal;
- white-space: initial;
- overflow: hidden;
text-overflow: ellipsis;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ white-space: break-spaces;
}
.flux .item.title .author {