MediaWiki:Navbar.css: Difference between revisions

From The Seven Sages of Rome
No edit summary
Tag: Reverted
No edit summary
 
(22 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* Base navbar styling */
/* =========================================
  1. Base Navigation Containers
  ========================================= */
 
/* Main Navigation Wrapper */
#mw-navigation {
#mw-navigation {
z-index: 999;
    z-index: 999;
background-color: rgba(255, 255, 255, 1) !important;
    background-color: #FCFCFA !important;
padding: 0.5rem 2rem !important;
    padding: 0.5rem 2rem !important;
}
}


@media (max-width: 799px){
/* Specific link styling within the right nav */
#mw-navigation {
#mw-navigation .navbar-nav.right .nav-item:nth-of-type(2) > .nav-link {
  z-index: 999;
    font-weight: 600;
  background-color: rgba(255, 255, 255, 1) !important;
  padding: 0.5rem 0.5rem !important;
}
}
}


/* Top tier navbar styling */
/* Mobile adjustment for Main Navigation */
@media (max-width: 799px) {
    #mw-navigation {
        z-index: 999;
        background-color: #FCFCFA !important;
        padding: 0.5rem 0.5rem !important;
    }
}
 
 
/* =========================================
  2. Top Tier Navbar (.navbar-top)
  ========================================= */
 
/* Container styling */
.navbar-top {
.navbar-top {
     background-color: rgba(255, 255, 255, 1) !important;
     background-color: #FCFCFA !important;
     border-bottom: 1px solid #e5e7eb;
     border-bottom: 1px solid #e5e7eb;
     padding: 0.5rem 2rem;
     padding: 0.5rem 2rem;
Line 22: Line 37:
}
}


@media (max-width: 799px){
/* Brand/Logo */
.navbar-top {
  padding: 0.5rem 0.5rem;
}
}
 
.navbar-top .navbar-brand {
.navbar-top .navbar-brand {
     font-family: 'Playfair Display', Georgia, serif;
     font-family: 'Playfair Display', Georgia, serif;
Line 35: Line 45:
}
}


/* Alignment */
.navbar-top .navbar-collapse {
    align-items: end !important;
}
/* Specific nested link weight adjustment */
#mv-navigation > .navbar-collapse > .navbar-nav > div:nth-child(2) > a {
    font-weight: 800 !important;
}
/* Link Interactions */
.navbar-top .nav-link {
.navbar-top .nav-link {
     color: black !important;
     color: black !important;
Line 52: Line 73:
}
}


/* Second tier navbar (main MediaWiki navbar) - white background with borders */
/* Mobile adjustment for Top Navbar */
@media (max-width: 799px) {
    .navbar-top {
        padding: 0.5rem 0.5rem;
    }
}
 
 
/* =========================================
  3. Second Tier Navbar (MediaWiki Main)
  ========================================= */
 
/* Sticky positioning and borders */
.sticky-top:not(.navbar-top) {
.sticky-top:not(.navbar-top) {
     background-color: rgba(255, 255, 255, 1) !important;
     background-color: #FCFCFA !important;
    border-top: 1px solid #e5e7eb;
     border-bottom: 1px solid #e5e7eb;
     border-bottom: 1px solid #e5e7eb;
     top: 0;
     top: 0;
Line 62: Line 94:


.p-navbar {
.p-navbar {
     background-color: rgba(255, 255, 255, 1) !important;
     background-color: #FCFCFA !important;
}
}


.p-navbar.scrolled {
.p-navbar.scrolled {
  border-bottom: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}
}


/* Link Interactions */
.p-navbar .nav-link {
.p-navbar .nav-link {
  color: black !important;
    color: black !important;
}
}


.p-navbar .nav-link:hover {
.p-navbar .nav-link:hover {
  color: black !important;
    color: black !important;
  font-weight: 600 !important;
    font-weight: 600 !important;
}
}


.p-navbar .nav-link:active {
.p-navbar .nav-link:active {
  color: black !important;
    color: black !important;
  background: transparent !important;
    background: transparent !important;
  font-weight: 600 !important;
    font-weight: 600 !important;
}
 
.p-navbar .navbar-toggler,
.navbar-top .navbar-toggler {
color: rgb(0, 0, 0) !important;
border-color: rgba(0, 0, 0, 0.5) !important;
}
 
@media (min-width: 9000px){
    #mw-navigation {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
    }
    #mw-navigation .navbar-nav {
        flex-direction: row;
    }
    #mw-navigation .dropdown-menu {
        position: absolute;
    }
    #mw-navigation .nav-link {
        padding-right: .5rem;
        padding-left: .5rem;
    }
    #mw-navigation > .container {
        flex-wrap: nowrap;
    }
    #mw-navigation .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
    }
    #mw-navigation .navbar-toggler {
        display: none;
    }
}
}


@media (min-width: 1350px){
/* Custom Large Screen Breakpoint (Only for second tier) */
@media (min-width: 1350px) {
     .sticky-top:not(.navbar-top).navbar-expand-custom {
     .sticky-top:not(.navbar-top).navbar-expand-custom {
         flex-direction: row;
         flex-direction: row;
Line 146: Line 146:
}
}


/* Apply consistent padding to both navbars */
 
/* =========================================
  4. Shared Components & Layouts
  ========================================= */
 
/* Toggler Styling (Shared) */
.p-navbar .navbar-toggler,
.navbar-top .navbar-toggler {
    color: rgb(0, 0, 0) !important;
    border-color: rgba(0, 0, 0, 0.5) !important;
}
 
/* Container Padding (Shared) */
.navbar-top .container,
.navbar-top .container,
.navbar-horizontal .container {
.navbar-horizontal .container {
Line 153: Line 165:
}
}


@media (max-width: 799px){
/* Mobile adjustment for Container Padding */
@media (max-width: 799px) {
     .navbar-top .container,
     .navbar-top .container,
     .navbar-horizontal .container {
     .navbar-horizontal .container {
Line 159: Line 172:
         padding-right: 0.5rem;
         padding-right: 0.5rem;
     }
     }
}
/* Keep top tier sticky, and animate show/hide */
.js-navbar-top {
  position: sticky;
  top: 0;
  z-index: 1031; /* above typical content, near Bootstrap navbar */
  will-change: transform;
  transition: none !important;
}
/* Default state: hide top tier */
body.nav-updown-hide-top .js-navbar-top {
  transform: translateY(-100%);
}
/* Second tier should stick below the top tier when top tier is visible */
.js-navbar-main {
  position: sticky;          /* Bootstrap sticky-top does this, but keep explicit */
  top: var(--topbar-h, 0px); /* dynamic offset */
  z-index: 1030;
}
/* When top tier is hidden, second tier sticks at top */
body.nav-updown-hide-top {
  --topbar-h: 0px;
}
/* When top tier is shown, second tier is pushed down by its height */
body.nav-updown-show-top {
  /* --topbar-h is set by JS to exact px height */
}
/* Top tier */
.js-navbar-top {
  position: sticky;
  top: 0;
  z-index: 1031;
  will-change: transform;
  transition: transform 180ms ease;
}
body.nav-updown-hide-top .js-navbar-top {
  transform: translateY(-100%);
}
/* Second tier: must be pushed down when top tier is shown */
.sticky-top.js-navbar-main {
  top: var(--topbar-h, 0px) !important;
  z-index: 1030;
}
}

Latest revision as of 14:14, 18 February 2026

/* =========================================
   1. Base Navigation Containers
   ========================================= */

/* Main Navigation Wrapper */
#mw-navigation {
    z-index: 999;
    background-color: #FCFCFA !important;
    padding: 0.5rem 2rem !important;
}

/* Specific link styling within the right nav */
#mw-navigation .navbar-nav.right .nav-item:nth-of-type(2) > .nav-link {
    font-weight: 600;
}

/* Mobile adjustment for Main Navigation */
@media (max-width: 799px) {
    #mw-navigation {
        z-index: 999;
        background-color: #FCFCFA !important;
        padding: 0.5rem 0.5rem !important;
    }
}


/* =========================================
   2. Top Tier Navbar (.navbar-top)
   ========================================= */

/* Container styling */
.navbar-top {
    background-color: #FCFCFA !important;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.5rem 2rem;
    z-index: 1000;
}

/* Brand/Logo */
.navbar-top .navbar-brand {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 400;
    color: #000000;
}

/* Alignment */
.navbar-top .navbar-collapse {
    align-items: end !important;
}

/* Specific nested link weight adjustment */
#mv-navigation > .navbar-collapse > .navbar-nav > div:nth-child(2) > a {
    font-weight: 800 !important;
}

/* Link Interactions */
.navbar-top .nav-link {
    color: black !important;
    padding: 0.5rem 1rem;
    text-decoration: none;
}

.navbar-top .nav-link:hover {
    color: black !important;
    font-weight: 600 !important;
}

.navbar-top .nav-link:active {
    color: black !important;
    background: transparent !important;
    font-weight: 600 !important;
}

/* Mobile adjustment for Top Navbar */
@media (max-width: 799px) {
    .navbar-top {
        padding: 0.5rem 0.5rem;
    }
}


/* =========================================
   3. Second Tier Navbar (MediaWiki Main)
   ========================================= */

/* Sticky positioning and borders */
.sticky-top:not(.navbar-top) {
    background-color: #FCFCFA !important;
    border-bottom: 1px solid #e5e7eb;
    top: 0;
    z-index: 998;
}

.p-navbar {
    background-color: #FCFCFA !important;
}

.p-navbar.scrolled {
    border-bottom: 1px solid #e5e7eb;
}

/* Link Interactions */
.p-navbar .nav-link {
    color: black !important;
}

.p-navbar .nav-link:hover {
    color: black !important;
    font-weight: 600 !important;
}

.p-navbar .nav-link:active {
    color: black !important;
    background: transparent !important;
    font-weight: 600 !important;
}

/* Custom Large Screen Breakpoint (Only for second tier) */
@media (min-width: 1350px) {
    .sticky-top:not(.navbar-top).navbar-expand-custom {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
    }
    .sticky-top:not(.navbar-top).navbar-expand-custom .navbar-nav {
        flex-direction: row;
    }
    .sticky-top:not(.navbar-top).navbar-expand-custom .dropdown-menu {
        position: absolute;
    }
    .sticky-top:not(.navbar-top).navbar-expand-custom .nav-link {
        padding-right: .5rem;
        padding-left: .5rem;
    }
    .sticky-top:not(.navbar-top).navbar-expand-custom > .container {
        flex-wrap: nowrap;
    }
    .sticky-top:not(.navbar-top).navbar-expand-custom .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
    }
    .sticky-top:not(.navbar-top).navbar-expand-custom .navbar-toggler {
        display: none;
    }
}


/* =========================================
   4. Shared Components & Layouts
   ========================================= */

/* Toggler Styling (Shared) */
.p-navbar .navbar-toggler,
.navbar-top .navbar-toggler {
    color: rgb(0, 0, 0) !important;
    border-color: rgba(0, 0, 0, 0.5) !important;
}

/* Container Padding (Shared) */
.navbar-top .container,
.navbar-horizontal .container {
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Mobile adjustment for Container Padding */
@media (max-width: 799px) {
    .navbar-top .container,
    .navbar-horizontal .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Keep top tier sticky, and animate show/hide */
.js-navbar-top {
  position: sticky;
  top: 0;
  z-index: 1031; /* above typical content, near Bootstrap navbar */
  will-change: transform;
  transition: none !important;
}

/* Default state: hide top tier */
body.nav-updown-hide-top .js-navbar-top {
  transform: translateY(-100%);
}

/* Second tier should stick below the top tier when top tier is visible */
.js-navbar-main {
  position: sticky;          /* Bootstrap sticky-top does this, but keep explicit */
  top: var(--topbar-h, 0px); /* dynamic offset */
  z-index: 1030;
}

/* When top tier is hidden, second tier sticks at top */
body.nav-updown-hide-top {
  --topbar-h: 0px;
}

/* When top tier is shown, second tier is pushed down by its height */
body.nav-updown-show-top {
  /* --topbar-h is set by JS to exact px height */
}

/* Top tier */
.js-navbar-top {
  position: sticky;
  top: 0;
  z-index: 1031;
  will-change: transform;
  transition: transform 180ms ease;
}

body.nav-updown-hide-top .js-navbar-top {
  transform: translateY(-100%);
}

/* Second tier: must be pushed down when top tier is shown */
.sticky-top.js-navbar-main {
  top: var(--topbar-h, 0px) !important;
  z-index: 1030;
}