_breadcrumbs.scss 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. // Foundation by ZURB
  2. // foundation.zurb.com
  3. // Licensed under MIT Open Source
  4. @import "global";
  5. //
  6. // Breadcrumb Variables
  7. //
  8. $include-html-nav-classes: $include-html-classes !default;
  9. // We use this to set the background color for the breadcrumb container.
  10. $crumb-bg: scale-color($secondary-color, $lightness: 55%) !default;
  11. // We use these to set the padding around the breadcrumbs.
  12. $crumb-padding: rem-calc(9 14 9) !default;
  13. $crumb-side-padding: rem-calc(12) !default;
  14. // We use these to control border styles.
  15. $crumb-function-factor: -10% !default;
  16. $crumb-border-size: 1px !default;
  17. $crumb-border-style: solid !default;
  18. $crumb-border-color: scale-color($crumb-bg, $lightness: $crumb-function-factor) !default;
  19. $crumb-radius: $global-radius !default;
  20. // We use these to set various text styles for breadcrumbs.
  21. $crumb-font-size: rem-calc(11) !default;
  22. $crumb-font-color: $primary-color !default;
  23. $crumb-font-color-current: $oil !default;
  24. $crumb-font-color-unavailable: $aluminum !default;
  25. $crumb-font-transform: uppercase !default;
  26. $crumb-link-decor: underline !default;
  27. // We use these to control the slash between breadcrumbs
  28. $crumb-slash-color: $base !default;
  29. $crumb-slash: "/" !default;
  30. //
  31. // Breadcrumb Mixins
  32. //
  33. // We use this mixin to create a container around our breadcrumbs
  34. @mixin crumb-container {
  35. display: block;
  36. padding: $crumb-padding;
  37. overflow: hidden;
  38. margin-#{$default-float}: 0;
  39. list-style: none;
  40. border-style: $crumb-border-style;
  41. border-width: $crumb-border-size;
  42. // We control which background color and border come through.
  43. background-color: $crumb-bg;
  44. border-color: $crumb-border-color;
  45. }
  46. // We use this mixin to create breadcrumb styles from list items.
  47. @mixin crumbs {
  48. // A normal state will make the links look and act like clickable breadcrumbs.
  49. margin: 0;
  50. float: $default-float;
  51. font-size: $crumb-font-size;
  52. line-height: $crumb-font-size;
  53. text-transform: $crumb-font-transform;
  54. color: $crumb-font-color;
  55. &:hover a, &:focus a { text-decoration: $crumb-link-decor; }
  56. a {
  57. color: $crumb-font-color;
  58. }
  59. // Current is for the link of the current page
  60. &.current {
  61. cursor: $cursor-default-value;
  62. color: $crumb-font-color-current;
  63. a {
  64. cursor: $cursor-default-value;
  65. color: $crumb-font-color-current;
  66. }
  67. &:hover, &:hover a,
  68. &:focus, &:focus a { text-decoration: none; }
  69. }
  70. // Unavailable removed color and link styles so it looks inactive.
  71. &.unavailable {
  72. color: $crumb-font-color-unavailable;
  73. a { color: $crumb-font-color-unavailable; }
  74. &:hover,
  75. &:hover a,
  76. &:focus,
  77. a:focus {
  78. text-decoration: none;
  79. color: $crumb-font-color-unavailable;
  80. cursor: $cursor-disabled-value;
  81. }
  82. }
  83. &:before {
  84. content: "#{$crumb-slash}";
  85. color: $crumb-slash-color;
  86. margin: 0 $crumb-side-padding;
  87. position: relative;
  88. top: 1px;
  89. }
  90. &:first-child:before {
  91. content: " ";
  92. margin: 0;
  93. }
  94. }
  95. @include exports("breadcrumbs") {
  96. @if $include-html-nav-classes {
  97. .breadcrumbs {
  98. @include crumb-container;
  99. @include radius($crumb-radius);
  100. &>* {
  101. @include crumbs;
  102. }
  103. }
  104. }
  105. }
  106. /* Accessibility - hides the forward slash */
  107. [aria-label="breadcrumbs"] [aria-hidden="true"]:after {
  108. content: "/";
  109. }