6.3K views
1.button { 2 position: relative; 3 overflow: hidden; 4 height: 3rem; 5 padding: 0 2rem; 6 border-radius: 1.5rem; 7 background: #3d3a4e; 8 background-size: 400%; 9 color: #fff; 10 border: none; 11} 12 13.button:hover::before { 14 transform: scaleX(1); 15} 16 17.button-content { 18 position: relative; 19 z-index: 1; 20} 21 22.button::before { 23 content: ''; 24 position: absolute; 25 top: 0; 26 left: 0; 27 transform: scaleX(0); 28 transform-origin: 0 50%; 29 width: 100%; 30 height: inherit; 31 border-radius: inherit; 32 background: linear-gradient( 33 82.3deg, 34 rgba(150, 93, 233, 1) 10.8%, 35 rgba(99, 88, 238, 1) 94.3% 36 ); 37 transition: all 0.475s; 38}
MIT License