add title ellipsis over two lines to miniatures

This commit is contained in:
Rigel Kent 2018-09-02 23:36:22 +02:00 committed by Chocobozzz
parent 8542dc33e3
commit 769ac6c11f
4 changed files with 38 additions and 6 deletions

View File

@ -14,7 +14,7 @@
position: fixed;
top: 0;
width: 100%;
background-color: #fff;
background-color: $bg-color;
z-index: 1000;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
display: flex;

View File

@ -14,14 +14,17 @@
line-height: normal;
.video-miniature-name {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@include ellipsis-multiline(
$font-size: 1rem,
$line-height: 1,
$lines-to-show: 2
);
transition: color 0.2s;
font-size: 16px;
font-weight: $font-semibold;
color: #000;
color: $fg-color;
margin-top: 5px;
margin-bottom: 5px;
&:hover {
text-decoration: none;

View File

@ -16,6 +16,33 @@
}
}
/**
* This mixin will crop text in block for needed amount of lines and put ellipsis at the end
*
* @param $font-size font-size property
* @param $line-height line-height property
* @param $lines-to-show amount of lines to show
*/
@mixin ellipsis-multiline($font-size: 1rem, $line-height: 1, $lines-to-show: 2) {
display: block;
/* Fallback for non-webkit */
display: -webkit-box;
max-height: $font-size*$line-height*$lines-to-show;
/* Fallback for non-webkit */
font-size: $font-size;
line-height: $line-height;
-webkit-line-clamp: $lines-to-show;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
@mixin prefix($property, $parameters...) {
@each $prefix in -webkit-, -moz-, -ms-, -o-, "" {
#{$prefix}#{$property}: $parameters;
}
}
@mixin peertube-word-wrap {
word-break: normal;
word-wrap: break-word;

View File

@ -10,6 +10,8 @@ $orange-hoover-color: #F97D46;
$black-background: #000;
$grey-background: #f6f2f2;
$bg-color: #fff;
$fg-color: #000;
$red: #FF0000;
$green: #39CC0B;