4.1K views
CSSAdd prefixes
1.button { 2 font-family: inherit; 3 background: #2CA0D9; 4 color: white; 5 padding: 0.35em 0; 6 font-size: 17px; 7 border: none; 8 border-radius: 0.7em; 9 letter-spacing: 0.08em; 10 position: relative; 11 display: flex; 12 align-content: center; 13 align-items: center; 14 overflow: hidden; 15 height: 2.1em; 16 padding-left: 2.8em; 17 padding-right: 0.9em; 18} 19 20.button .icon { 21 background: #fff; 22 height: 2em; 23 width: 2em; 24 border-radius: 2em; 25 position: absolute; 26 display: flex; 27 align-items: center; 28 justify-content: center; 29 left: 0.4em; 30 transition: all 0.5s; 31} 32 33.icon svg { 34 margin-left: 0.4em; 35 transition: all 0.5s; 36 color: #2CA0D9; 37 width: 1.2rem; 38 height: 1.2rem; 39} 40 41.button:hover .icon svg { 42 transform: rotate(360deg); 43} 44 45.button:hover .icon { 46 width: calc(100% - 0.85rem); 47 border-radius: 0.5em; 48}
HTML
1<button class="button"> 2 <div class="icon"> 3 <svg viewBox="0 0 16 16" class="bi bi-telegram" fill="currentColor" height="16" width="16" xmlns="http://www.w3.org/2000/svg"> 4 <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.287 5.906c-.778.324-2.334.994-4.666 2.01-.378.15-.577.298-.595.442-.03.243.275.339.69.47l.175.055c.408.133.958.288 1.243.294.26.006.549-.1.868-.32 2.179-1.471 3.304-2.214 3.374-2.23.05-.012.12-.026.166.016.047.041.042.12.037.141-.03.129-1.227 1.241-1.846 1.817-.193.18-.33.307-.358.336a8.154 8.154 0 0 1-.188.186c-.38.366-.664.64.015 1.088.327.216.589.393.85.571.284.194.568.387.936.629.093.06.183.125.27.187.331.236.63.448.997.414.214-.02.435-.22.547-.82.265-1.417.786-4.486.906-5.751a1.426 1.426 0 0 0-.013-.315.337.337 0 0 0-.114-.217.526.526 0 0 0-.31-.093c-.3.005-.763.166-2.984 1.09z"></path> 5 </svg> 6 </div> 7 <p>Telegram</p> 8</button>