Skip to content

Instantly share code, notes, and snippets.

@doot0
Created May 23, 2014 08:31
Show Gist options
  • Save doot0/4f1735757ffd7652bab9 to your computer and use it in GitHub Desktop.
Save doot0/4f1735757ffd7652bab9 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class="tag">
this is a tag
</div><div class="tag">
this is a tag
</div><div class="tag">
this is a tag
</div><div class="tag">
this is a tag
</div>
// ----
// Sass (v3.3.7)
// Compass (v1.0.0.alpha.18)
// ----
$tag-color: #5ad !default;
$inline: false !default;
$foreground-color: ($tag-color + 100) !default;
$curved-edges : true !default;
$font-size: 16px;
%is-tag{
box-sizing:border-box;
font-size: $font-size;
padding: .3em 1em .3em .6em;
position: relative;
line-height:1.42em;
float: left;
max-width: 100%;
color: $foreground-color;
background-color: $tag-color;
@if $curved-edges{border-radius: .2em 0 0 .2em}
@if $inline{
margin-right: 1.366em;
}@else{
clear: left;
margin-top: .5em;
&:first-child{margin-top:0;}
}
&:before,
&:after {
content: '';
position: absolute;
top: 0;
bottom: 0;
}
//Point
&:before {
width: 0;
height: 0;
left: 100%;
border-style: solid;
border-width: 1em 0 1em 1em;
border-color: transparent transparent transparent $tag-color;
}
//Circle
&:after {
left: 100%;
border-radius: 100%;
width: .4em;
height: .4em;
top: 50%;
margin-top: (-.4em)/2;
margin-left:(-.4em)/2;
background-color: $foreground-color;
}
}
.tag{
@extend %is-tag;
}
.tag {
box-sizing: border-box;
font-size: 16px;
padding: .3em 1em .3em .6em;
position: relative;
line-height: 1.42em;
float: left;
max-width: 100%;
color: #b9ffff;
background-color: #55aadd;
border-radius: .2em 0 0 .2em;
clear: left;
margin-top: .5em;
}
.tag:first-child {
margin-top: 0;
}
.tag:before, .tag:after {
content: '';
position: absolute;
top: 0;
bottom: 0;
}
.tag:before {
width: 0;
height: 0;
left: 100%;
border-style: solid;
border-width: 1em 0 1em 1em;
border-color: transparent transparent transparent #55aadd;
}
.tag:after {
left: 100%;
border-radius: 100%;
width: .4em;
height: .4em;
top: 50%;
margin-top: -0.2em;
margin-left: -0.2em;
background-color: #b9ffff;
}
<div class="tag">
this is a tag
</div><div class="tag">
this is a tag
</div><div class="tag">
this is a tag
</div><div class="tag">
this is a tag
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment