_breadcrumbs.scss 3.3 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. $crumb-slash-position: 1px !default;
  31. //
  32. // Breadcrumb Mixins
  33. //
  34. // We use this mixin to create a container around our breadcrumbs
  35. @mixin crumb-container {
  36. border-style: $crumb-border-style;
  37. border-width: $crumb-border-size;
  38. display: block;
  39. list-style: none;
  40. margin-#{$default-float}: 0;
  41. overflow: hidden;
  42. padding: $crumb-padding;
  43. // We control which background color and border come through.
  44. background-color: $crumb-bg;
  45. border-color: $crumb-border-color;
  46. }
  47. // We use this mixin to create breadcrumb styles from list items.
  48. @mixin crumbs {
  49. // A normal state will make the links look and act like clickable breadcrumbs.
  50. color: $crumb-font-color;
  51. float: $default-float;
  52. font-size: $crumb-font-size;
  53. line-height: $crumb-font-size;
  54. margin: 0;
  55. text-transform: $crumb-font-transform;
  56. &:hover a, &:focus a { text-decoration: $crumb-link-decor; }
  57. a {
  58. color: $crumb-font-color;
  59. }
  60. // Current is for the link of the current page
  61. &.current {
  62. color: $crumb-font-color-current;
  63. cursor: $cursor-default-value;
  64. a {
  65. color: $crumb-font-color-current;
  66. cursor: $cursor-default-value;
  67. }
  68. &:hover, &:hover a,
  69. &:focus, &:focus a { text-decoration: none; }
  70. }
  71. // Unavailable removed color and link styles so it looks inactive.
  72. &.unavailable {
  73. color: $crumb-font-color-unavailable;
  74. a { color: $crumb-font-color-unavailable; }
  75. &:hover,
  76. &:hover a,
  77. &:focus,
  78. a:focus {
  79. color: $crumb-font-color-unavailable;
  80. cursor: $cursor-disabled-value;
  81. text-decoration: none;
  82. }
  83. }
  84. &:before {
  85. color: $crumb-slash-color;
  86. content: "#{$crumb-slash}";
  87. margin: 0 $crumb-side-padding;
  88. position: relative;
  89. top: $crumb-slash-position;
  90. }
  91. &:first-child:before {
  92. content: " ";
  93. margin: 0;
  94. }
  95. }
  96. @include exports("breadcrumbs") {
  97. @if $include-html-nav-classes {
  98. .breadcrumbs {
  99. @include crumb-container;
  100. @include radius($crumb-radius);
  101. > * {
  102. @include crumbs;
  103. }
  104. }
  105. /* Accessibility - hides the forward slash */
  106. [aria-label="breadcrumbs"] [aria-hidden="true"]:after {
  107. content: "/";
  108. }
  109. }
  110. }