This repository was archived by the owner on Feb 29, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +12
-204
lines changed
components/DiscoveryStreamComponents
test/unit/content-src/lib Expand file tree Collapse file tree 9 files changed +12
-204
lines changed Original file line number Diff line number Diff line change 11import { actionCreators as ac } from "common/Actions.jsm" ;
2- import { clampTotalLines } from "content-src/lib/clamp-total-lines" ;
32import { DSImage } from "../DSImage/DSImage.jsx" ;
43import { DSLinkMenu } from "../DSLinkMenu/DSLinkMenu" ;
54import { ImpressionStats } from "../../DiscoveryStreamImpressionStats/ImpressionStats" ;
@@ -41,11 +40,9 @@ export class DSCard extends React.PureComponent {
4140 < DSImage extraClassNames = "img" source = { this . props . image_src } rawSource = { this . props . raw_image_src } />
4241 </ div >
4342 < div className = "meta" >
44- < div className = "info-wrap"
45- data-total-lines = "7"
46- ref = { clampTotalLines } >
47- < p className = "source clamp" data-clamp = "1" > { this . props . source } </ p >
48- < header className = "title clamp" data-clamp = "4" > { this . props . title } </ header >
43+ < div className = "info-wrap" >
44+ < p className = "source clamp" > { this . props . source } </ p >
45+ < header className = "title clamp" > { this . props . title } </ header >
4946 { this . props . excerpt && < p className = "excerpt clamp" > { this . props . excerpt } </ p > }
5047 </ div >
5148 { this . props . context && (
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ $excerpt-line-height: 20;
101101 }
102102
103103 .source {
104+ -webkit-line-clamp : 1 ;
104105 margin-bottom : 2px ;
105106 }
106107
Original file line number Diff line number Diff line change 11import { DSCard , PlaceholderDSCard } from "../DSCard/DSCard.jsx" ;
22import { actionCreators as ac } from "common/Actions.jsm" ;
3- import { clampTotalLines } from "content-src/lib/clamp-total-lines" ;
43import { DSEmptyState } from "../DSEmptyState/DSEmptyState.jsx" ;
54import { DSImage } from "../DSImage/DSImage.jsx" ;
65import { DSLinkMenu } from "../DSLinkMenu/DSLinkMenu" ;
@@ -77,15 +76,13 @@ export class Hero extends React.PureComponent {
7776 < DSImage extraClassNames = "img" source = { heroRec . image_src } rawSource = { heroRec . raw_image_src } />
7877 </ div >
7978 < div className = "meta" >
80- < div className = "header-and-excerpt"
81- data-total-lines = "7"
82- ref = { clampTotalLines } >
79+ < div className = "header-and-excerpt" >
8380 { heroRec . context ? (
8481 < p className = "context" > { heroRec . context } </ p >
8582 ) : (
86- < p className = "source clamp" data-clamp = "1" > { heroRec . domain } </ p >
83+ < p className = "source clamp" > { heroRec . domain } </ p >
8784 ) }
88- < header className = "clamp" data-clamp = "4" > { heroRec . title } </ header >
85+ < header className = "clamp" > { heroRec . title } </ header >
8986 < p className = "excerpt clamp" > { heroRec . excerpt } </ p >
9087 </ div >
9188 </ div >
Original file line number Diff line number Diff line change @@ -147,6 +147,7 @@ $card-header-in-hero-line-height: 20;
147147
148148 font-size : 13px ;
149149 color : $grey-50 ;
150+ -webkit-line-clamp : 1 ;
150151 margin-bottom : 0 ;
151152 }
152153 }
Original file line number Diff line number Diff line change 11import { actionCreators as ac } from "common/Actions.jsm" ;
2- import { clampTotalLines } from "content-src/lib/clamp-total-lines" ;
32import { connect } from "react-redux" ;
43import { DSEmptyState } from "../DSEmptyState/DSEmptyState.jsx" ;
54import { DSImage } from "../DSImage/DSImage.jsx" ;
@@ -44,15 +43,14 @@ export class ListItem extends React.PureComponent {
4443 onLinkClick = { ! this . props . placeholder ? this . onLinkClick : undefined }
4544 url = { this . props . url } >
4645 < div className = "ds-list-item-text" >
47- < div data-total-lines = "4"
48- ref = { clampTotalLines } >
46+ < div >
4947 < div className = "ds-list-item-title clamp" > { this . props . title } </ div >
5048 { this . props . excerpt && < div className = "ds-list-item-excerpt clamp" > { this . props . excerpt } </ div > }
5149 </ div >
5250 < p >
5351 { this . props . context && (
5452 < span >
55- < span className = "ds-list-item-context" > { this . props . context } </ span >
53+ < span className = "ds-list-item-context clamp " > { this . props . context } </ span >
5654 < br />
5755 </ span >
5856 ) }
Original file line number Diff line number Diff line change @@ -228,7 +228,6 @@ $item-line-height: 20;
228228
229229 color : $grey-50 ;
230230 font-size : 13px ;
231- -webkit-line-clamp : 1 ;
232231 }
233232
234233 .ds-list-item-title {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 99}
1010
1111// Note: lineHeight and fontSize should be unitless but can be derived from pixel values
12- // Bug 1550624 to clean up / remove this mixin that no longer limits lines
12+ // Bug 1550624 to clean up / remove this mixin to avoid duplicate styles
1313@mixin limit-visibile-lines ($line-count , $line-height , $font-size ) {
1414 font-size : $font-size * 1px ;
15+ -webkit-line-clamp : $line-count ;
1516 line-height : $line-height * 1px ;
1617}
1718
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments