Button by adamgiebl
#e8e8e8
1button { 2 border: none; 3 display: block; 4 position: relative; 5 padding: 0.7em 2.4em; 6 font-size: 18px; 7 background: transparent; 8 cursor: pointer; 9 user-select: none; 10 overflow: hidden; 11 color: royalblue; 12 z-index: 1; 13 font-family: inherit; 14 font-weight: 500; 15} 16 17button span { 18 position: absolute; 19 left: 0; 20 top: 0; 21 width: 100%; 22 height: 100%; 23 background: transparent; 24 z-index: -1; 25 border: 4px solid royalblue; 26} 27 28button span::before { 29 content: ""; 30 display: block; 31 position: absolute; 32 width: 8%; 33 height: 500%; 34 background: var(--lightgray); 35 top: 50%; 36 left: 50%; 37 transform: translate(-50%, -50%) rotate(-60deg); 38 transition: all 0.3s; 39} 40 41button:hover span::before { 42 transform: translate(-50%, -50%) rotate(-90deg); 43 width: 100%; 44 background: royalblue; 45} 46 47button:hover { 48 color: white; 49} 50 51button:active span::before { 52 background: #2751cd; 53}
18K views
18K views
Comments
MIT License