UNPKG

1.9 kBSCSSView Raw
1// Foundation for Sites by ZURB
2// foundation.zurb.com
3// Licensed under MIT Open Source
4
5////
6/// @group prototype-text-utilities
7////
8
9/// Responsive breakpoints for text utilities
10/// @type Boolean
11$prototype-utilities-breakpoints: $global-prototype-breakpoints !default;
12
13/// Default Value for `text-overflow` variable
14/// @type String
15$prototype-text-overflow: ellipsis !default;
16
17/// Image Replacement utility. `text-hide`
18@mixin text-hide {
19 font: 0/0 a !important;
20 color: transparent !important;
21 text-shadow: none !important;
22 background-color: transparent !important;
23 border: 0 !important;
24}
25
26/// Truncating the text, elipsis by default.
27/// @param {String} $overflow [$prototype-text-overflow] Text Truncate
28@mixin text-truncate(
29 $overflow: $prototype-text-overflow
30) {
31 max-width: 100% !important;
32 overflow: hidden !important;
33 text-overflow: $overflow;
34 white-space: nowrap !important;
35}
36
37/// No wrapping of the text. `text-nowrap`
38@mixin text-nowrap {
39 white-space: nowrap !important;
40}
41
42/// Wrapping of the text. `text-wrap`
43@mixin text-wrap {
44 word-wrap: break-word !important;
45}
46
47@mixin foundation-prototype-text-utilities {
48 .text-hide {
49 @include text-hide;
50 }
51
52 .text-truncate {
53 @include text-truncate;
54 }
55
56 .text-nowrap {
57 @include text-nowrap;
58 }
59
60 .text-wrap {
61 @include text-wrap;
62 }
63
64 @if ($prototype-utilities-breakpoints) {
65 // Loop through Responsive Breakpoints
66 @each $size in $breakpoint-classes {
67 @include breakpoint($size) {
68 @if $size != $-zf-zero-breakpoint {
69 .#{$size}-text-hide {
70 @include text-hide;
71 }
72
73 .#{$size}-text-truncate {
74 @include text-truncate;
75 }
76
77 .#{$size}-text-nowrap {
78 @include text-nowrap;
79 }
80
81 .#{$size}-text-wrap {
82 @include text-wrap;
83 }
84 }
85 }
86 }
87 }
88}