-
Notifications
You must be signed in to change notification settings - Fork 193
/
index.html
449 lines (438 loc) · 20.4 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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" href="./img/brand.png" />
<link rel="stylesheet" href="./mvp.css" />
<meta charset="utf-8" />
<meta name="description" content="MVP.css - No classes, no framework. Just semantic HTML and you're done." />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MVP.css - Minimalist stylesheet for HTML elements</title>
</head>
<body>
<header>
<nav>
<a href="https://andybrewer.github.io/mvp/"><img alt="MVP.css" src="./img/logo.png" height="70" /></a>
<ul>
<li>Home</li>
<li><a href="#docs">Docs</a></li>
<li><a href="#faq">FAQ</a></li>
<li><a href="https://www.github.com/andybrewer/mvp/" target="_blank">GitHub ↗</a></li>
</ul>
</nav>
<h1>A <u>minimalist</u> stylesheet for HTML elements</h1>
<p><b>No class names, no frameworks,</b> just <em>semantic</em> HTML and <mark>you're done</mark>.</p>
<br />
<p>
<a download="mvp.html" href="./mvp.html" target="_blank"><i>Download HTML ↗</i></a
><a download="mvp.css" href="./mvp.css" target="_blank"><b>Download MVP.css (10kb) ↗</b></a>
</p>
<br /><br />
<p>
<sup>PRO TIP</sup> Add this code to a new HTML file:<br /><br /><code id="currentVersion" onclick="copyText('currentVersion');"
><link rel="stylesheet" href="https://unpkg.com/mvp.css"> <img src="./img/icon-copy.png" height="15" width="15" style="position: relative; top: 3px"
/></code>
</p>
</header>
<main>
<hr />
<section>
<header>
<h2>Simple, reusable components</h2>
<p>For a clean looking design that doesn't get in the way</p>
</header>
<aside>
<img alt="HTML only" src="./img/html.svg" height="150" />
<h3>HTML and You're Done</h3>
<p>MVP styles your root HTML elements, so you don't need to learn a new CSS framework or naming conventions.</p>
<p>
<a href="https://www.w3schools.com/TAGS/ref_byfunc.asp" target="_blank"><em>HTML Guide ↗</em></a>
</p>
</aside>
<aside>
<img alt="Mobile friendly" src="./img/mobile.svg" height="150" />
<h3>Mobile-friendly UI</h3>
<p>MVP is designed to look great on all browsers and devices out of the box for rapid prototyping.</p>
<p>It's like an amped up CSS reset that you can toss into any project to get decent styling.</p>
</aside>
<aside>
<img alt="MIT license" src="./img/license.svg" height="150" />
<h3>MIT License</h3>
<p>MVP is released under the permissive MIT license so you can freely use it however you'd like.</p>
<p>That means personal projects, commercial ventures, remixes and more are all welcome.</p>
</aside>
</section>
<hr />
<section id="testimonials">
<blockquote>
<img alt="Quote" src="./img/icon-quote.svg" height="80" /><br />
"By far the easiest stylesheet I've ever used. It integrates easily into <s>one</s> all of my startup projects."
<footer><img alt="MVP.css" src="./img/brand.png" height="36" /><br /><br /><i>- Andy Brewer, Author of MVP.css</i></footer>
</blockquote>
</section>
<hr />
<section id="features">
<header>
<h2>Flexibility without complexity</h2>
<p>A few, clean styling options without all the bells and whistles</p>
</header>
<table>
<thead>
<tr>
<th></th>
<th>MVP.css</th>
<th>No CSS</th>
<th>Custom CSS</th>
</tr>
</thead>
<tr>
<td>Mobile friendly</td>
<td><b>✓</b></td>
<td>✓</td>
<td>✓</td>
</tr>
<tr>
<td>Works out of the box</td>
<td><b>✓</b></td>
<td>✓</td>
<td>∅</td>
</tr>
<tr>
<td>Easy to customize</td>
<td><b>✓</b></td>
<td>✓</td>
<td>∅</td>
</tr>
<tr>
<td>Only semantic HTML</td>
<td><b>✓</b></td>
<td>✓</td>
<td>∅</td>
</tr>
<tr>
<td>No class names</td>
<td><b>✓</b></td>
<td>✓</td>
<td>∅</td>
</tr>
<tr>
<td>Perfect for an MVP</td>
<td><b>✓</b></td>
<td>∅</td>
<td>∅</td>
</tr>
</table>
</section>
<hr />
<div id="figure">
<header>
<h2>A decent MVP in no time</h2>
<p>More building and less designing with "set and forget" styling.</p>
</header>
<figure>
<img alt="Stock photo" src="./img/stock.jpg" />
<figcaption><i>"Uber for X" brainstorming session</i></figcaption>
</figure>
</div>
<hr />
<article id="docs">
<h2>Docs</h2>
<h3 id="html">HTML Reference</h3>
<aside>
<p>For a showcase of each styled element, check out the <a href="./mvp.html" target="_blank">quickstart template ↗</a>.</p>
</aside>
<br />
<p>MVP.css works with the following HTML elements:</p>
<ul>
<li>
<code><a></code> <small>— text links</small>
<ul>
<li><code><a><b></code>, <code><a><strong></code> <small>— solid link buttons</small></li>
<li><code><a><em></code>, <code><a><i></code> <small>— outlined link buttons</small></li>
</ul>
</li>
<li>
<code><article></code> <small>— content area with normal styling</small>
<ul>
<li><code><article><aside></code> <small>— text callout</small></li>
</ul>
</li>
<li>
<code><blockquote></code> <small>— quote callout</small>
<ul>
<li><code><blockquote><footer></code> <small>— quote attribution</small></li>
</ul>
</li>
<li><code><body></code> <small>— default parent element</small></li>
<li><code><button></code> <small>— form buttons</small></li>
<li><code><code></code> <small>— inline code highlighting</small></li>
<li>
<code><details></code> <small>— default expandable content section</small>
<ul>
<li><code><details><summary></code> <small>— expandable heading</small></li>
</ul>
</li>
<li><code><dialog></code> <small>— popup windows</small></li>
<li><code><div></code> <small>— unstyled element</small></li>
<li>
<code><figure></code> <small>— image callouts</small>
<ul>
<li><code><figure><figcaption></code> <small>— image callout captions</small></li>
</ul>
</li>
<li><code><footer></code> <small>— footer area</small></li>
<li>
<code><form></code> <small>— small form area</small>
<ul>
<li><code><form><input></code> <small>— short input field</small></li>
<li><code><form><label></code> <small>— form field labels</small></li>
<li>
<code><form><select></code> <small>— dropdown options container</small>
<ul>
<li><code><form><select><option></code> <small>— dropdown option items</small></li>
</ul>
</li>
<li><code><form><textarea></code> <small>— large input field</small></li>
</ul>
</li>
<li><code><header></code> <small>— content area with centered styling</small></li>
<li><code><h1></code>, <code><h2></code>, <code><h3></code>, <code><h4></code>, <code><h5></code>, <code><h6></code> <small>— headings</small></li>
<li><code><hr></code> <small>— horizontal rule (divider)</small></li>
<li><code><main></code> <small>— main content area</small></li>
<li><code><mark></code> <small>— text highlighting</small></li>
<li>
<code><nav></code> <small>— top navigation</small>
<ul>
<li><code><nav><ul></code> <small>— nav links container</small></li>
<li><code><nav><ul><li></code> <small>— nav link items</small></li>
<li><code><nav><ul><li><ul></code> <small>— nav dropdown container</small></li>
<li><code><nav><ul><li><ul><li></code> <small>— nav dropdown link items</small></li>
</ul>
</li>
<li>
<code><ol></code> <small>— numbered list container</small>
<ul>
<li><code><ol><li></code> <small>— numbered list items</small></li>
</ul>
</li>
<li><code><p></code> <small>— paragraph tag</small></li>
<li>
<code><pre></code> <small>— preformatted text</small>
<ul>
<li><code><pre><code></code> <small>— code block</small></li>
<li><code><pre><samp></code> <small>— computer output block</small></li>
</ul>
</li>
<li><code><samp></code> <small>— inline computer output</small></li>
<li>
<code><section></code> <small>— content area for centered / special content</small>
<ul>
<li><code><section><aside></code> <small>— content card</small></li>
</ul>
</li>
<li><code><small></code> <small>— smaller text</small></li>
<li><code><sup></code> <small>— raised text (notification bubbles)</small></li>
<li>
<code><table></code> <small>— data table</small>
<ul>
<li><code><table><td></code> <small>— data table cell</small></li>
<li><code><table><th></code> <small>— data table header cell</small></li>
<li><code><table><thead></code> <small>— data table header section</small></li>
<li><code><table><tr></code> <small>— data table row</small></li>
</ul>
</li>
<li>
<code><ul></code> <small>— unordered list container</small>
<ul>
<li><code><ul><li></code> <small>— unordered list item</small></li>
</ul>
</li>
</ul>
<br />
<h3 id="variables">Modifying the CSS variables</h3>
<p>MVP.css includes a list of CSS variables. Editing these variables will change the styles globally.</p>
<pre>
<code>
:root {
--active-brightness: 0.85;
--border-radius: 5px;
--box-shadow: 2px 2px 10px;
--color-accent: #118bee15;
--color-bg: #fff;
--color-bg-secondary: #e9e9e9;
--color-link: #118bee;
--color-secondary: #920de9;
--color-secondary-accent: #920de90b;
--color-shadow: #f4f4f4;
--color-table: #118bee;
--color-text: #000;
--color-text-secondary: #999;
--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
--hover-brightness: 1.2;
--justify-important: center;
--justify-normal: left;
--line-height: 1.5;
--width-card: 285px;
--width-card-medium: 460px;
--width-card-wide: 800px;
--width-content: 1080px;
}
</code>
</pre>
<p>Custom styles can be added inside a <code><style></code> tag, or at the end of your local <code>mvp.css</code> file</p>
</article>
<hr />
<article id="faq">
<h2>Frequently Asked Questions</h2>
<details>
<summary>Why would I use this?</summary>
<p>If you just want to launch already.</p>
<p><sup>PRO TIP</sup> An MVP is a temporary site, it doesn't have to be <i>and shouldn't be</i> perfect.</p>
</details>
<details>
<summary>What skills will I need?</summary>
<p>Mostly HTML, maybe a hint of CSS if you want to get fancy.</p>
<p><i>CSS</i> <progress max="100" value="5">5</progress></p>
<p><i>Design</i> <progress max="100" value="0">0</progress></p>
<p><i>HTML</i> <progress max="100" value="100">100</progress></p>
</details>
<details>
<summary>Is there a minified version?</summary>
<p>No, you don't need one for an MVP.</p>
</details>
<details>
<summary>How can I improve my design?</summary>
<p>Here are some helpful resources:</p>
<ul>
<li>Emojis - <a href="https://www.emojicopy.com/" target="_blank">Emojicopy ↗</a></li>
<li>Icons - <a href="https://www.toptal.com/designers/htmlarrows/" target="_blank">HTML Entities List by TopTal ↗</a></li>
<li>Icons - <a href="https://thenounproject.com/" target="_blank">TheNounProject ↗</a></li>
<li>Illustrations - <a href="https://gallery.manypixels.co/" target="_blank">Manypixels ↗</a></li>
<li>Illustrations - <a href="https://undraw.co/illustrations" target="_blank">Undraw ↗</a></li>
<li>Logo - <a href="https://www.namecheap.com/logo-maker/app/" target="_blank">Namecheap Logo Maker ↗</a></li>
<li>Product Shots - <a href="https://www.screely.com/" target="_blank">Screely ↗</a></li>
<li>Stock Photos - <a href="https://www.pexels.com/" target="_blank">Pexels ↗</a></li>
<li>Stock Photos - <a href="https://unsplash.com/" target="_blank">Unsplash ↗</a></li>
</ul>
</details>
<details>
<summary>How do I handle a user's dark mode preference?</summary>
<p>
By default <code><html></code> will force users into light mode. By using <code><html color-mode="user"></code> MVP.css will respect the user's dark mode preferences. The
original concept and additional tips can be found in this article: <a href="https://ryanfeigenbaum.com/dark-mode/" target="_ext">https://ryanfeigenbaum.com/dark-mode/</a>
</p>
</details>
<details>
<summary>What if I don't like the default styles?</summary>
<p>Most styles are editable through <em>CSS variables</em>. You can also add your own styles inline, at the end of MVP.css or in a new stylesheet.</p>
<p><sup>PRO TIP</sup> If there are two conflicting CSS styles, the last one will take precedence.</p>
<pre>
<code>
:root {
--color-bg: #fff;
}
/* Lower in the CSS, or in a 2nd stylesheet */
:root {
--color-bg: #000; /* This will take precedence */
}
</code>
</pre>
</details>
<details>
<summary>What if I still don't like it?</summary>
<p>That's OK, you probably shouldn't love your MVP. The goal of MVP.css is to help you feel <i>slightly</i> less embarrased about it.</p>
<p>
<span style="font-size: xx-large; position: relative; top: 6px; margin-right: 7px">👉</span> If you want a CSS framework with more features check out
<a href="https://bulma.io/" target="_blank">Bulma ↗</a> or <a href="https://tailwindcss.com/" target="_blank">Tailwind ↗</a>.
</p>
</details>
</article>
<hr />
<section id="ideas">
<header>
<img alt="Idea" src="./img/idea.svg" height="200" />
<h2>What can you build with MVP.css?</h2>
<p>Free ideas below ↓</p>
</header>
<form>
<header>
<img alt="MVP.css" src="./img/brand.png" height="80" />
</header>
<label for="company">A company you like:</label>
<input type="text" id="company" name="company" size="28" placeholder="Company name" />
<label for="hobby">A hobby you like:</label>
<textarea cols="28" rows="2" id="hobby"></textarea>
<label for="model">Business Model:</label>
<select id="model">
<option value="bootstrapped">bootstrapped</option>
<option value="VC-backed">funded</option>
</select>
<label>Team Size:</label>
<input type="radio" id="founders-solo" name="founders" value="a solo founder" checked /> <label for="founders-solo">Solo</label>
<input type="radio" id="founders-co" name="founders" value="two co-founders" /> <label for="founders-co">Co-founders</label>
<label>Focus:</label>
<input type="checkbox" id="focus-price" name="focus[]" value="price" checked /> <label for="focus-price">Price</label>
<input type="checkbox" id="focus-service" name="focus[]" value="service" /> <label for="focus-service">Service</label>
<input type="checkbox" id="focus-features" name="focus[]" value="features" /> <label for="focus-features">Features</label>
<label for="valuation">Valuation:</label>
<input type="range" id="valuation" name="valuation" value="50" />
<br />
<button type="submit" id="show">Submit</button>
</form>
<dialog id="popup">
<div id="results"></div>
<button id="close">Close</button>
</dialog>
</section>
<!-- Dialog HTML Element Example -->
<section>
<button style="margin-top: 6rem" popovertarget="dialog-modal" id="openDialog">Open Dialog</button>
<dialog popover id="dialog-modal">
<h3>Hello, I am a header of the modal</h3>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quos ullam at assumenda cum placeat aperiam ab error, doloribus eligendi sit. Lorem ipsum dolor sit amet consectetur adipisicing
elit. Quos ullam.
</p>
</dialog>
</section>
</main>
<footer>
<hr />
<p>Made by <a href="https://www.andybrewer.com" target="_blank">Andy Brewer ↗</a><br /></p>
</footer>
<script>
function copyText(el) {
var data = [new ClipboardItem({ "text/plain": new Blob([document.getElementById(el).innerText], { type: "text/plain" }) })];
navigator.clipboard.write(data).then(
function () {
alert("Copied to clipboard");
},
function () {
console.error("Unable to write to clipboard. :-(");
}
);
}
var dialog = document.getElementById("popup");
document.querySelector("#show").onclick = function () {
let company = document.getElementById("company").value || "GitHub";
let focusAreas = [];
document.querySelectorAll("input[name='focus[]']:checked").forEach((el) => {
focusAreas.push(el.value);
});
let focus = focusAreas.join(" / ") || "stealthy growth";
let founders = document.querySelector("input[name='founders']:checked").value;
let hobby = document.getElementById("hobby").value || "design";
let model = document.getElementById("model").value;
let valuation = document.getElementById("valuation").value;
document.getElementById(
"results"
).innerHTML = `<h3>Amazing Idea —</h3><p>A ${model} <mark><b>${company} for ${hobby}</b></mark> with ${founders} and a focus on ${focus}, targeting a $${valuation}B valuation.</p>`;
dialog.show();
return false;
};
document.querySelector("#close").onclick = function () {
dialog.close();
return false;
};
</script>
</body>
</html>