UNPKG

@hashicorp/react-subnav

Version:

Displays a navigation bar, with links and a call-to-action.

83 lines (70 loc) 1.44 kB
/** * Copyright (c) HashiCorp, Inc. * SPDX-License-Identifier: MPL-2.0 */ /* Note: consumes from theme.module.css, as marked */ .root { display: flex; padding: 0 32px; margin: 0 auto; align-items: center; list-style: none; &.alignRight { margin-right: 0; padding-right: 16px; } } .listItem { position: relative; white-space: nowrap; margin: 0; padding: 0; } .navLink { composes: g-type-body-small-strong from global; position: relative; padding: 0 16px; line-height: 2.5rem; display: flex; align-items: center; white-space: nowrap; } .submenuItem { composes: g-type-body-small-strong from global; color: var(--menu-item-text-color); /* from theme.module.css */ &:hover { text-decoration: underline; } } .submenuModal { border-radius: 4px; box-shadow: var(--dropdown-box-shadow); /* from theme.module.css */ background: var(--dropdown-background-color); /* from theme.module.css */ z-index: 1; display: block; position: absolute; top: 100%; margin: 8px 0 0 0; padding: 24px; left: 50%; transform: translateX(-50%); list-style: none; & li { & a:hover .text { text-decoration: underline; } & + li { margin-top: 6px; } } &.isCollapsed { display: none; } } .verticalDivider { background: var(--border-color); /* from theme.module.css */ height: 1.75rem; width: 1px; margin: 0 8px; display: block; }