<nav class="navbar navbar-expand-md navbar-light bg-light">

    <div class="navbar-wrapper" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">

            <li class="nav-item dropdown">
                <div class="button-wrapper">
                    <a class="nav-link dropdown-toggle" href="#">Page 1</a>
                    <button class="show-menu" id="Page 1_dropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fas fa-plus"></i><span class="sr-only">Show menu</span></button>
                    <div class="dropdown-menu" aria-labelledby="Page 1_dropdown">
                        <div class="dropdown_category">
                            <h2><a href="#">Group 1</a></h2>
                            <ul class="category_items">
                                <li>
                                    <a href="#">Subpage 1</a>

                                </li>
                                <li>
                                    <a href="#">Subpage 2</a>

                                </li>
                                <li>
                                    <a href="#">Subpage 3</a>

                                </li>
                            </ul>
                        </div>
                        <div class="dropdown_category">
                            <h2><a href="#">Group 2</a></h2>
                            <ul class="category_items">
                                <li>
                                    <a href="#">Subpage 1</a>

                                </li>
                                <li>
                                    <a href="#">Subpage 2</a>

                                </li>
                                <li>
                                    <a href="#">Subpage 3</a>

                                </li>
                                <li>
                                    <a href="#">Subpage 4</a>

                                </li>
                                <li>
                                    <a href="#">Subpage 5</a>

                                </li>
                            </ul>
                        </div>
                        <div class="dropdown_category">
                            <h2><a href="#">Group 3</a></h2>
                            <ul class="category_items">
                                <li>
                                    <a href="#">Subpage 1</a>

                                </li>
                                <li>
                                    <a href="#">Subpage 2</a>

                                </li>
                                <li>
                                    <a href="#">Subpage 3</a>

                                </li>
                            </ul>
                        </div>
                        <div class="dropdown_category">
                            <h2><a href="#">Group 4</a></h2>
                            <ul class="category_items">
                                <li>
                                    <a href="#">Subpage 1</a>

                                </li>
                                <li>
                                    <a href="#">Subpage 2</a>

                                </li>
                                <li>
                                    <a href="#">Subpage 3</a>

                                </li>
                            </ul>
                        </div>
                        <div class="dropdown_category buttons">
                            <a href="#" class="btn btn-primary " role="button">
                                <span class="button_text">Button 1</span>
                                <span class="arrow fal fa-chevron-right"></span>
                            </a>
                            <a href="#" class="btn btn-primary " role="button">
                                <span class="button_text">Button 2</span>
                                <span class="arrow fal fa-chevron-right"></span>
                            </a>
                            <a href="#" class="btn btn-primary " role="button">
                                <span class="button_text">Button 3</span>
                                <span class="arrow fal fa-chevron-right"></span>
                            </a>
                            <a href="#" class="btn btn-primary " role="button">
                                <span class="button_text">Button 4</span>
                                <span class="arrow fal fa-chevron-right"></span>
                            </a>
                        </div>
                    </div>
                </div>
            </li>

            <li class="nav-item">
                <a class="nav-link" href="#">Page 2</a>
            </li>

            <li class="nav-item">
                <a class="nav-link" href="#">Page 3</a>
            </li>

            <li class="nav-item">
                <a class="nav-link" href="#">Page 4</a>
            </li>

            <li class="nav-item">
                <a class="nav-link" href="#">Page 5</a>
            </li>
        </ul>
    </div>
</nav>
<nav class="navbar navbar-expand-{{ breakpoint }} navbar-light bg-light{% if sidebar %} right-bar{% endif %}">

  <div class="navbar-wrapper" id="navbarSupportedContent">
    {% if (sideNav == false) and (mainNav == false) %}
      {% include "@search_box" %}
    {% endif %}
    <ul class="navbar-nav mr-auto{% if sideNav == true %} flex-column side_nav{% endif %}">
      {% for nav_item in nav_items %}
        {% set active_nav = nav_item.active ? ' is-active' : '' %}
        {% set active_nav_sr = nav_item.active ? ' <span class="sr-only">(current)</span>' : '' %}
        {% set dropdown = nav_item.submenu_items ? ' dropdown' : '' %}
        {% set dropdown_toggle = nav_item.submenu_items ? ' dropdown-toggle' : ''%}
        {% set dropdown_id = nav_item.link_text ~ '_dropdown' %}

        <li class="nav-item{{ dropdown }}{{ active_nav }}">
          {% if nav_item.submenu_items %}
            <div class="button-wrapper">
          {% endif %}
            <a class="nav-link{{ active_nav }}{{ dropdown_toggle }}{% if nav_item.active_item_sg %} active{% endif %}" href="{{ nav_item.url }}">{{ nav_item.link_text }}{{ active_nav_sr }}</a>
          {% if nav_item.submenu_items %}
            <button class="show-menu" id="{{ dropdown_id }}" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fas fa-plus"></i><span class="sr-only">Show menu</span></button>
            <div class="dropdown-menu" aria-labelledby="{{ dropdown_id }}">
              {% for submenu_item in nav_item.submenu_items %}
                <div class="dropdown_category">
                  {% if submenu_item.heading %}<h2><a href="{{ submenu_item.heading_url }}">{{ submenu_item.heading }}</a></h2>{% endif %}
                  <ul class="category_items">
                    {% for category_item in submenu_item.category_items %}
                      <li{% if category_item.active_item_sg %} class="active-sublink"{% endif %}>
                        <a href="{{ category_item.url }}"{% if category_item.active_item_sg %} class="active"{% endif %}>{{ category_item.link_text }}</a>

                        {% if category_item.sub_category_items %}
                          {% set dropdown_subid = category_item.link_text ~ '_dropdown' %}
                          <div class="dropdown-menu third-level" aria-labelledby="{{ dropdown_id }}">
                            <ul class="category_items">
                              {% for sub_category_items in category_item.sub_category_items %}
                              <li{% if sub_category_items.active_item_sg %} class="active-sublink"{% endif %}>
                                <a href="{{ sub_category_items.url }}"{% if sub_category_items.active_item_sg %} class="active"{% endif %}>{{ sub_category_items.link_text }}</a>
                              </li>
                              {% endfor %}
                            </ul>
                          </div><!-- end dropdown-menu -->
                        {% endif %}
                      </li>
                    {% endfor %}
                  </ul>
                </div>
              {% endfor %}
              {% if nav_item.submenu_buttons %}
                <div class="dropdown_category buttons">
                  {% for submenu_button in nav_item.submenu_buttons %}
                    {% include "@a_tag" with {
                      text: submenu_button.text,
                      url: submenu_button.url
                    } %}
                  {% endfor %}
                </div>
              {% endif %}
            </div>
          </div>
          {% endif %}
        </li>
      {% endfor %}
    </ul>
  </div>
</nav>
{
  "breakpoint": "md",
  "sideNav": false,
  "nav_items": {
    "1": {
      "url": "#",
      "link_text": "Page 1",
      "submenu_items": {
        "1": {
          "heading": "Group 1",
          "heading_url": "#",
          "category_items": {
            "1": {
              "link_text": "Subpage 1",
              "url": "#"
            },
            "2": {
              "link_text": "Subpage 2",
              "url": "#"
            },
            "3": {
              "link_text": "Subpage 3",
              "url": "#"
            }
          }
        },
        "2": {
          "heading": "Group 2",
          "heading_url": "#",
          "category_items": {
            "1": {
              "link_text": "Subpage 1",
              "url": "#"
            },
            "2": {
              "link_text": "Subpage 2",
              "url": "#"
            },
            "3": {
              "link_text": "Subpage 3",
              "url": "#"
            },
            "4": {
              "link_text": "Subpage 4",
              "url": "#"
            },
            "5": {
              "link_text": "Subpage 5",
              "url": "#"
            }
          }
        },
        "3": {
          "heading": "Group 3",
          "heading_url": "#",
          "category_items": {
            "1": {
              "link_text": "Subpage 1",
              "url": "#"
            },
            "2": {
              "link_text": "Subpage 2",
              "url": "#"
            },
            "3": {
              "link_text": "Subpage 3",
              "url": "#"
            }
          }
        },
        "4": {
          "heading": "Group 4",
          "heading_url": "#",
          "category_items": {
            "1": {
              "link_text": "Subpage 1",
              "url": "#"
            },
            "2": {
              "link_text": "Subpage 2",
              "url": "#"
            },
            "3": {
              "link_text": "Subpage 3",
              "url": "#"
            }
          }
        }
      },
      "submenu_buttons": {
        "1": {
          "text": "Button 1",
          "url": "#"
        },
        "2": {
          "text": "Button 2",
          "url": "#"
        },
        "3": {
          "text": "Button 3",
          "url": "#"
        },
        "4": {
          "text": "Button 4",
          "url": "#"
        }
      }
    },
    "2": {
      "url": "#",
      "link_text": "Page 2"
    },
    "3": {
      "url": "#",
      "link_text": "Page 3"
    },
    "4": {
      "url": "#",
      "link_text": "Page 4"
    },
    "5": {
      "url": "#",
      "link_text": "Page 5"
    }
  }
}
  • Content:
    var Drupal = Drupal || {};
    (function ($, Drupal) {
        $(document).ready(function() {
            // add underline when '+' is clicked on a menu item
            $('.show-menu').click(function (){
                $('.show-menu').not(this).parent().parent().removeClass('open');
                $(this).parent().parent().toggleClass('open');
            });
    
            // remove underline when active menu item's '+' is clicked again
            $('.show-menu.open').click(function () {
            $('.show-menu').removeClass('open');
            });
        });
    }) (jQuery, Drupal);
    
  • URL: /components/raw/navbar/navbar.js
  • Filesystem Path: bits/04-components/_navbar/navbar.js
  • Size: 546 Bytes
  • Content:
    .navbar {
      &-expand-md {
        .navbar-nav {
          align-items: flex-end;
        }
      }
    
      &.bg-light {
        background-color: $grey_20 !important;
    
        .color-scheme-dark & {
          background-color: $dark_mode_grey !important;
        }
      }
    
      .nav-item {
        padding: 0.5rem;
        width: max-content;
        position: unset;
    
        .nav-link {
          color: $lehigh_brown !important;
          position: relative;
          margin: 0 auto;
          transition: all 0.2s ease-in-out;
          border: 0;
          font-weight: normal;
    
          .color-scheme-dark & {
            color: $white !important;
          }
        }
    
        &.active {
          .nav-link {
            border-bottom: solid 3px $accent_color;
            border-bottom: solid 3px var(--accent_color, $accent_color);
          }
        }
      }
    
      .dropdown-toggle {
        &::after {
          display: unset;
          margin-left: 0;
          vertical-align: 0;
          content: "";
          border-top: 0;
          border-right: 0;
          border-bottom: 0;
          border-left: 0;
        }
      }
    
      .dropdown {
        .button-wrapper {
          display: block;
    
          @include media-breakpoint-up(md) {
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
          }
    
          @include media-breakpoint-down(md) {
            text-align: right;
    
            .nav-link,
            .show-menu {
              display: inline-block;
            }
          }
    
          i {
            -webkit-transform: rotate(0deg);
            -moz-transform: rotate(0deg);
            -o-transform: rotate(0deg);
            -ms-transform: rotate(0deg);
            transform: rotate(0deg);
            -webkit-transition: all 0.2s ease;
            transition: all 0.2s ease;
    
            .color-scheme-dark & {
              color: $white;
            }
          }
    
          &.show {
            i {
              -webkit-transform: rotate(45deg);
              -moz-transform: rotate(45deg);
              -o-transform: rotate(45deg);
              -ms-transform: rotate(45deg);
              transform: rotate(45deg);
              -webkit-transition: 0.3s;
              -moz-transition: 0.3s;
              -o-transition: 0.3s;
              transition: 0.3s;
            }
          }
        }
      }
    
      .navbar-toggler {
        background-color: $grey_20 !important;
    
        .navbar-toggler-icon {
          background-color: $grey_20 !important;
        }
      }
    
      .navbar-collapse {
        @include media-breakpoint-down(sm) {
          margin: 0 0 $space_three 0;
        }
      }
    
      .search_icon {
        transition: all 0.2s ease-in-out;
    
        &:hover {
          box-shadow: unset;
    
          i {
            color: $gold;
            transition: all 0.2s ease-in-out;
          }
        }
      }
    }
    
    .dropdown-item {
      padding: $spacer $space_and_half;
      position: relative;
      margin: 0 auto;
      transition: all 0.2s ease-in-out;
    }
    
    .dropdown-menu {
      width: $max_screen_width;
      padding: $space_two $spacer $space_two $space_three;
      border: 0;
      box-shadow: 0 0.8rem 1rem rgba(0, 0, 0, 0.175);
      border-radius: 0;
    
      @include media-breakpoint-down(md) {
        margin: $spacer 0 0 0;
      }
    
      &.show {
        display: flex;
        flex-direction: column;
    
        @include media-breakpoint-up(md) {
          display: grid;
          grid-template-columns: auto auto auto auto auto;
          grid-gap: $spacer;
          grid-template-rows: auto;
        }
    
        @include media-breakpoint-down(md) {
          padding: 0 $spacer $spacer $spacer;
        }
    
        .color-scheme-dark & {
          background-color: $dark_mode_grey;
        }
    
        .dropdown_category {
          margin: $space_one_half 0;
          padding: 0 0 $space_one_half 0;
          border-bottom: 2px solid $background_darkmode;
    
          @include media-breakpoint-up(md) {
            margin: 0;
            padding: 0;
            border-bottom: 0;
          }
    
          &:last-of-type {
            padding: 0;
            border-bottom: 0;
          }
        }
      }
    
      .dropdown_category {
        &.buttons {
          display: flex;
          flex-direction: column;
          align-items: flex-end;
          grid-column: 5 / 6;
          grid-row: 1 / 3;
    
          .btn {
            background-color: $grey_light;
            color: $grey_darkest;
            font-weight: bold;
            border: 0;
            border-radius: 0;
            width: 200px;
            margin: 0 0 $spacer 0;
            text-align: left;
            position: relative;
          }
        }
    
        h2 {
          font-size: 1.125rem;
          color: $grey_darkest;
          margin: 0 0 $space_one_half 0;
    
          @include media-breakpoint-up(md) {
            margin: 0 0 $space_and_one_quarter 0;
          }
    
          .color-scheme-dark & {
            color: $white;
          }
    
          a {
            color: $grey_darkest;
            color: var(--grey_darkest, $grey_darkest);
            border-bottom: 2px solid $grey_darkest;
            border-bottom: 2px solid var(--grey_darkest, $grey_darkest);
            font-weight: normal;
    
            .color-scheme-dark & {
              color: $white;
              border-bottom: 2px solid $white;
              border-bottom: 2px solid var(--white, $white);
            }
    
            &:hover,
            &:focus {
              border-bottom: 0;
            }
          }
        }
    
        ul {
          @include reset-list-nav;
    
          li {
            a {
              font-size: 1rem;
              color: $grey_darkest;
              border-bottom: 0;
              text-decoration: none;
              font-weight: normal;
    
              .color-scheme-dark & {
                color: $white;
              }
    
              &:hover,
              &:focus {
                text-decoration: underline;
                @include transition;
              }
            }
          }
        }
      }
    
      &.third-level {
        position: relative !important;
        width: 100%;
        box-shadow: unset;
        padding: $spacer;
      }
    }
    
    .form-control {
      color: $grey_darkest;
    }
    
  • URL: /components/raw/navbar/navbar.scss
  • Filesystem Path: bits/04-components/_navbar/navbar.scss
  • Size: 5.4 KB

No notes defined.