-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsass.html
262 lines (237 loc) · 7.97 KB
/
sass.html
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
259
260
261
262
---
layout: default
title: Sass
subnav:
- Variables
- Functions
- Mixins
---
<section>
<p class="text-4-xs m-b-4-xs">Leap uses Sass to compile its CSS and has a <a href="http://bourbon.io/">Bourbon</a> dependency to give us access to many handy mixins. On top of that, we include many variables, mixins and functions that are specific to our needs at Treehouse.</p>
<h2 id="Variables" class="m-b-1-xs">Variables</h2>
<p class="m-b-2-xs">Most of our variables are built using Sass maps, which means they aren't easily accessible with a simple variable name. We've made functions to make access to those variables easier, we'll cover those below. Here are the variables that use regular variable names:</p>
<h3 class="m-b-05-xs">Typography</h3>
<p class="m-b-1-xs">Used to set font family a font size.</p>
<p class="bold">Font-family</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-element
font-family: $gotham
</code></pre>
<p class="m-b-2-xs"><code>$gotham</code></p>
<p class="bold">Font-weight</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-element
font-weight: $bold
</code></pre>
<p class="m-b-3-xs"><code>$bold</code></p>
</div>
<h3 class="m-b-05-xs">Borders</h3>
<p class="m-b-1-xs">Used in the <a href="border.html">border</a> utility classes.</p>
<p class="bold">Border Color</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-element
border-color: $border-color-dark
</code></pre>
<p class="m-b-2-xs"><code>
$border-color-dark<br />
$border-color-mid<br />
$border-color-normal<br />
$border-color-light
</code></p>
<p class="bold">Border Radius</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-element
border-radius: $border-radius
</code></pre>
<p class="m-b-3-xs"><code>
$border-radius<br />
</code></p>
<h3 class="m-b-05-xs">Grid</h3>
<p class="m-b-1-xs">Used in the <a href="grid.html">grid</a> and <a href="responsive.html">breakpoint</a> utility classes. Our <code>-xs</code> breakpoint doesn't have a variable because it is simply styling <code>@media screen</code>.</p>
<p class="bold">Grid Container</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-element
width: $grid-width
</code></pre>
<p class="m-b-3-xs"><code>
$grid-width
</code></p>
<p class="bold">Breakpoints</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">+media(min-width $sm)
property: value
</code></pre>
<p class="m-b-4-xs"><code>
$sm <br />
$md <br />
$lg <br />
$xl
</code></p>
<h2 id="Functions" class="m-b-1-xs">Functions</h2>
<p class="m-b-2-xs">The rest of our variables are made with Sass maps, so we've created handy functions that make accessing them super easy. <strong>Note:</strong> these don't use the typical <code>$</code> variable naming scheme, just the function name.</p>
<h3 class="m-b-05-xs">Typography</h3>
<p class="m-b-1-xs">Used in our <a href="typography.html">font size</a> utility classes.</p>
<p class="bold">Font Size</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-element
font-size: text-size(1)
</code></pre>
<p class="m-b-3-xs"><code>
text-size(1)<br />
text-size(2)<br />
text-size(3)<br />
text-size(4)<br />
text-size(5)<br />
text-size(6)
</code></p>
<h3 class="m-b-05-xs">Spacing</h3>
<p class="m-b-1-xs">Used in our <a href="layout.html">layout</a> utility classes.</p>
<p class="bold">Spacing Units</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-element
margin: spacing(1)
padding: spacing(2)
</code></pre>
<p class="m-b-3-xs"><code>
spacing(0)<br />
spacing(0.5)<br />
spacing(1)<br />
spacing(2)<br />
spacing(3)<br />
spacing(4)<br />
spacing(5)<br />
spacing(6)
</code></p>
<h3 class="m-b-05-xs">Colors</h3>
<p class="m-b-1-xs">Used in our <a href="colors.html">color</a> utility classes.</p>
<p class="bold">Brand Colors</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-element
background-color: brand-color(green)
</code></pre>
<p class="m-b-3-xs"><code>
brand-color(green)<br />
brand-color(green-dark)<br />
brand-color(gray)<br />
brand-color(blue-light)<br />
brand-color(blue-medium)<br />
brand-color(blue-dark)<br />
brand-color(ubora-orange)<br />
brand-color(ubora-magenta)<br />
brand-color(ubora-magenta-dark)<br />
brand-color(ubora-green)<br />
brand-color(ubora-black)<br />
brand-color(ubora-mint)
</code></p>
<p class="bold">Text Colors</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-element
color: text-color(dark)
</code></pre>
<p class="m-b-3-xs"><code>
text-color(dark)<br />
text-color(medium)<br />
text-color(base)<br />
text-color(light)
</code></p>
<p class="bold">Gray Colors</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-element
fill: gray-color(gray-dark)
</code></pre>
<p class="m-b-3-xs"><code>
gray-color(gray-darker)<br />
gray-color(gray-dark)<br />
gray-color(gray)<br />
gray-color(gray-light)<br />
gray-color(gray-lighter)
</code></p>
<p class="bold">Pop Colors</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-element
background-color: pop-color(golden)
</code></pre>
<p class="m-b-3-xs"><code>
pop-color(blue-pastel)<br />
pop-color(blue)<br />
pop-color(blue-dark)<br />
pop-color(teal)<br />
pop-color(green)<br />
pop-color(golden)<br />
pop-color(orange)<br />
pop-color(red-orange)<br />
pop-color(purple-pastel)<br />
pop-color(purple)<br />
pop-color(magenta)
</code></p>
<p class="bold">UI Colors</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-element
background-color: ui-color(blue)
</code></pre>
<p class="m-b-3-xs"><code>
ui-color(blue)<br />
ui-color(green)<br />
ui-color(yellow)<br />
ui-color(orange)<br />
ui-color(red)
</code></p>
<h2 id="Mixins" class="m-b-1-xs">Mixins</h2>
<p class="m-b-2-xs">Leap includes a few helpful mixins for common occuring styles or selectors.</p>
<p class="bold">Clearfix</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-selector
+clearfix
</code></pre>
<p class="m-b-3-xs"><code>
+clearfix
</code></p>
<p class="bold">Positioning</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-selector
+absolute(top 0 left 10px)
</code></pre>
<p class="m-b-3-xs"><code>
+absolute($direction $amount)
+relative($direction $amount)
+fixed($direction $amount)
</code></p>
<p class="bold">Media</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-selector
+media(min-width $sm) {
property: value
}
</code></pre>
<p class="m-b-3-xs"><code>
+media($rule $breakpoint)
</code></p>
<p class="bold">Placeholder Style</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-selector
+placeholder-style
property: value
</code></pre>
<p class="m-b-3-xs"><code>
+placeholder-style
</code></p>
<p class="bold">Hover, Active, Focus</p>
<p>Can remove <code>:focus</code> by passing <code>false</code> into the mixin.</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-selector
+selected
property: value
</code></pre>
<p class="m-b-3-xs"><code>
+selected<br />
+selected(false)
</code></p>
<p class="bold">Width and Height</p>
<div class="guide-code">
<pre class="m-tb-05-xs"><code class="language-css">.custom-selector
+width-height(100px, 200px)
</code></pre>
<p><code>
+width-height($width, $height)
</code></p>
</section>