Skip to content

Instantly share code, notes, and snippets.

@andregivenchy
Created January 5, 2020 06:03
Show Gist options
  • Save andregivenchy/96d567857a3d4a0dc458e0eaee829dac to your computer and use it in GitHub Desktop.
Save andregivenchy/96d567857a3d4a0dc458e0eaee829dac to your computer and use it in GitHub Desktop.
Some SCSS for a set of custom social share buttons.
body {
background: #000;
padding: 2em;
text-align: center;
}
* {
box-sizing: border-box;
}
.share-btns {
position: absolute;
width: 300px;
height: 212px;
padding-left: (300px / 2) - (36px / 2);
top: 50%;
left: 50%;
margin-left: -(300px / 2);
margin-top: -(212px / 2);
.share-btn {
float: left;
margin-top: 15px;
&:first-child {
margin-top: 0;
}
&:after {
clear: both;
display: table;
}
}
}
.share-btn {
display: block;
position: relative;
height: 36px;
&:hover {
cursor: pointer;
.share-btn-primary {
box-shadow: 1px 0 0 0 rgba(0, 0, 0, .1);
}
.share-btn-secondary-content {
transform: translate3d(0, 0, 0);
}
}
}
.share-btn-primary {
position: absolute;
background: #fff;
width: 36px;
height: 36px;
border-radius: (36px / 2);
left: 0;
top: 50%;
margin-top: -(36px / 2);
}
.share-btn-icon {
display: block;
color: #242424;
position: absolute;
width: 36px;
line-height: 36px;
font-size: 16px;
margin-top: 1px;
}
.share-btn-secondary {
overflow: hidden;
margin-left: (36px / 2);
height: 36px;
}
.share-btn-secondary-content {
font-family: sans-serif;
font-size: .75em;
background: #fff;
display: block;
height: 36px;
text-align: left;
padding-left: (36px * .8);
padding-right: (36px * .6);
line-height: 36px;
color: #242424;
border-radius: 0 (36px / 2) (36px / 2) 0;
transform: translate3d(-100%, 0, 0);
transition: transform 175ms ease;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment