Skip to content

Instantly share code, notes, and snippets.

@stefbowerman
Created January 7, 2014 18:37
Show Gist options
  • Save stefbowerman/8304244 to your computer and use it in GitHub Desktop.
Save stefbowerman/8304244 to your computer and use it in GitHub Desktop.
$white : #FFF;
$grayLight : #CCC;
$baseBorderRadius : 3px;
$baseZIndex : 50;
@mixin border-radius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
border-radius: $radius;
}
@mixin box-sizing($boxmodel) {
-webkit-box-sizing: $boxmodel;
-moz-box-sizing: $boxmodel;
box-sizing: $boxmodel;
}
.crumb {
display:inline-block;
position:relative;
height:30px;
margin-bottom:20px;
margin-left: -6px;
padding:4px 8px 4px 25px;
background-color:$white;
float:left;
border: 1px solid $grayLight;
border-right:none;
@include border-radius($baseBorderRadius 6px 6px $baseBorderRadius);
@include box-sizing(border-box);
&:before{
content:"";
position:absolute;
border-style:solid;
/* reduce the damage in FF3.0 */
display:block;
width:0;
top:0;
right:-15px;
border-width:14px 0 14px 18px;
/* Must apply border-color */
border-color:transparent darken($grayLight, 5%);
}
&:after{
content:"";
position:absolute;
border-style:solid;
/* reduce the damage in FF3.0 */
display:block;
width:0;
top:1px;
right:-14px;
border-width:13px 0 13px 17px;
/* Must apply border-color */
border-color:transparent $white;
}
&:first-child {
padding-left:10px;
z-index: $baseZIndex;
margin-left:0;
}
&:last-child {
margin-right:15px; /* Needed to clear the :after content on the last crumb */
}
$crumbChildren: 1;
@while $crumbChildren < 10 { /* Change this number for styling more or less breadcrumbs */
&:nth-child(#{$crumbChildren + 1}) {
z-index: $baseZIndex - $crumbChildren;
}
$crumbChildren: $crumbChildren + 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment