Skip to content

Commit

Permalink
Merge pull request #6 from butugruv/mod-1
Browse files Browse the repository at this point in the history
added truncating styling and applied to title and text elements
  • Loading branch information
Yng808 authored Jan 26, 2024
2 parents 2d02094 + 34cc1cd commit 6a14bb1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/webparts/betterHero/BetterHeroWebPart.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@
}
*/


.textTruncate {
/* Truncate the text on the title or text of the card */
display: -webkit-box;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
}

.cardHideOverflow {
/* Hide overflow to keep the zoom within the card */
Expand Down
4 changes: 2 additions & 2 deletions src/webparts/betterHero/BetterHeroWebPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ export default class BetterHeroWebPart extends BaseClientSideWebPart<IBetterHero
<div class="card bg-dark text-white" style="overflow: hidden;">
<img src="${imageInfo.image}" class="card-img ${styles.leaderPhoto}" alt="${imageInfo.title}">
<div class="card-img-overlay ${styles.cardImgOverlay}">
<h5 class="card-title">${imageInfo.title}</h5>
<p class="card-text">${imageInfo.subtitle || ''}</p>
<h5 class="card-title ${styles.textTruncate}">${imageInfo.title}</h5>
<p class="card-text ${styles.textTruncate}">${imageInfo.subtitle || ''}</p>
</div>
</div>
</a>
Expand Down

0 comments on commit 6a14bb1

Please sign in to comment.