#dbf5f1
1.button { 2 -webkit-appearance: none; 3 appearance: none; 4 position: relative; 5 border-width: 0; 6 padding: 0 8px 12px; 7 min-width: 10em; 8 box-sizing: border-box; 9 background: transparent; 10 font: inherit; 11 cursor: pointer; 12} 13 14.button-top { 15 display: flex; 16 align-items: center; 17 justify-content: center; 18 position: relative; 19 z-index: 0; 20 padding: 8px 16px; 21 transform: translateY(0); 22 text-align: center; 23 color: #fff; 24 text-shadow: 0 -1px rgba(0, 0, 0, .25); 25 transition-property: transform; 26 transition-duration: .2s; 27 -webkit-user-select: none; 28 user-select: none; 29} 30 31.button:active .button-top { 32 transform: translateY(6px); 33} 34 35.button-top::after { 36 content: ''; 37 position: absolute; 38 z-index: -1; 39 border-radius: 4px; 40 width: 100%; 41 height: 100%; 42 box-sizing: content-box; 43 background-image: radial-gradient(#3dcd9e, #369d8d); 44 text-align: center; 45 color: #fff; 46 box-shadow: inset 0 0 0px 1px rgba(255, 255, 255, .2), 0 1px 2px 1px rgba(255, 255, 255, .2); 47 transition-property: border-radius, padding, width, transform; 48 transition-duration: .2s; 49} 50 51.button:active .button-top::after { 52 border-radius: 6px; 53 padding: 0 2px; 54} 55 56.button-bottom { 57 position: absolute; 58 z-index: -1; 59 bottom: 4px; 60 left: 4px; 61 border-radius: 8px / 16px 16px 8px 8px; 62 padding-top: 6px; 63 width: calc(100% - 8px); 64 height: calc(100% - 10px); 65 box-sizing: content-box; 66 background-color: #38a19d; 67 background-image: radial-gradient(4px 8px at 4px calc(100% - 8px), rgba(255, 255, 255, .25), transparent), radial-gradient(4px 8px at calc(100% - 4px) calc(100% - 8px), rgba(255, 255, 255, .25), transparent), radial-gradient(16px at -4px 0, white, transparent), radial-gradient(16px at calc(100% + 4px) 0, white, transparent); 68 box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.5), inset 0 -1px 3px 3px rgba(0, 0, 0, .4); 69 transition-property: border-radius, padding-top; 70 transition-duration: .2s; 71} 72 73.button:active .button-bottom { 74 border-radius: 10px 10px 8px 8px / 8px; 75 padding-top: 0; 76} 77 78.button-base { 79 position: absolute; 80 z-index: -2; 81 top: 4px; 82 left: 0; 83 border-radius: 12px; 84 width: 100%; 85 height: calc(100% - 4px); 86 background-color: rgba(0, 0, 0, .15); 87 box-shadow: 0 1px 1px 0 black, inset 0 2px 2px rgba(0, 0, 0, .25); 88}
Comments
1obed4life 18. September at 9:26
18. September at 9:26
nice and flexible to integrate
MIT License