Skip to content
This repository was archived by the owner on Feb 29, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {actionCreators as ac} from "common/Actions.jsm";
import {clampTotalLines} from "content-src/lib/clamp-total-lines";
import {DSImage} from "../DSImage/DSImage.jsx";
import {DSLinkMenu} from "../DSLinkMenu/DSLinkMenu";
import {ImpressionStats} from "../../DiscoveryStreamImpressionStats/ImpressionStats";
Expand Down Expand Up @@ -41,11 +40,9 @@ export class DSCard extends React.PureComponent {
<DSImage extraClassNames="img" source={this.props.image_src} rawSource={this.props.raw_image_src} />
</div>
<div className="meta">
<div className="info-wrap"
data-total-lines="7"
ref={clampTotalLines}>
<p className="source clamp" data-clamp="1">{this.props.source}</p>
<header className="title clamp" data-clamp="4">{this.props.title}</header>
<div className="info-wrap">
<p className="source clamp">{this.props.source}</p>
<header className="title clamp">{this.props.title}</header>
{this.props.excerpt && <p className="excerpt clamp">{this.props.excerpt}</p>}
</div>
{this.props.context && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ $excerpt-line-height: 20;
}

.source {
-webkit-line-clamp: 1;
margin-bottom: 2px;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {DSCard, PlaceholderDSCard} from "../DSCard/DSCard.jsx";
import {actionCreators as ac} from "common/Actions.jsm";
import {clampTotalLines} from "content-src/lib/clamp-total-lines";
import {DSEmptyState} from "../DSEmptyState/DSEmptyState.jsx";
import {DSImage} from "../DSImage/DSImage.jsx";
import {DSLinkMenu} from "../DSLinkMenu/DSLinkMenu";
Expand Down Expand Up @@ -77,15 +76,13 @@ export class Hero extends React.PureComponent {
<DSImage extraClassNames="img" source={heroRec.image_src} rawSource={heroRec.raw_image_src} />
</div>
<div className="meta">
<div className="header-and-excerpt"
data-total-lines="7"
ref={clampTotalLines}>
<div className="header-and-excerpt">
{heroRec.context ? (
<p className="context">{heroRec.context}</p>
) : (
<p className="source clamp" data-clamp="1">{heroRec.domain}</p>
<p className="source clamp">{heroRec.domain}</p>
)}
<header className="clamp" data-clamp="4">{heroRec.title}</header>
<header className="clamp">{heroRec.title}</header>
<p className="excerpt clamp">{heroRec.excerpt}</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ $card-header-in-hero-line-height: 20;

font-size: 13px;
color: $grey-50;
-webkit-line-clamp: 1;
margin-bottom: 0;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {actionCreators as ac} from "common/Actions.jsm";
import {clampTotalLines} from "content-src/lib/clamp-total-lines";
import {connect} from "react-redux";
import {DSEmptyState} from "../DSEmptyState/DSEmptyState.jsx";
import {DSImage} from "../DSImage/DSImage.jsx";
Expand Down Expand Up @@ -44,15 +43,14 @@ export class ListItem extends React.PureComponent {
onLinkClick={!this.props.placeholder ? this.onLinkClick : undefined}
url={this.props.url}>
<div className="ds-list-item-text">
<div data-total-lines="4"
ref={clampTotalLines}>
<div>
<div className="ds-list-item-title clamp">{this.props.title}</div>
{this.props.excerpt && <div className="ds-list-item-excerpt clamp">{this.props.excerpt}</div>}
</div>
<p>
{this.props.context && (
<span>
<span className="ds-list-item-context">{this.props.context}</span>
<span className="ds-list-item-context clamp">{this.props.context}</span>
<br />
</span>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ $item-line-height: 20;

color: $grey-50;
font-size: 13px;
-webkit-line-clamp: 1;
}

.ds-list-item-title {
Expand Down
32 changes: 0 additions & 32 deletions content-src/lib/clamp-total-lines.js

This file was deleted.

3 changes: 2 additions & 1 deletion content-src/styles/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
}

// Note: lineHeight and fontSize should be unitless but can be derived from pixel values
// Bug 1550624 to clean up / remove this mixin that no longer limits lines
// Bug 1550624 to clean up / remove this mixin to avoid duplicate styles
@mixin limit-visibile-lines($line-count, $line-height, $font-size) {
font-size: $font-size * 1px;
-webkit-line-clamp: $line-count;
line-height: $line-height * 1px;
}

Expand Down
154 changes: 0 additions & 154 deletions test/unit/content-src/lib/clamp-total-lines.test.js

This file was deleted.