Skip to content

Commit 836df44

Browse files
committed
feat (mixins): add mixin line-clamp
1 parent 33813ba commit 836df44

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/scss/02-tools/_m-line-clamp.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/// Truncates text at a specific number of lines.
2+
/// https://css-tricks.com/almanac/properties/l/line-clamp/
3+
///
4+
/// @param {number} $lines
5+
/// The number of lines for the text.
6+
@mixin line-clamp($lines: 2) {
7+
display: -webkit-box;
8+
overflow: hidden;
9+
color: $color-light;
10+
-webkit-line-clamp: #{$lines};
11+
-webkit-box-orient: vertical;
12+
}

src/scss/02-tools/tools.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
@import "./m-editor-only";
2525
@import "./m-heading";
2626
@import "./m-hover";
27+
@import "./m-line-clamp";
2728
@import "./m-placeholder-media";
2829
@import "./m-radio-custom";
2930
@import "./m-row-fullwidth";

0 commit comments

Comments
 (0)