-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
40 lines (37 loc) · 1.22 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cheatsheet</title>
<link rel="stylesheet" href="./styles.css">
</head>
<body>
<h1>Cheatsheet for custom properties in css</h1>
<p>To setup custom properties in CSS, use the code below:</p>
<code><span class="selector">:root</span> {<br>
<span class="property">--my-color</span>: red;<br>
}<br>
<span class="selector">.item-to-style</span> {<br>
<span class="property">color</span>: var(--my-color);<br>
}</code>
<table>
<thead>
<tr>
<th>Example use cases</th>
</tr>
</thead>
<tbody>
<tr>
<td>Set the color theme for a page at the very top of the css file so when you want to make changes, the
relevant code can be quickly found and edited.</td>
</tr>
<tr>
<td>Use the same properties for multiple places and have the ability to change the property in one place for
all of the elements.</td>
</tr>
</tbody>
</table>
</body>
</html>