Files
xrpl-dev-portal/styles/_top-nav.scss
2021-06-15 17:48:06 -07:00

283 lines
6.0 KiB
SCSS

/* Top navigation ----------------------------------------------------------- */
.top-nav {
background-color: $gray-900;
// Logo
.navbar-brand {
text-decoration: none;
white-space: pre;
-webkit-transition: opacity 200ms ease, color 200ms ease;
transition: opacity 200ms ease, color 200ms ease;
&:hover {
opacity: 0.75;
}
@include media-breakpoint-down(md) {
img {
width: 120px;
}
}
}
// Main Links ----------------------------------------------------------------
.navbar-nav {
.nav-link {
color: $white; // TODO: change to black-050
font-size: 1rem;
line-height: 1.25rem;
text-decoration: none;
font-weight: 600;
&.active a {
font-weight: 700;
box-shadow: inset 0 -1px 0 0 #000;
}
&.active-parent a {
font-weight: 700;
box-shadow: inset 0 -1px 0 0 #000;
}
&:focus {
outline: none;
}
@include media-breakpoint-only(lg) {
&.github-edit {
padding-left: 40px;
}
}
}
// Buttons in top nav
.btn-outline-secondary {
font-size: 14px;
line-height: 125%;
margin-top: 1rem;
}
@include media-breakpoint-down(md) {
.wrap-button {
padding: 1.5rem 0;
.btn {
display: inline;
padding: 1rem 1.25rem;
}
}
}
}
// Dropdowns -----------------------------------------------------------------
// (Mobile first)
.dropdown-toggle {
position: relative;
}
.dropdown.show {
.dropdown-toggle {
color: $gray-500;
}
}
.dropdown-menu {
border-width: 0;
h5 {
font-weight: 400;
font-size: 12px;
color: $gray-400;
margin-bottom: 0;
}
.dropdown-hero {
width: 100%;
display: flex;
> img {
width: 68px;
height: 68px;
background-color: $gray-800;
border-radius: $border-radius-sm;
flex-grow: 0;
padding: .75rem;
margin-right: 2rem;
}
p {
font-size: 14px;
color: $gray-300;
margin: 0;
}
}
}
// Desktop version
@include media-breakpoint-up(lg) {
padding: 0 7.5rem;
.dropdown-toggle {
&::after {
display: none;
}
span {
border-bottom: 2px solid transparent;
}
}
.dropdown:hover .dropdown-toggle span,
.dropdown:active .dropdown-toggle span {
border-bottom: 2px solid $blue-purple-400;
}
.dropdown-menu {
border-radius: 0 0 $border-radius-lg $border-radius-lg;
padding: 2.5rem;
&.show {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 40px;
.dropdown-hero {
grid-row: 1;
grid-column: 1 / 4;
}
// "About" dropdown placement
.col-for-xrp-ledger {
grid-row: 1 / 3;
grid-column: 1;
}
.col-for-xrp {
grid-column: 2;
}
.col-for-sustainability {
grid-column: 2;
}
.col-for-about {
grid-row: 1;
grid-column: 3;
}
// "Docs" dropdown placement
.col-for-article-types {
grid-column: 1;
grid-row: 2;
}
.col-for-online-tools {
grid-column: 1;
grid-row: 3;
}
.col-for-get-started {
grid-column: 2;
grid-row: 2 / 4;
}
// "Community" dropdown placement
// TODO
}
&.smaller-dropdown {
min-width: unset;
}
.dropdown-item {
line-height: 2rem;
padding: 0;
}
}
}
// Search bar & controls -----------------------------------------------------
#navbar-search {
.input-group-text,
.input-group > .input-group-append > .btn {
color: $white;
background-color: transparent;
border-width: 0;
}
.algolia-autocomplete {
flex-grow: 1;
}
#topsearchbox:focus {
box-shadow: none;
border-color: $white;
}
// Algolia Search results --------------------------------------------------
.algolia-autocomplete .ds-dropdown-menu [class^="ds-dataset-"] {
background-color: rgba(0,0,0,0.9);
border: 1px solid $gray-900;
border-radius: $border-radius-lg;
}
.algolia-autocomplete .ds-dropdown-menu::before {
background-color: rgba(0,0,0,0.9);
border-color: $gray-900;
}
.algolia-docsearch-suggestion {
background-color: rgba(0,0,0,0.9);
}
.algolia-autocomplete .algolia-docsearch-suggestion--category-header {
color: $white;
border: 0 solid $secondary;
border-bottom-width: 1px;
font-weight: bold;
}
.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column {
color: $white;
}
.algolia-autocomplete .algolia-docsearch-suggestion--title {
color: $white;
}
.algolia-autocomplete .algolia-docsearch-suggestion--text {
font-size: 0.8rem;
color: $gray-200;
}
.algolia-autocomplete .algolia-docsearch-suggestion--highlight {
color: $white;
background-color: $green-800;
}
@include media-breakpoint-down(md) {
.algolia-autocomplete .ds-dropdown-menu {
min-width: unset;
}
}
}
// Mobile --------------------------------------------------------------------
@include media-breakpoint-down(md) {
.navbar-brand {
padding-left: 15px;
}
.navbar-toggler {
border: 0;
padding: 0;
&:not(.collapsed) {
// Hack: turn white hamburger to approximately $green
filter: brightness(0.5) sepia(1) saturate(5000%) hue-rotate(114deg) brightness(1.96) saturate(87%);
}
}
.navbar-nav .nav-link {
line-height: 150%;
}
.github-edit-wrap .github-edit.nav-link {
background-image: unset;
padding-left: inherit;
}
}
// Language toggle -----------------------------------------------------------
.language-selector {
font-size: 0.875rem;
}
}