Skip to content

Commit

Permalink
fix(typography): streamline text overflow and text truncate styles
Browse files Browse the repository at this point in the history
  • Loading branch information
joneff authored and Juveniel committed Feb 15, 2023
1 parent 8a257f7 commit 8058111
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
5 changes: 4 additions & 1 deletion packages/utils/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,10 @@ $kendo-utils: (
capitalize: capitalize,
normal-case: none
),
"text-overflow": (),
"text-overflow": (
clip: clip,
ellipsis: ellipsis
),
"text-indent": (),
"vertical-align": (),
"white-space": (
Expand Down
24 changes: 24 additions & 0 deletions packages/utils/scss/typography/_text-overflow.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@mixin kendo-utils--typography--text-overflow() {

// Text overflow utility classes
$kendo-utils-text-overflow: k-map-get( $kendo-utils, "text-overflow" ) !default;
@include generate-utils( text, text-overflow, $kendo-utils-text-overflow );


// Text truncate utility classes
.#{$kendo-prefix}text-truncate {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.\!#{$kendo-prefix}text-truncate {
white-space: nowrap !important; // sass-lint:disable-line no-important
overflow: hidden !important; // sass-lint:disable-line no-important
text-overflow: ellipsis !important; // sass-lint:disable-line no-important
}

// Legacy aliases
.#{$kendo-prefix}text-ellipsis { @extend .#{$kendo-prefix}text-truncate !optional; }
.\!#{$kendo-prefix}text-ellipsis { @extend .\!#{$kendo-prefix}text-truncate !optional; }

}
8 changes: 2 additions & 6 deletions packages/utils/scss/typography/index.import.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,20 @@
@import "./_text-align.scss";
@import "./_text-color.scss";
// text decoration
@import "./_text-overflow.scss";
@import "./_text-transform.scss";
// text overflow
// text indent
// vertical align
@import "./_white-space.scss";


@mixin kendo-utils--typography() {
/// This is equivalent to `white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`.
/// @name .k-text-ellipsis
/// @group text
.#{$kendo-prefix}text-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } // sass-lint:disable-line one-declaration-per-line

@include kendo-utils--typography--font-size();
@include kendo-utils--typography--font-style();
@include kendo-utils--typography--font-weight();
@include kendo-utils--typography--text-align();
@include kendo-utils--typography--text-color();
@include kendo-utils--typography--text-overflow();
@include kendo-utils--typography--text-transform();
@include kendo-utils--typography--white-space();
}

0 comments on commit 8058111

Please sign in to comment.