aboutsummaryrefslogtreecommitdiff
path: root/build/stripe-menu-css/index.html
blob: 1f16e6eb392fb7eff335909f2eb627c9bd2d109f (plain)
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
<!doctype html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="icon" href="data:,">
	<title>Stripe Menu Dropdowns (CSS)</title>
	<link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Atom feed for blog posts" />
	<link href="/rss.xml" type="application/rss+xml" rel="alternate" title="RSS feed for blog posts" />
<style>*{box-sizing:border-box;}body{font-family:sans-serif;line-height:1.33;margin:0 auto;max-width:650px;padding:1rem;}img{max-width:100%;}pre{border:1px solid;overflow:auto;padding:5px;}table{text-align:left;width:100%;}.footnotes{font-size:90%;}</style>
</head>

<nav>
	<a href="#menu">Menu &darr;</a>
</nav>

<main>
<h1 id="stripe-menu-dropdowns-css">Stripe Menu Dropdowns (CSS)</h1>

<p>2020-03-31</p>

<p>In a previous article I wrote, <a href="blog/minimal-css-menu">Minimal CSS: Dropdown Menus</a>, I showed how you could create a basic menu dropdown with only 121 bytes of CSS. While this demo is great for simple text-based menu dropdowns, it doesn&#8217;t show just how complex (in a good way) you can make CSS-only menus. So, let&#8217;s do just that.</p>

<h2 id="what-we-want-to-emulate">What we want to emulate</h2>

<p>I think, like most designers, that the UI and web design work from the <a href="https://stripe.com/">Stripe</a> team is pretty fantastic. Their clean approach using subtle animations and minimal elements make for a pleasant experience. Unfortunately, there is one problem with their current dropdown menus on their main website:</p>

<p>They don&#8217;t work if JavaScript is disabled.</p>

<p>But we can easily fix that. So enough chit-chat, let&#8217;s rip-off their menu design and recreate it with only CSS!</p>

<h3 id="original-stripe-website">Original (<a href="https://stripe.com">Stripe Website</a>)</h3>

<h3 id="our-recreation-codepen-demo">Our recreation (<a href="https://codepen.io/bradleytaunt/full/ExjMjLL">CodePen Demo</a>)</h3>

<p>Although our redesign is far from an exact replica (some subtle animations are missing which could always be added) - it&#8217;s still impressive what you can do with some bare-bones CSS. Just something to keep in mind the next time you decide to reach for a JavaScript library to implement a similar design.</p>

<h2 id="see-it-live-in-action">See it live in action</h2>

<p>Load in the CodePen below and play around with the menu dropdown. Feel free to re-use, break. share or steal this for any and all purposes. Enjoy!</p>

<p><a href="https://codepen.io/bradleytaunt/pen/ExjMjLL">Live CodePen Example</a></p>
<footer role="contentinfo">
    <h2>Menu Navigation</h2>
    <ul id="menu">
        <li><a href="/">Home</a></li>
        <li><a href="/projects">Projects</a></li>
        <li><a href="/uses">Uses</a></li>
        <li><a href="/wiki">Wiki</a></li>
        <li><a href="/resume">Resume</a></li>
        <li><a href="/colophon">Colophon</a></li>
        <li><a href="/now">Now</a></li>
        <li><a href="/donate">Donate</a></li>
        <li><a href="/atom.xml">RSS</a></li>
        <li><a href="#top">&uarr; Top of the page</a></li>
    </ul>
    <small>
        Built with <a href="https://git.sr.ht/~bt/barf">barf</a>. <br>
        Maintained with ♥ for the web. <br>
        Proud supporter of <a href="https://usefathom.com/ref/DKHJVX">Fathom</a> &amp; <a href="https://nextdns.io/?from=74d3p3h8">NextDNS</a>. <br>
        The content for this site is <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>.<br> The <a href="https://git.sr.ht/~bt/bt.ht">code for this site</a> is <a href="https://git.sr.ht/~bt/bt.ht/tree/master/item/LICENSE">MIT</a>.
    </small>
</footer>