-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_text-alignment.scss
44 lines (34 loc) · 1.54 KB
/
_text-alignment.scss
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
// =============================
// Enable Private Variables
// =============================
$_text-alignment-enable: true !default;
$_viewport-text-alignment-enable: true !default;
// =============================
// Core Text Alignment Utility Helper Classes
// =============================
// Un-namespaced Classes are to be used globally when an elements alignment is consistant across all viewports.
@if ($_text-alignment-enable) {
.text-left, %text-left { text-align: left !important }
.text-right, %text-right { text-align: right !important }
.text-center, %text-center { text-align: center !important }
}
// =============================
// Core Viewport Text Alignment Utility Helper Attributes
// =============================
//
// Viewport Text Alignment Utility Helper Attributes are generated via the below function for certain viewports.
// The advantage to this, is it allows alignment to be added to a certain element specifically for a breakpoint which you have
// defined.
// Example Use - data-desk="text-left" data-lap="text-center".
//
@if ($_viewport-text-alignment-enable) {
@each $viewport, $breakpoint in $viewport-values {
// Attributes only apply once certain breakpoint is triggered.
@include media-query($from: nth($breakpoint, 1),
$to: nth($breakpoint, 2)) {
[data-#{$viewport}~="text-left"] { text-align: left !important }
[data-#{$viewport}~="text-right"] { text-align: right !important }
[data-#{$viewport}~="text-center"] { text-align: center !important }
}
}
}