Skip to content

Instantly share code, notes, and snippets.

@danielvlopes
Last active April 17, 2020 18:33
Show Gist options
  • Save danielvlopes/a49447494462af0359d1819367583309 to your computer and use it in GitHub Desktop.
Save danielvlopes/a49447494462af0359d1819367583309 to your computer and use it in GitHub Desktop.
Custom CSS Badges design for our community feature in knowyourteam.com
$badge-gold-background: #FFE629;
$badge-gold-content: #E2A53C;
$badge-silver-background: #B0DBEC;
$badge-silver-content: #275665;
$badge-bronze-background: #FF6136;
$badge-bronze-content: #A52A07;
.badge-groups {
h3 {
color: $primary-text-color;
}
}
.badge-card {
background: white;
box-shadow: none;
border: 1px solid #EEE6DF;
position: relative;
&.medium {
width: 250px;
}
.check-display {
position: absolute;
top: -5px;
left: -5px;
display: inline-block;
width: 21px;
border-radius: 21px;
text-align: center;
height: 21px;
}
&.large {
.badge-contents {
.badge-link {
padding: 0;
width: 100%;
}
}
}
.badge-contents {
align-items: center;
justify-content: left;
padding: 10px 20px;
.badge-link {
padding: 0;
width: 100%;
}
.badge-info {
padding: 0;
h3 {
font-size: 1.5rem;
line-height: 1.8rem;
margin: 0 0 1rem 0;
padding: 0;
a {
color: $primary-text-color;
}
}
.badge-summary {
font-size: 1.3rem;
line-height: 1.5rem;
color: $tertiary-text-color;
}
}
.badge-icon {
background: transparent;
position: relative;
width: 50px;
min-width: 50px;
height: 50px;
margin: 0 15px 0 0;
border-radius:100%;
background: $badge-bronze-background;
box-shadow: 0 1px 0 2px rgba(0,0,0,0.1);
border: 2px solid transparent;
&:before {
content:'';
position:absolute;
top:2px;
left:2px;
width:40px;
height:40px;
border-radius:100%;
border:1px dashed $badge-bronze-content;
}
a {
width: 100%;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
& .fa {
font-size: 2.5rem;
}
&.badge-type-bronze {
background: $badge-bronze-background;
border-color: $badge-bronze-content;
&:before { border-color: $badge-bronze-content; }
.fa { color: $badge-bronze-content !important; }
}
&.badge-type-silver {
background: $badge-silver-background;
border-color: $badge-silver-content;
&:before { border-color: $badge-silver-content; }
.fa { color: $badge-silver-content !important; }
}
&.badge-type-gold {
background: $badge-gold-background;
border-color: $badge-gold-content;
&:before { border-color: $badge-gold-content; }
.fa { color: $badge-gold-content !important; }
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment