This repository has been archived by the owner on Aug 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path_text.scss
159 lines (134 loc) · 3.15 KB
/
_text.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
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
// Text
// ===
// All Caps
// ---
//
// Set text uppercase, letterspaced for legibility.
@mixin text-all-caps($important: false) {
@if($important) {
letter-spacing: 1px !important;
text-transform: uppercase !important;
} @else {
letter-spacing: 1px;
text-transform: uppercase;
}
}
// Capitalize Text
// ---
//
// Capitalize first letter of string.
@mixin text-capitalize($important: false) {
@if($important) {
text-transform: capitalize !important;
} @else {
text-transform: capitalize;
}
}
// Lowercase Text
// ---
//
// Lowercase all text in string.
@mixin text-lowercase($important: false) {
@if($important) {
text-transform: lowercase !important;
} @else {
text-transform: lowercase;
}
}
// Text Flow Alignment
// ---
//
// Writing-direction independent text alignment. For RTL stylesheets, re-define
// these styles with the opposite direction. Templates need not be changed.
@mixin text-align-start($important: false) {
@if($important) {
text-align: left !important;
} @else {
text-align: left;
}
}
@mixin text-align-center($important: false) {
@if($important) {
text-align: center !important;
} @else {
text-align: center;
}
}
@mixin text-align-end($important: false) {
@if($important) {
text-align: right !important;
} @else {
text-align: right;
}
}
// Vertical Alignment
// ---
//
// Vertical aligment of text and replaced (inline-block) elements within a line.
@mixin align-middle($important: false) {
@if($important) {
vertical-align: middle !important;
} @else {
vertical-align: middle;
}
}
@mixin align-baseline($important: false) {
@if($important) {
vertical-align: baseline !important;
} @else {
vertical-align: baseline;
}
}
// Weights & Style
// ---
@mixin text-normal($important: false) {
@if($important) {
font-weight: normal !important;
@if(true) {
// get around `no-duplicate-properties` lint error
font-weight: 400 !important;
}
} @else {
font-weight: normal;
@if(true) {
// get around `no-duplicate-properties` lint error
font-weight: 400;
}
}
}
@mixin text-bold($important: false) {
@if($important) {
font-weight: bold !important;
@if(true) {
// get around `no-duplicate-properties` lint error
font-weight: 700 !important;
}
} @else {
font-weight: bold;
@if(true) {
// get around `no-duplicate-properties` lint error
font-weight: 700;
}
}
}
@mixin text-italic($important: false) {
@if($important) {
font-style: italic !important;
} @else {
font-style: italic;
}
}
@mixin text-quiet(
$important: false,
$color: if(variable-exists(neutral-50), $neutral-50, null)
) {
@if($important) {
color: $color !important;
font-size: 0.785em !important;
fill: $color !important;
} @else {
color: $color;
font-size: 0.785em;
fill: $color;
}
}