_sub-nav.scss 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. // Foundation by ZURB
  2. // foundation.zurb.com
  3. // Licensed under MIT Open Source
  4. @import 'global';
  5. //
  6. // @name _sub-nav.scss
  7. // @dependencies _global.scss
  8. //
  9. //
  10. // @variables
  11. //
  12. $include-html-nav-classes: $include-html-classes !default;
  13. // We use these to control margin and padding
  14. $sub-nav-list-margin: rem-calc(-4 0 18) !default;
  15. $sub-nav-list-padding-top: rem-calc(4) !default;
  16. // We use this to control the definition
  17. $sub-nav-font-family: $body-font-family !default;
  18. $sub-nav-font-size: rem-calc(14) !default;
  19. $sub-nav-font-color: $aluminum !default;
  20. $sub-nav-font-weight: $font-weight-normal !default;
  21. $sub-nav-text-decoration: none !default;
  22. $sub-nav-padding: rem-calc(3 16) !default;
  23. $sub-nav-border-radius: 3px !default;
  24. $sub-nav-font-color-hover: scale-color($sub-nav-font-color, $lightness: -25%) !default;
  25. // We use these to control the active item styles
  26. $sub-nav-active-font-weight: $font-weight-normal !default;
  27. $sub-nav-active-bg: $primary-color !default;
  28. $sub-nav-active-bg-hover: scale-color($sub-nav-active-bg, $lightness: -14%) !default;
  29. $sub-nav-active-color: $white !default;
  30. $sub-nav-active-padding: $sub-nav-padding !default;
  31. $sub-nav-active-cursor: default !default;
  32. $sub-nav-item-divider: "" !default;
  33. $sub-nav-item-divider-margin: rem-calc(12) !default;
  34. //
  35. // @mixins
  36. //
  37. // Create a sub-nav item
  38. //
  39. // $font-color - Font color. Default: $sub-nav-font-color.
  40. // $font-size - Font size. Default: $sub-nav-font-size.
  41. // $active-bg - Background of active nav item. Default: $sub-nav-active-bg.
  42. // $active-bg-hover - Background of active nav item, when hovered. Default: $sub-nav-active-bg-hover.
  43. @mixin sub-nav(
  44. $font-color: $sub-nav-font-color,
  45. $font-size: $sub-nav-font-size,
  46. $active-bg: $sub-nav-active-bg,
  47. $active-bg-hover: $sub-nav-active-bg-hover) {
  48. display: block;
  49. margin: $sub-nav-list-margin;
  50. overflow: hidden;
  51. padding-top: $sub-nav-list-padding-top;
  52. width: auto;
  53. dt {
  54. text-transform: uppercase;
  55. }
  56. dt,
  57. dd,
  58. li {
  59. color: $font-color;
  60. float: $default-float;
  61. font-family: $sub-nav-font-family;
  62. font-size: $font-size;
  63. font-weight: $sub-nav-font-weight;
  64. margin-#{$default-float}: rem-calc(16);
  65. margin-bottom: 0;
  66. a {
  67. color: $sub-nav-font-color;
  68. padding: $sub-nav-padding;
  69. text-decoration: $sub-nav-text-decoration;
  70. &:hover {
  71. color: $sub-nav-font-color-hover;
  72. }
  73. }
  74. &.active a {
  75. @include radius($sub-nav-border-radius);
  76. background: $active-bg;
  77. color: $sub-nav-active-color;
  78. cursor: $sub-nav-active-cursor;
  79. font-weight: $sub-nav-active-font-weight;
  80. padding: $sub-nav-active-padding;
  81. &:hover {
  82. background: $active-bg-hover;
  83. }
  84. }
  85. @if $sub-nav-item-divider != "" {
  86. margin-#{$default-float}: 0;
  87. &:before {
  88. content: "#{$sub-nav-item-divider}";
  89. margin: 0 $sub-nav-item-divider-margin;
  90. }
  91. &:first-child:before {
  92. content: "";
  93. margin: 0;
  94. }
  95. }
  96. }
  97. }
  98. @include exports("sub-nav") {
  99. @if $include-html-nav-classes {
  100. .sub-nav { @include sub-nav; }
  101. }
  102. }