_breadcrumb.scss 1.68 KB
Newer Older
Mark Otto's avatar
Mark Otto committed
1
.breadcrumb {
2
  padding: $breadcrumb-padding-y $breadcrumb-padding-x;
Mark Otto's avatar
Mark Otto committed
3
  margin-bottom: $spacer-y;
Mark Otto's avatar
Mark Otto committed
4
5
  list-style: none;
  background-color: $breadcrumb-bg;
6
  @include border-radius($border-radius);
7
  @include clearfix;
8
}
Mark Otto's avatar
Mark Otto committed
9

10
11
.breadcrumb-item {
  float: left;
Mark Otto's avatar
Mark Otto committed
12

13
  // The separator between breadcrumbs (by default, a forward-slash: "/")
14
  + .breadcrumb-item::before {
15
    display: inline-block; // Suppress underlining of the separator in modern browsers
16
17
18
19
    padding-right: $breadcrumb-item-padding;
    padding-left: $breadcrumb-item-padding;
    color: $breadcrumb-divider-color;
    content: "#{$breadcrumb-divider}";
Mark Otto's avatar
Mark Otto committed
20
21
  }

22
23
24
25
26
27
28
29
30
31
32
33
34
35
  // When not using <ul> markup, browsers normally underline the ::before pseudo-element
  // (the separator between the breadcrumbs) when the user hovers over its originating breadcrumb <a> element.
  // In modern browsers, this underline can be suppressed by setting `display:inline-block` on the pseudo-element.
  // (Why doesn't simply setting `text-decoration:none` on the pseudo-element work? Because that's how text-decoration propagation has been spec'd in CSS.)
  // IE9-11 suffer from a bug which prevents that solution from working.
  // For them, we apply a hack where we first set `text-decoration:underline` and then later set `text-decoration:none`, both on the pseudo-element.
  // This tricks IE into suppressing the underline.
  + .breadcrumb-item:hover::before {
    text-decoration: underline; // Part 1 of IE9-11 hack to suppress the underline
  }
  + .breadcrumb-item:hover::before {
    text-decoration: none; // Suppress underlining of the separator in IE9-11 (requires an earlier setting of `text-decoration:underline`)
  }

36
  &.active {
Mark Otto's avatar
Mark Otto committed
37
38
39
    color: $breadcrumb-active-color;
  }
}