Botão com sombra longa com CSS3 e SASS

Henrique Melanda
Aug 1, 2018 · 4 min read
@import url(http://weloveiconfonts.com/api/?family=fontawesome|zocial);
html, body{
width: 100%;
height: 100%;
min-height: 100%;
background-color: #30303A;
display: flex;
align-items: center;
justify-content: center;
}
/* fontawesome */
[class*="fontawesome-"]:before {
font-family: 'FontAwesome', sans-serif;
}
/* zocial */
[class*="zocial-"]:before {
font-family: 'Zocial', sans-serif;
}
<div class="icons">
<a href="#" class="zocial-twitter twitter social-icon"></a>
<a href="#" class="fontawesome-facebook facebook social-icon"></a>
<a href="#" class="zocial-stumbleupon stumbleupon social-icon"></a>
<a href="#" class="zocial-googleplus google-plus social-icon"></a>
</div>
.social-icon{
text-decoration: none;
color: white;
display: inline-block;
font-size: 2.5em;
width: 80px;
height: 80px;
line-height: 80px;
border-radius: 40px;
overflow: hidden;
margin: 0 10px;
text-align: center;
}
$color-twitter: #55acee;
$color-facebook: #3b5998;
$color-stumbleupon: #f74425;
$color-google-plus: #dd4b39;
@function makelongshadow($color){
$val: 0px 0px $color;
@for $i from 1 through 35 {
$val: #{$val}, #{$i}px #{$i}px #{$color};
}
@return $val;
}
.twitter {
background: $color-twitter;
text-shadow: makelongshadow(darken($color-twitter, 10%));
}

.facebook {
background: $color-facebook;
text-shadow: makelongshadow(darken($color-facebook, 10%));
}

.stumbleupon {
background: $color-stumbleupon;
text-shadow: makelongshadow(darken($color-stumbleupon, 10%));
}

.google-plus {
background: $color-google-plus;
text-shadow: makelongshadow(darken($color-google-plus, 10%));
}
.google-plus {
background: #dd4b39;
text-shadow: 0px 0px #c23321,
1px 1px #c23321,
2px 2px #c23321,
3px 3px #c23321,
4px 4px #c23321,
5px 5px #c23321,
6px 6px #c23321,
7px 7px #c23321,
8px 8px #c23321,
9px 9px #c23321,
10px 10px #c23321,
11px 11px #c23321,
12px 12px #c23321,
13px 13px #c23321,
14px 14px #c23321,
15px 15px #c23321,
16px 16px #c23321,
17px 17px #c23321,
18px 18px #c23321,
19px 19px #c23321,
20px 20px #c23321,
21px 21px #c23321,
22px 22px #c23321,
23px 23px #c23321,
24px 24px #c23321,
25px 25px #c23321,
26px 26px #c23321,
27px 27px #c23321,
28px 28px #c23321,
29px 29px #c23321,
30px 30px #c23321,
31px 31px #c23321,
32px 32px #c23321,
33px 33px #c23321,
34px 34px #c23321,
35px 35px #c23321;
}

Henrique Melanda

Written by

Entusiasta pelo estudo de novas tecnologias, por projetos open source e CSS Evangelista.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade