aboutsummaryrefslogtreecommitdiffstats
path: root/scss/uikit/components/text.scss
blob: a4edbdabfe54f46b2a39da41e9682dafc35536da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
// Name:            Text
// Description:     Utilities for text
//
// Component:       `uk-text-*`
//
// ========================================================================


// Variables
// ========================================================================

$text-lead-font-size:                            $global-large-font-size !default;
$text-lead-line-height:                          1.5 !default;
$text-lead-color:                                $global-emphasis-color !default;

$text-meta-font-size:                            $global-small-font-size !default;
$text-meta-line-height:                          1.4 !default;
$text-meta-color:                                $global-muted-color !default;

$text-small-font-size:                           $global-small-font-size !default;
$text-small-line-height:                         1.5 !default;

$text-large-font-size:                           $global-large-font-size !default;
$text-large-line-height:                         1.5 !default;

$text-bold-font-weight:                          bolder !default;

$text-muted-color:                               $global-muted-color !default;
$text-primary-color:                             $global-primary-background !default;
$text-success-color:                             $global-success-background !default;
$text-warning-color:                             $global-warning-background !default;
$text-danger-color:                              $global-danger-background !default;

$text-background-color:                          $global-primary-background !default;


/* ========================================================================
   Component: Text
 ========================================================================== */


/* Style modifiers
 ========================================================================== */

.uk-text-lead {
    font-size: $text-lead-font-size;
    line-height: $text-lead-line-height;
    color: $text-lead-color;
    @if(mixin-exists(hook-text-lead)) {@include hook-text-lead();}
}

.uk-text-meta {
    font-size: $text-meta-font-size;
    line-height: $text-meta-line-height;
    color: $text-meta-color;
    @if(mixin-exists(hook-text-meta)) {@include hook-text-meta();}
}


/* Size modifiers
 ========================================================================== */

.uk-text-small {
    font-size: $text-small-font-size;
    line-height: $text-small-line-height;
    @if(mixin-exists(hook-text-small)) {@include hook-text-small();}
}

.uk-text-large {
    font-size: $text-large-font-size;
    line-height: $text-large-line-height;
    @if(mixin-exists(hook-text-large)) {@include hook-text-large();}
}


/* Weight modifier
 ========================================================================== */

.uk-text-bold { font-weight: $text-bold-font-weight; }


/* Transform modifier
 ========================================================================== */

.uk-text-uppercase { text-transform: uppercase !important; }
.uk-text-capitalize { text-transform: capitalize !important; }
.uk-text-lowercase { text-transform: lowercase !important; }


/* Color modifiers
 ========================================================================== */

.uk-text-muted { color: $text-muted-color !important; }
.uk-text-primary { color: $text-primary-color !important; }
.uk-text-success { color: $text-success-color !important; }
.uk-text-warning { color: $text-warning-color !important; }
.uk-text-danger { color: $text-danger-color !important; }


/* Background modifier
 ========================================================================== */

/*
 * 1. The background clips to the foreground text. Works in Chrome, Firefox, Safari, Edge and Opera
 *    Default color is set to transparent
 * 2. Container fits the text
 * 3. Fallback color for IE11
 */

.uk-text-background {
    /* 1 */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    /* 2 */
    display: inline-block;
    /* 3 */
    color: $text-background-color !important;
}

@supports (-webkit-background-clip: text) {

    .uk-text-background {
        background-color: $text-background-color;
        @if(mixin-exists(hook-text-background)) {@include hook-text-background();}
    }

}


/* Alignment modifiers
 ========================================================================== */

.uk-text-left { text-align: left !important; }
.uk-text-right { text-align: right !important; }
.uk-text-center { text-align: center !important; }
.uk-text-justify { text-align: justify !important; }

/* Phone landscape and bigger */
@media (min-width: $breakpoint-small) {

    .uk-text-left\@s { text-align: left !important; }
    .uk-text-right\@s { text-align: right !important; }
    .uk-text-center\@s { text-align: center !important; }

}

/* Tablet landscape and bigger */
@media (min-width: $breakpoint-medium) {

    .uk-text-left\@m { text-align: left !important; }
    .uk-text-right\@m { text-align: right !important; }
    .uk-text-center\@m { text-align: center !important; }

}

/* Desktop and bigger */
@media (min-width: $breakpoint-large) {

    .uk-text-left\@l { text-align: left !important; }
    .uk-text-right\@l { text-align: right !important; }
    .uk-text-center\@l { text-align: center !important; }

}

/* Large screen and bigger */
@media (min-width: $breakpoint-xlarge) {

    .uk-text-left\@xl { text-align: left !important; }
    .uk-text-right\@xl { text-align: right !important; }
    .uk-text-center\@xl { text-align: center !important; }

}

/*
 * Vertical
 */

.uk-text-top { vertical-align: top !important; }
.uk-text-middle { vertical-align: middle !important; }
.uk-text-bottom { vertical-align: bottom !important; }
.uk-text-baseline { vertical-align: baseline !important; }


/* Wrap modifiers
 ========================================================================== */

/*
 * Prevent text from wrapping onto multiple lines
 */

.uk-text-nowrap { white-space: nowrap; }

/*
 * 1. Make sure a max-width is set after which truncation can occur
 * 2. Prevent text from wrapping onto multiple lines, and truncate with an ellipsis
 * 3. Fix for table cells
 */

.uk-text-truncate {
    /* 1 */
    max-width: 100%;
    /* 2 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 2 */
th.uk-text-truncate,
td.uk-text-truncate { max-width: 0; }


/*
 * 1. Wrap long words onto the next line and break them if they are too long to fit
 * 2. Legacy `word-wrap` as fallback for `overflow-wrap`
 * 3. Fix `overflow-wrap` which doesn't work with table cells in Chrome, Opera, IE11 and Edge
 *    Must use `break-all` to support IE11 and Edge
 * Note: Not using `hyphens: auto;` because it hyphenates text even if not needed
 */

.uk-text-break {
    /* 1 */
    overflow-wrap: break-word;
    /* 2 */
    word-wrap: break-word;
}

/* 3 */
th.uk-text-break,
td.uk-text-break { word-break: break-all; }



// Hooks
// ========================================================================

@if(mixin-exists(hook-text-misc)) {@include hook-text-misc();}

// @mixin hook-text-lead(){}
// @mixin hook-text-meta(){}
// @mixin hook-text-small(){}
// @mixin hook-text-large(){}
// @mixin hook-text-background(){}
// @mixin hook-text-misc(){}


// Inverse
// ========================================================================

$inverse-text-lead-color:                       $inverse-global-color !default;
$inverse-text-meta-color:                       $inverse-global-muted-color !default;
$inverse-text-muted-color:                      $inverse-global-muted-color !default;
$inverse-text-primary-color:                    $inverse-global-color !default;



// @mixin hook-inverse-text-lead(){}
// @mixin hook-inverse-text-meta(){}