Overriding Bootstrap's @breadcrumb-separator
Asked Answered
L

3

7

I thought it's possible to replace the @breadcrumb-separator temporarily, but unfortunately it doesn't work that way:

#detailnavigation {
  @breadcrumb-separator: "|";
  .list-inline.related {
    .breadcrumb;
  }
}

Isn't it possible to override a variable in a given scope? Or is the problem that .breadcrumb isn't a mixin?

Lareine answered 11/10, 2013 at 14:6 Comment(2)
Hi Jim, I see the @breadcrumb-separator variable in L15 of their breadcrumbs.less github.com/twbs/bootstrap/blob/master/less/breadcrumbs.less#L15Lareine
sorry, removed my answer because I misunderstood your question...not sure about overriding LESS variables within a particular div, but I'll see if I can find anything :)Demantoid
L
9

FYI I temporarily solved my problem by overriding the Separator manually. There you go:

#detailnavigation {
  .list-inline.related {
    .breadcrumb;
    
    > li+li:before {
      content: "|\00a0"; 
    }
  }
}
Lareine answered 11/10, 2013 at 14:35 Comment(0)
R
3

A bit shorter; here an example for ">"

.breadcrumb>li+li:before { padding: 0 5px; color: #ccc; content: ">"; }
Rhonarhonchus answered 16/3, 2015 at 9:17 Comment(0)
A
2

Bootstrap 5:

:root {
    --bs-breadcrumb-divider: '>';
}
Ambit answered 3/9, 2023 at 10:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.