mirror of
https://github.com/scratchfoundation/scratchx.git
synced 2024-11-29 02:55:53 -05:00
30 lines
669 B
SCSS
30 lines
669 B
SCSS
@charset "UTF-8";
|
|
|
|
/// Truncates text and adds an ellipsis to represent overflow.
|
|
///
|
|
/// @param {Number} $width [100%]
|
|
/// Max-width for the string to respect before being truncated
|
|
///
|
|
/// @example scss - Usage
|
|
/// .element {
|
|
/// @include ellipsis;
|
|
/// }
|
|
///
|
|
/// @example css - CSS Output
|
|
/// .element {
|
|
/// display: inline-block;
|
|
/// max-width: 100%;
|
|
/// overflow: hidden;
|
|
/// text-overflow: ellipsis;
|
|
/// white-space: nowrap;
|
|
/// word-wrap: normal;
|
|
/// }
|
|
|
|
@mixin ellipsis($width: 100%) {
|
|
display: inline-block;
|
|
max-width: $width;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
word-wrap: normal;
|
|
}
|