MediaWiki:Common.css: Difference between revisions

mNo edit summary
m auto hide sidebar < 768 pix
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
/** CSS placed here will be applied to all skins */
/** CSS placed here will be applied to all skins */


/* -------------------------
  Fonts
  ------------------------- */
@font-face {
@font-face {
     font-family:"Gotham-Black";
     font-family: "Gotham-Black";
     src:url("/styles/Gotham-Black.otf")
     src: url("/styles/Gotham-Black.otf") format("opentype");
}
}


@font-face {
@font-face {
     font-family:"Gotham-BlackItalic";
     font-family: "Gotham-BlackItalic";
     src:url("/styles/Gotham-BlackItalic.otf")
     src: url("/styles/Gotham-BlackItalic.otf") format("opentype");
}
}


@font-face {
@font-face {
     font-family:"Gotham-Bold";
     font-family: "Gotham-Bold";
     src:url("/styles/Gotham-Bold.otf")
     src: url("/styles/Gotham-Bold.otf") format("opentype");
}
}
@font-face {
@font-face {
     font-family:"Gotham-BoldItalic";
     font-family: "Gotham-BoldItalic";
     src:url("/styles/Gotham-BoldItalic.otf")
     src: url("/styles/Gotham-BoldItalic.otf") format("opentype");
}
}


@font-face {
@font-face {
     font-family:"Gotham-Book";
     font-family: "Gotham-Book";
     src:url("/styles/Gotham-Book.otf")
     src: url("/styles/Gotham-Book.otf") format("opentype");
}
}


@font-face {
@font-face {
     font-family:"Gotham-BookItalic";
     font-family: "Gotham-BookItalic";
     src:url("/styles/Gotham-BookItalic.otf")
     src: url("/styles/Gotham-BookItalic.otf") format("opentype");
}
}
h1, h2, h3, h4, h5, h6 { font-family:Gotham-Book;  
 
                        /* text-transform: uppercase; */
/* Base typography */
body {
    font-family: "Gotham-Book", Montserrat, sans-serif;
    max-width: 1366px;
}
}
body {font-family:Gotham-Book;Montserrat}


.mw-body h1,.mw-body h2,.mw-body h3, .mw-body h4,.mw-body h5 {font-family:Gotham-Book,Montserrat}
h1, h2, h3, h4, h5, h6 {
    font-family: "Gotham-Book", Montserrat, sans-serif;
    /* text-transform: uppercase; */
}


.mw-body h1,
.mw-body h2,
.mw-body h3,
.mw-body h4,
.mw-body h5 {
    font-family: "Gotham-Book", Montserrat, sans-serif;
}


/* Headline box */
.mw-headline {
    font-family: "Gotham-Bold", "Gotham-Book", Montserrat, sans-serif;
    background: #ffffff;
    /* previous alternatives:
      background: #cef2e0;
      background-color: #CCFFCC;
      border-radius: 5px;
      border: 1px outset #008080;
    */
    padding: 2px;
    width: 300px;
}


.mw-headline
/* Hide structured data block if present */
{
.structuredData {
font-family: "Gotham-Bold","Gotham-Book" , Montserrat, sans-serif;
    display: none;
/*font-size: 14px; */
/*font-weight: bold;*/
/*color: #008080;*/
background:#ffffff;
//background:#cef2e0;
// background-color: #CCFFCC;
// border-radius: 5px;
//border: 1px outset #008080;
padding: 2px;
width: 300px;
}
}
.structuredData {display:none}


td {vertical-align:top}
/* Table cell vertical alignment */
td {
    vertical-align: top;
}


body {
/* ****************** NO TITLE ON MAINPAGE *************** */
max-width:1366px;  
/* Adjust page name(s) to match your actual main page slug(s) */
/*
.page-Bose_Portable_PA_Knowledge.action-view h1.firstHeading,
.page-Bose_Portable_PA_Knowledge.action-submit h1.firstHeading {
    display: none;
}
}
/* max-width of text on page
body {max-width:1366px;}
html {max-width:1366px;}
.mw-body-content {max-width:1366px;}
*/
*/
 
/* Responsive images */
 
/* ****************** NO TITLE ON MAINPAGE *************** */
body.page-The_Bose_Professional_Portable_PA_Encyclopedia_FAQ_Wiki.action-view h1.firstHeading, body.page-The_Bose_Professional_Portable_PA_Encyclopedia_FAQ_Wiki.action-submit h1.firstHeading { display: none; }
 
 
 
/* responsive image sizing */
img {
img {
  max-width: 100%;
    max-width: 100%;
  height: auto;
    height: auto;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
}
/* DivToc: responsive table of contents with introduction */
/* DivToc: responsive table of contents with introduction */
.tocdiv {
.tocdiv {
     max-width: 1366px;
     max-width: 1366px;
     display: grid;
     display: grid;
     grid-gap: 15px;
     grid-gap: 15px;
     column-gap: 30px; /* Add this line */
     column-gap: 30px;
     grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
     grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
     grid-template-rows: auto;
     grid-template-rows: auto;
}
}


/* Mobile fix for DivToc layout */
/* Mobile fix for DivToc layout */
Line 108: Line 126:
     }
     }
}
}


/* Power Characters */
/* Power Characters */
@font-face {
@font-face {
     font-family: 'power_symbols';
     font-family: 'power_symbols';
     src: url('/fonts/unicode/Unicode_IEC_symbol.ttf') format('ttf'),
     src: url('/fonts/unicode/Unicode_IEC_symbol.woff2') format('woff2'),
         url('/fonts/unicode/Unicode_IEC_symbol.woff2') format('woff2'),
         url('/fonts/unicode/Unicode_IEC_symbol.woff') format('woff'),
         url('/fonts/unicode/Unicode_IEC_symbol.woff') format('woff');
         url('/fonts/unicode/Unicode_IEC_symbol.ttf') format('truetype');
     font-weight: normal;
     font-weight: normal;
     font-style: normal;
     font-style: normal;
}
}


.power{
.power {
  font-family: 'power_symbols';
    font-family: 'power_symbols';
  font-style: normal;
    font-style: normal;
}
}


/* ---------- Link colors (LVHA order) ---------- */
/* ---------- Link colors (LVHA order) ---------- */
Line 138: Line 153:
.mw-body-content a.extiw { color: #3366BB; }
.mw-body-content a.extiw { color: #3366BB; }
.mw-body-content a.stub { color: #772233; }
.mw-body-content a.stub { color: #772233; }
/* no right click */
img {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
/* l1 comparison table */


/* === L1 comparison table scroll container === */
/* === L1 comparison table scroll container === */
.mw-parser-output .l1-compare-wrap {
.mw-parser-output .l1-compare-wrap {
  display: block;
    display: block;
  overflow-x: auto;
    overflow-x: auto;
  overflow-y: visible;
    overflow-y: visible;
  width: 100%;
    width: 100%;
  max-width: 100%;
    max-width: 100%;
  -webkit-overflow-scrolling: touch;
    -webkit-overflow-scrolling: touch;
  background: #ffffff;
    background: #ffffff;
}
}


/* === CRITICAL OVERRIDE: defeat Vector/Minerva table width clamp === */
/* === CRITICAL OVERRIDE: defeat Vector/Minerva table width clamp === */
.mw-parser-output .l1-compare-wrap table.l1-compare {
.mw-parser-output .l1-compare-wrap table.l1-compare {
  white-space: nowrap;
    white-space: nowrap;
  width: max-content;
    width: max-content;
  min-width: 1400px;
    min-width: 1400px;
  max-width: none !important;  /* ← THIS is the blocker you were hitting */
    max-width: none !important;  /* ensure table can overflow horizontally */
  border-collapse: separate;
    border-collapse: separate;
  border-spacing: 0;
    border-spacing: 0;
}
}


/* === Sticky header row === */
/* === Sticky header row === */
.mw-parser-output .l1-compare-wrap table.l1-compare th {
.mw-parser-output .l1-compare-wrap table.l1-compare th {
  position: sticky;
    position: sticky;
  top: 0;
    top: 0;
  background: #f8f9fa;
    background: #f8f9fa;
  color: #202122;
    color: #202122;
  z-index: 10;
    z-index: 10;
}
}


Line 184: Line 187:
.mw-parser-output .l1-compare-wrap table.l1-compare th:first-child,
.mw-parser-output .l1-compare-wrap table.l1-compare th:first-child,
.mw-parser-output .l1-compare-wrap table.l1-compare td:first-child {
.mw-parser-output .l1-compare-wrap table.l1-compare td:first-child {
  position: sticky;
    position: sticky;
  left: 0;
    left: 0;
  background: #ffffff;
    background: #ffffff;
  z-index: 9;
    z-index: 9;
  border-right: 1px solid #a2a9b1;
    border-right: 1px solid #a2a9b1;
}
}


/* === Image display on hover over text === */
/* === Image display on hover over text === */
.hover-image-wrapper {
.hover-image-wrapper {
  position: relative;
    position: relative;
  display: inline-block;
    display: inline-block;
  cursor: help;
    cursor: help;
}
}


.hover-image-popup {
.hover-image-popup {
  position: absolute;
    position: absolute;
  top: 1.2em;
    top: 1.2em;
  left: 0;
    left: 0;
  z-index: 9999;
    z-index: 9999;
 
    background: #fff;
  background: #fff;
    padding: 4px;
  padding: 4px;
    border: 1px solid #ccc;
  border: 1px solid #ccc;
    visibility: hidden !important;
 
    opacity: 0 !important;
  visibility: hidden !important;
    pointer-events: none !important;
  opacity: 0 !important;
    transition: opacity 0.15s ease-in-out;
  pointer-events: none !important;
 
  transition: opacity 0.15s ease-in-out;
}
}


.hover-image-wrapper:hover .hover-image-popup {
.hover-image-wrapper:hover .hover-image-popup {
  visibility: visible !important;
    visibility: visible !important;
  opacity: 1 !important;
    opacity: 1 !important;
  pointer-events: auto !important;
    pointer-events: auto !important;
}
}


/* MediaWiki:Common.js
/* Hide page action tabs for users who are NOT logged in
  Lightweight fallback mobile menu
  Uses body:not(.mw-user) because this site does not use mw-anonuser/logged-in */
  Activates only when Minerva/native mobile menu is not present
body:not(.mw-user) #p-views,
*/
body:not(.mw-user) #p-views > ul,
body:not(.mw-user) #p-views > ul > li,
body:not(.mw-user) #left-navigation,
body:not(.mw-user) #right-navigation,
body:not(.mw-user) .vector-page-tools,
body:not(.mw-user) .vector-page-tools .vector-menu-content,
body:not(.mw-user) .vector-page-tools .vector-menu-content > li,
body:not(.mw-user) .vector-menu-tabs,
body:not(.mw-user) .vector-menu-tabs ul,
body:not(.mw-user) .vector-menu-tabs li,
body:not(.mw-user) .minerva-page-actions,
body:not(.mw-user) .minerva-page-actions li,
body:not(.mw-user) .page-actions-menu,
body:not(.mw-user) .page-actions-menu li {
    display: none !important;
}


mw.hook('wikipage.content').add(function () {
/* Ensure TOC is visible unless explicitly hidden elsewhere */
  // Only run on narrow screens
#toc, .toc {
  if (window.innerWidth > 800) return;
    display: block !important;
 
}
  // If native Minerva menu exists, do nothing
@media (max-width: 768px) {
   if (document.querySelector('.minerva-menu-button, .minerva-hamburger, .mw-mobile-menu')) return;
   .vector-sidebar, .mw-sidebar {
 
    transform: translateX(-100%);
  // Avoid injecting twice
    transition: transform .25s ease;
  if (document.querySelector('.fallback-mobile-hamburger')) return;
    position: fixed;
 
    left: 0;
  // Create hamburger button
    top: 0;
  var btn = document.createElement('button');
    height: 100%;
  btn.className = 'fallback-mobile-hamburger';
    z-index: 9999;
  btn.type = 'button';
    background: var(--bg-color, #fff);
  btn.setAttribute('aria-label', 'Open menu');
     box-shadow: 0 0 12px rgba(0,0,0,.2);
  btn.setAttribute('aria-expanded', 'false');
  btn.innerHTML = '&#9776;';
 
  // Insert into header area (best-effort)
  var header = document.querySelector('.minerva-header') || document.querySelector('#mw-head') || document.body;
  try {
     header.insertBefore(btn, header.firstChild);
  } catch (e) {
    document.body.appendChild(btn);
   }
   }
 
   .vector-sidebar.open {
  // Create overlay and panel
     transform: translateX(0);
  var overlay = document.createElement('div');
  overlay.className = 'fallback-mobile-overlay';
  overlay.setAttribute('role', 'dialog');
  overlay.setAttribute('aria-modal', 'true');
  overlay.style.display = 'none';
 
  var panel = document.createElement('nav');
  panel.className = 'fallback-mobile-panel';
  panel.setAttribute('aria-label', 'Mobile menu');
  panel.setAttribute('role', 'menu');
 
   overlay.appendChild(panel);
 
  // Close control
  var close = document.createElement('div');
  close.className = 'fallback-mobile-close';
  close.innerHTML = '<a href="#" aria-label="Close menu">✕</a>';
  panel.appendChild(close);
 
  // Menu links — mirror typical Mobile-menu entries
  var links = [
    { href: mw.util.getUrl('Main_Page'), label: 'Home' },
    { href: mw.util.getUrl('Special:Search'), label: 'Search' },
    { href: mw.util.getUrl('Recentchanges'), label: 'Recent changes' },
    { href: mw.util.getUrl('Special:Random'), label: 'Random page' },
    { href: mw.util.getUrl('Special:AllPages'), label: 'All pages' },
    { href: mw.util.getUrl('Special:Categories'), label: 'Categories' },
    { href: mw.util.getUrl('Special:Upload'), label: 'Upload file' }
  ];
 
  links.forEach(function (lnk) {
    var a = document.createElement('a');
    a.href = lnk.href;
    a.textContent = lnk.label;
    a.setAttribute('role', 'menuitem');
    a.tabIndex = 0;
    panel.appendChild(a);
  });
 
  document.body.appendChild(overlay);
 
  // Focus management helpers
  function trapFocus(container) {
     var focusable = container.querySelectorAll('a, button, [tabindex]:not([tabindex="-1"])');
    if (!focusable.length) return null;
    var first = focusable[0];
    var last = focusable[focusable.length - 1];
 
    function handleTab(e) {
      if (e.key !== 'Tab') return;
      if (e.shiftKey && document.activeElement === first) {
        e.preventDefault();
        last.focus();
      } else if (!e.shiftKey && document.activeElement === last) {
        e.preventDefault();
        first.focus();
      }
    }
    document.addEventListener('keydown', handleTab);
    return function remove() { document.removeEventListener('keydown', handleTab); };
   }
   }
 
  /* Add space for a toggle button */
   var removeTrap = null;
   .vector-main-content { padding-left: 0 !important; }
 
   .sidebar-toggle {
   function openMenu() {
     position: fixed;
     overlay.style.display = 'flex';
    left: 8px;
     document.body.style.overflow = 'hidden';
     top: 8px;
     btn.setAttribute('aria-expanded', 'true');
     z-index: 10001;
     // focus first link
     background: #fff;
     var firstLink = panel.querySelector('a');
     border-radius: 4px;
     if (firstLink) firstLink.focus();
     padding: 6px;
     removeTrap = trapFocus(panel);
     box-shadow: 0 1px 4px rgba(0,0,0,.2);
   }
   }
  function closeMenu() {
    overlay.style.display = 'none';
    document.body.style.overflow = '';
    btn.setAttribute('aria-expanded', 'false');
    if (removeTrap) { removeTrap(); removeTrap = null; }
    btn.focus();
  }
  // Event listeners
  btn.addEventListener('click', function (e) {
    e.preventDefault();
    openMenu();
  });
  overlay.addEventListener('click', function (e) {
    if (e.target === overlay) closeMenu();
  });
  close.addEventListener('click', function (e) {
    e.preventDefault();
    closeMenu();
  });
  // Close on Escape
  document.addEventListener('keydown', function (e) {
    if (e.key === 'Escape' && overlay.style.display === 'flex') {
      closeMenu();
    }
  });
  // If viewport is resized to desktop, remove fallback elements
  window.addEventListener('resize', function () {
    if (window.innerWidth > 800) {
      if (overlay.parentNode) overlay.parentNode.removeChild(overlay);
      if (btn.parentNode) btn.parentNode.removeChild(btn);
      document.body.style.overflow = '';
    }
  });
});
/* ============================================================
  Hide all page action tabs for users who are NOT logged in
  Works for: Vector, Vector-2022, MinervaNeue
  ============================================================ */
/* Vector (Legacy) */
body:not(.logged-in) #p-views,
body:not(.logged-in) #p-views ul,
body:not(.logged-in) #p-views li,
body:not(.logged-in) .vector-menu-tabs,
body:not(.logged-in) .vector-menu-tabs ul,
body:not(.logged-in) .vector-menu-tabs li {
    display: none !important;
}
/* Vector-2022 */
body:not(.logged-in) .vector-page-tools,
body:not(.logged-in) .vector-page-tools .vector-menu-content,
body:not(.logged-in) .vector-page-tools .vector-menu-content li,
body:not(.logged-in) .vector-actions,
body:not(.logged-in) .vector-actions li {
    display: none !important;
}
/* MinervaNeue */
body:not(.logged-in) .minerva-page-actions,
body:not(.logged-in) .minerva-page-actions li,
body:not(.logged-in) .page-actions-menu,
body:not(.logged-in) .page-actions-menu li {
    display: none !important;
}
/* nuclear */
/* ============================================================
  FORCE HIDE all page action tabs for NOT-logged-in users
  Works for: Vector, Vector-2022, MinervaNeue
  ============================================================ */
/* Vector legacy + Vector-2022: hide entire views portlet */
body:not(.logged-in) #p-views,
body:not(.logged-in) #p-views > ul,
body:not(.logged-in) #p-views > ul > li {
    display: none !important;
}
/* Vector legacy: hide left/right navigation action areas */
body:not(.logged-in) #left-navigation,
body:not(.logged-in) #right-navigation {
    display: none !important;
}
/* Vector-2022: hide new action containers */
body:not(.logged-in) .vector-actions,
body:not(.logged-in) .vector-actions > li,
body:not(.logged-in) .vector-page-tools,
body:not(.logged-in) .vector-page-tools .vector-menu-content,
body:not(.logged-in) .vector-page-tools .vector-menu-content > li {
    display: none !important;
}
/* Minerva (already working, but included for completeness) */
body:not(.logged-in) .minerva-page-actions,
body:not(.logged-in) .minerva-page-actions li,
body:not(.logged-in) .page-actions-menu,
body:not(.logged-in) .page-actions-menu li {
    display: none !important;
}
}