-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
292 lines (292 loc) Β· 15 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
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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<!DOCTYPE html>
<html lang="en">
<head>
<title>RAW CSS | π Design Starter</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A design system starter for evergreen browsers">
<link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACAAQMAAAD58POIAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURQBV/////4sv2ZcAAAAlSURBVEjHY2AYBUMX/IeCUQGYACo9KjCaPkbTx6gAsQKjgN4AAD6qvlDftANDAAAAAElFTkSuQmCC">
<link rel="stylesheet" href="raw.css">
<style>
body { max-width: 880px;padding: 8% 20px;margin: 0 auto; }
h1 a[id][href^="#"] { margin-right: 40px;font-variant: small-caps;letter-spacing: -0.04em;background: linear-gradient(to right, #03f, #0bf);-webkit-background-clip: text;-webkit-text-fill-color: transparent; }
h2 a[id][href^="#"] { color: var(--text);display: inline-flex;margin: 60px 0 8px; }
/* TODO: decide if this goes into raw.css */
label { display: inline-flex;flex-direction: column;margin: 8px; }
a { padding: 12px 4px; }
button[aria-label] { width: 40px;padding: 0;vertical-align: middle; }
[type="date"], [type="time"], [type="month"], [type="week"], [type="datetime-local"] { padding: 0 40px 0 16px;background-position: right 10px center; }
</style>
</head>
<body>
<h1><a id="rawcss" href="#rawcss">rawcss</a></h1>
<p style="margin-top: 40px;font-size: 20px;"><strong>rawcss</strong> is a pure CSS design starter that brings structure when starting a design system.</p>
<p style="font-size: 20px;">It includes a <button onclick="dark()">dark theme</button> and a <button onclick="swap()">without theme</button></p>
<p style="margin: 8px 0;font-size: 20px;">The structure is the following:</p>
<ul>
<li><a href="#layout">Layout</a></li>
<li><a href="#forms">Forms</a></li>
<li><a href="#elements">Elements</a></li>
<li><a href="#variables">Variables</a></li>
</ul>
<p style="margin: 8px 0;font-size: 20px;">And should be extended by adding:</p>
<ul>
<li><a href="#addons" disabled>Addons for Assets, Icons, Colors</a></li>
<li><a href="#components" disabled>Components</a></li>
<li><a href="#pages" disabled>Pages</a></li>
</ul>
<div class="row center space">
<span>Inspired by:</span>
<a title="Firefox Photon" href="https://design.firefox.com/photon" target="_blank" rel="noopener noreferrer" style="width: 120px;height: 60px;background: white no-repeat center url(https://protocol.mozilla.org/assets/protocol/protocol/img/logos/mozilla/white.svg);"></a>
<a title="Github Primer" href="https://primer.style/css/" target="_blank" rel="noopener noreferrer" style="width: 120px;height: 60px;background: white no-repeat center / 80px url(https://github.githubassets.com/images/modules/logos_page/GitHub-Logo.png);"></a>
<a title="Zeit Design" href="https://zeit.co/design" target="_blank" rel="noopener noreferrer" style="width: 120px;height: 60px;background: white no-repeat center / 280px url(https://assets.zeit.co/image/upload/q_auto/front/assets/design/black-full-logo.png);"></a>
</div>
<div class="row center space">
<script async defer src="https://buttons.github.io/buttons.js"></script>
<a class="github-button" href="https://github.com/vbrajon" aria-label="Follow @vbrajon on GitHub">Follow @vbrajon</a>
<a class="github-button" href="https://github.com/vbrajon/rawcss" data-show-count="true" aria-label="Star vbrajon/rawcss on GitHub">Star</a>
</div>
<h2><a id="layout" href="#layout">Layout</a></h2>
<table>
<thead>
<tr>
<th>Flexbox</th>
<th>Utility classes</th>
</tr>
</thead>
<tbody>
<tr>
<td>Direction</td>
<td>
<code>row</code>
<code>column</code>
</td>
</tr>
<tr>
<td>Position</td>
<td>
<code>top</code>
<code>bottom</code>
<code>left</code>
<code>right</code>
</td>
</tr>
<tr>
<td>Spacing</td>
<td>
<code>center</code>
<code>around</code>
<code>between</code>
<code>evenly</code>
</td>
</tr>
<tr>
<td>Utilities</td>
<td>
<code>stretch</code>
<code>space</code>
<code>thin</code>
<code>thick</code>
<small><code>reverse</code></small>
<small><code>nowrap</code></small>
<small><code>noshrink</code></small>
<small><code>inline</code></small>
</td>
</tr>
</tbody>
</table>
<style>
.block { margin: 20px;box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.24);width: calc(50% - 40px); }
.block > div { min-width: 300px;min-height: 250px;background: black;border-radius: 4px 4px 0 0; }
.block > div :not(.row):not(.column) { display: flex;place-items: center;place-content: center;min-width: 60px;min-height: 60px;color: white;background: #06e;outline: 1px dotted black;border-radius: 0; }
.block pre { padding: 20px;max-height: 160px;overflow: auto; }
.block .row.space { margin: 0;padding: 8px; }
</style>
<script>
window.$ = (s, start = document) => start.querySelector(s)
window.$$ = (s, start = document) => Array.from(start.querySelectorAll(s))
window.ex = (el, n) => ($('.block > div').outerHTML = $('.block > pre').innerText = [`<div class="row center space">\n <div>1</div>\n <div>2</div>\n <div>3</div>\n</div>`, `<div class="row evenly">\n <div>1</div>\n <div>2</div>\n <div>3</div>\n</div>`, `<div class="row stretch">\n <div>1</div>\n <div>2</div>\n <div class="column">\n <div class="left">1</div>\n <div class="center">2</div>\n <div class="right">3</div>\n </div>\n</div>`, `<div class="row stretch space">\n <div>1</div>\n <div>2</div>\n <div>3</div>\n <div>4</div>\n <div>5</div>\n <div>6</div>\n</div>`, `<div class="row">\n <div style="margin-bottom: auto;">1</div>\n <div style="margin: auto;">2</div>\n <div style="margin-top: auto;">3</div>\n</div>`][n], $('[active]').removeAttribute('active'), el.setAttribute('active', ''))
</script>
<div class="row center">
<div class="column space">
<label><span>Exemples</span></label>
<button onclick="ex(this, 0)" active>Center</button>
<button onclick="ex(this, 1)">Evenly</button>
<button onclick="ex(this, 2)">Nested</button>
<button onclick="ex(this, 3)">Grid</button>
<button onclick="ex(this, 4)">Margin</button>
</div>
<div class="block">
<div class="row center space">
<div>1</div>
<div>2</div>
<div>3</div>
</div><pre><code><div class="row center space">
<div>1</div>
<div>2</div>
<div>3</div>
</div></code></pre>
</div>
</div>
<h2><a id="forms" href="#forms">Forms</a></h2>
<label for="none">
<span>Checkbox / Radio</span>
<div class="row">
<input type="checkbox">
<input type="checkbox" indeterminate>
<input type="checkbox" checked>
<input type="checkbox" disabled>
<input type="radio">
<input type="radio" checked>
<input type="radio" disabled>
<script>$$('[indeterminate]').forEach(el => el.indeterminate = true)</script>
</div>
</label>
<label>
<span>Select</span>
<select>
<option></option>
<option selected>Select box</option>
<option>Using native <select></option>
<optgroup label="Features">
<option>Option groups</option>
<option>Super long text does not overflowing on the icon even if we try harder!</option>
</optgroup>
</select>
</label>
<label><span>Date</span><input type="date"></label>
<label><span>Time <small>.noicon</small></span><input type="time" class="noicon"></label>
<label><span>Month</span><input type="month"></label>
<label><span>Week</span><input type="week"></label>
<!-- <label><span>Datetime</span><input type="datetime-local"></label> -->
<label><span>Search</span><input type="search"></label>
<label><span>Text <small>disabled</small></span><input disabled></label>
<label><span>Email</span><input type="email"></label>
<label><span>Password</span><input type="password"></label>
<label><span>Tel</span><input type="tel"></label>
<label><span>Url</span><input type="url"></label>
<label><span>File</span><input type="file" multiple></label>
<label><span>Range</span><input type="range"></label>
<label title="Audio tag is for color comparison purposes."><span>Color / Audio</span><div class="row center space"><input type="color" value="#ffdd55"><audio controls></audio></div></label>
<label><span>Textarea</span><textarea></textarea></label>
<div class="row space">
<button>Button</button>
<button class="primary">Primary</button>
<button class="ghost">Ghost</button>
<button class="ghost" aria-label="feather-icon"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none" shape-rendering="geometricPrecision"><path d="M20.24 12.24a6 6 0 00-8.49-8.49L5 10.5V19h8.5z"/><path d="M16 8L2 22"/><path d="M17.5 15H9"/></svg></button>
<button disabled>Disabled</button>
<details class="popup">
<summary class="button">Popup</summary>
<div class="column">
<div class="thick">
This is a CSS Popup, click outside to close it.
</div>
<div class="row space right">
<button class="ghost">Fake</button>
<button>Buttons</button>
</div>
</div>
</details>
</div>
<h2><a id="elements" href="#elements">Elements</a></h2>
<h1>h1</h1>
<h2>h2</h2>
<h3>h3</h3>
<h4>h4</h4>
<p>p</p>
<pre>pre</pre>
<blockquote>blockquote</blockquote>
<ul>
<li>ul + li</li>
<li>ul + li</li>
<li>
nested
<ol>
<li>ol + li</li>
<li>ol + li</li>
</ol>
</li>
</ul>
<details>
<summary>details</summary>
<div>
<div>div 1</div>
<div>div 2</div>
<div>div 3</div>
</div>
</details>
<hr>
<a id="a" href="#a">a id</a>
<a href="">a href</a>
<a href="https://github.com/vbrajon" target="_blank" rel="noopener noreferrer" external>a external</a>
<abbr title="Abbreviation">abbr</abbr>
<b>b</b>
<code>code</code>
<del>del</del>
<em>em</em>
<i>i</i>
<ins>ins</ins>
<kbd>kbd</kbd>
<mark>mark</mark>
<q>q</q>
<s>s</s>
<small>small</small>
<strong>strong</strong>
<sub>sub</sub>
<sup>sup</sup>
<u>u</u>
<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none" shape-rendering="geometricPrecision"><path d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z"/><path d="M11 16l4-4-4-4" fill="none"/></svg>
<span style="text-decoration: underline overline">Align</span>
<span title="The title attribute is displayed as a CSS tooltip. It can be super long, but will overflow eventually. The native title will appear after 3 sec. The title attribute is displayed as a CSS tooltip. It can be super long, but will overflow eventually. The native title will appear after 3 sec. The title attribute is displayed as a CSS tooltip. It can be super long, but will overflow eventually. The native title will appear after 3 sec.">Hover me!</span>
<h2><a id="variables" href="#variables">Variables</a></h2>
<style>
.color { width: 16px;height: 16px;margin: 2px;border-radius: 2px; }
.icon { width: 24px;height: 24px;margin: 4px; }
.shadow { width: 16px;height: 16px; }
:root { --shadow1: 0 1px 4px var(--gray1);--shadow2: 0 2px 8px var(--gray1);--shadow3: 0 4px 16px var(--gray1); }
</style>
<div class="row space">
<div class="column between">
<div class="row" style="width: 176px;padding: 8px;background: var(--gray05);">
<div class="color" style="background: var(--gray02)" title="--gray02"></div>
<div class="color" style="background: var(--gray05)" title="--gray05"></div>
<div class="color" style="background: var(--gray1)" title="--gray1"></div>
<div class="color" style="background: var(--gray2)" title="--gray2"></div>
<div class="color" style="background: var(--gray3)" title="--gray3"></div>
<div class="color" style="background: var(--primary)" title="--primary"></div>
<div class="color" style="background: var(--text)" title="--text"></div>
<div class="color" style="background: var(--background)" title="--background"></div>
</div>
<div class="row dark" style="width: 176px;padding: 8px;background: var(--gray05);">
<div class="color" style="background: var(--gray02)" title="--gray02"></div>
<div class="color" style="background: var(--gray05)" title="--gray05"></div>
<div class="color" style="background: var(--gray1)" title="--gray1"></div>
<div class="color" style="background: var(--gray2)" title="--gray2"></div>
<div class="color" style="background: var(--gray3)" title="--gray3"></div>
<div class="color" style="background: var(--primary)" title="--primary"></div>
<div class="color" style="background: var(--text)" title="--text"></div>
<div class="color" style="background: var(--background)" title="--background"></div>
</div>
</div>
<div class="row" style="width: 150px;padding: 10px;background: var(--gray05);">
<div class="icon" style="background: var(--calendar)" title="--calendar"></div>
<div class="icon" style="background: var(--chevron-down)" title="--chevron-down"></div>
<div class="icon" style="background: var(--external-link)" title="--external-link"></div>
<div class="icon" style="background: var(--link)" title="--link"></div>
<div class="icon" style="background: var(--lock)" title="--lock"></div>
<div class="icon" style="background: var(--mail)" title="--mail"></div>
<div class="icon" style="background: var(--phone)" title="--phone"></div>
<div class="icon" style="background: var(--search)" title="--search"></div>
</div>
</div>
<script>
// console.log('π Hi there! Use the "s" key to toggle the style and "d" key to toggle the dark mode. Appart from this, no JS here.')
window.link = document.querySelector('[href="raw.css"]')
window.swap = () => link.href = link.href.replace(/^x?/, m => m[0] === 'x' ? '' : 'x')
window.dark = () => document.documentElement.classList.toggle('dark')
// window.key = (letter, fn) => addEventListener('keydown', e => e.key.toLowerCase() === letter && fn(e))
// key('s', swap)
// key('d', dark)
</script>
</body>
</html>