_nav.scss 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. // Base class
  2. //
  3. // Kickstart any navigation component with a set of style resets. Works with
  4. // `<nav>`s or `<ul>`s.
  5. .nav {
  6. display: flex;
  7. flex-wrap: wrap;
  8. padding-left: 0;
  9. margin-bottom: 0;
  10. list-style: none;
  11. }
  12. .nav-link {
  13. display: block;
  14. padding: $nav-link-padding-y $nav-link-padding-x;
  15. @include hover-focus {
  16. text-decoration: none;
  17. }
  18. // Disabled state lightens text
  19. &.disabled {
  20. color: $nav-link-disabled-color;
  21. pointer-events: none;
  22. cursor: default;
  23. }
  24. }
  25. //
  26. // Tabs
  27. //
  28. .nav-tabs {
  29. border-bottom: $nav-tabs-border-width solid $nav-tabs-border-color;
  30. .nav-item {
  31. margin-bottom: -$nav-tabs-border-width;
  32. }
  33. .nav-link {
  34. border: $nav-tabs-border-width solid transparent;
  35. @include border-top-radius($nav-tabs-border-radius);
  36. @include hover-focus {
  37. border-color: $nav-tabs-link-hover-border-color;
  38. }
  39. &.disabled {
  40. color: $nav-link-disabled-color;
  41. background-color: transparent;
  42. border-color: transparent;
  43. }
  44. }
  45. .nav-link.active,
  46. .nav-item.show .nav-link {
  47. color: $nav-tabs-link-active-color;
  48. background-color: $nav-tabs-link-active-bg;
  49. border-color: $nav-tabs-link-active-border-color;
  50. }
  51. .dropdown-menu {
  52. // Make dropdown border overlap tab border
  53. margin-top: -$nav-tabs-border-width;
  54. // Remove the top rounded corners here since there is a hard edge above the menu
  55. @include border-top-radius(0);
  56. }
  57. }
  58. //
  59. // Pills
  60. //
  61. .nav-pills {
  62. .nav-link {
  63. @include border-radius($nav-pills-border-radius);
  64. }
  65. .nav-link.active,
  66. .show > .nav-link {
  67. color: $nav-pills-link-active-color;
  68. background-color: $nav-pills-link-active-bg;
  69. }
  70. }
  71. //
  72. // Justified variants
  73. //
  74. .nav-fill {
  75. .nav-item {
  76. flex: 1 1 auto;
  77. text-align: center;
  78. }
  79. }
  80. .nav-justified {
  81. .nav-item {
  82. flex-basis: 0;
  83. flex-grow: 1;
  84. text-align: center;
  85. }
  86. }
  87. // Tabbable tabs
  88. //
  89. // Hide tabbable panes to start, show them when `.active`
  90. .tab-content {
  91. > .tab-pane {
  92. display: none;
  93. }
  94. > .active {
  95. display: block;
  96. }
  97. }