MediaWiki:Mobile.css: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
No edit summary |
No edit summary Tag: Reverted |
||
| Line 153: | Line 153: | ||
/* ======================================================= */ |
/* ======================================================= */ |
||
/* 2. FIXED TOP |
/* 2. FIXED TOP TOOLBAR (The "Mode Switch" Solution) */ |
||
/* ======================================================= */ |
/* ======================================================= */ |
||
/* --- A. |
/* --- A. READING MODE (The Sticky Toolbar) --- */ |
||
| ⚫ | |||
| ⚫ | |||
body:not(.mw-mf-search-mode) .header-container.header-chrome { |
|||
position: fixed !important; |
position: fixed !important; |
||
top: 0 !important; |
top: 0 !important; |
||
| Line 167: | Line 168: | ||
border-bottom: 1px solid #eaecf0 !important; |
border-bottom: 1px solid #eaecf0 !important; |
||
/* |
/* Force layout */ |
||
display: flex !important; |
|||
align-items: center; |
|||
| ⚫ | |||
| ⚫ | |||
transition: none !important; |
transition: none !important; |
||
overflow: visible !important; /* Allow search drawer to hang out the bottom */ |
|||
} |
} |
||
/* Push |
/* Push content down so it isn't hidden behind the bar */ |
||
body.skin-minerva { |
body.skin-minerva { |
||
padding-top: 50px !important; |
padding-top: 50px !important; |
||
| ⚫ | |||
.mw-body { |
|||
| ⚫ | |||
} |
} |
||
/* Hide |
/* Hide standard elements during reading mode */ |
||
.header-container .navigation-drawer, |
body:not(.mw-mf-search-mode) .header-container .navigation-drawer, |
||
body:not(.mw-mf-search-mode) .minerva-header .search-box { |
body:not(.mw-mf-search-mode) .minerva-header .search-box { |
||
display: none !important; |
display: none !important; |
||
} |
} |
||
/* --- B. |
/* --- B. CUSTOM BUTTONS (Visible ONLY when Reading) --- */ |
||
.branding-box, .branding-box a { |
|||
/* 1. HOME BUTTON (Left) */ |
|||
position: fixed !important; |
|||
| ⚫ | |||
top: 0 !important; |
|||
position: absolute !important; |
|||
top: 0; left: 0; |
|||
height: 50px |
width: 60px; height: 50px; |
||
| ⚫ | |||
display: flex !important; |
display: flex !important; |
||
align-items: center; |
align-items: center; justify-content: center; |
||
z-index: 1002; |
|||
| ⚫ | |||
body:not(.mw-mf-search-mode) .branding-box a { |
|||
| ⚫ | |||
} |
} |
||
| ⚫ | |||
| ⚫ | |||
content: "⌂"; font-size: 28px; color: #000; margin-top: -4px; |
|||
| ⚫ | |||
| ⚫ | |||
font-size: 28px; |
|||
color: #000; |
|||
margin-top: -4px; |
|||
} |
} |
||
/* |
/* 2. SEARCH TRIGGER (Center) */ |
||
#searchIcon { |
body:not(.mw-mf-search-mode) #searchIcon { |
||
position: |
position: absolute !important; |
||
top: 0 |
top: 0; left: 50%; |
||
transform: translateX(-50%); |
|||
| ⚫ | |||
transform: translateX(-50%) !important; |
|||
| ⚫ | |||
height: 50px !important; |
|||
z-index: 1002 !important; |
|||
display: flex !important; |
display: flex !important; |
||
align-items: center; |
align-items: center; justify-content: center; |
||
z-index: 1002; |
|||
background: transparent !important; |
background: transparent !important; |
||
border: none |
border: none; margin: 0; padding: 0; |
||
| ⚫ | |||
margin: 0 !important; padding: 0 !important; |
|||
| ⚫ | |||
} |
} |
||
#searchIcon .minerva-icon { |
body:not(.mw-mf-search-mode) #searchIcon .minerva-icon { |
||
font-size: 24px; |
font-size: 24px; color: #000; opacity: 0.7; |
||
color: #000; |
|||
opacity: 0.7; |
|||
} |
} |
||
/* |
/* 3. TOC BUTTON (Right) */ |
||
#cps-open-toc { |
body:not(.mw-mf-search-mode) #cps-open-toc { |
||
display: flex !important; |
display: flex !important; |
||
position: |
position: absolute !important; |
||
top: 3px |
top: 3px; right: 5px; |
||
bottom: auto; left: auto; |
|||
width: 44px; height: 44px; |
|||
z-index: 1002; |
|||
width: 44px !important; |
|||
height: 44px !important; |
|||
z-index: 1002 !important; |
|||
background: transparent !important; |
background: transparent !important; |
||
color: #000 !important; |
color: #000 !important; |
||
| Line 246: | Line 235: | ||
} |
} |
||
/* --- |
/* --- C. SEARCH MODE (The "Transparent" Fix) --- */ |
||
/* When search activates, we HIDE the custom buttons so they don't block the view */ |
|||
/* 1. |
/* 1. Hide the Custom Buttons */ |
||
body.mw-mf-search-mode .branding-box, |
|||
/* We force the entire form wrapper to drop down below the header */ |
|||
body.mw-mf-search-mode |
body.mw-mf-search-mode #searchIcon, |
||
body.mw-mf-search-mode #cps-open-toc { |
|||
display: block !important; |
|||
| ⚫ | |||
| ⚫ | |||
/* 2. Reset Header to allow Standard Search Bar */ |
|||
/* We remove the fixed height so the search bar can fit naturally */ |
|||
| ⚫ | |||
position: fixed !important; |
position: fixed !important; |
||
top: |
top: 0 !important; |
||
height: auto !important; /* Let it grow */ |
|||
min-height: 50px !important; |
|||
background-color: #ffffff !important; |
|||
z-index: 1000 !important; |
|||
border-bottom: 1px solid #eaecf0; |
|||
height: auto !important; |
|||
} |
} |
||
/* |
/* 3. Show the Real Search Bar */ |
||
body.mw-mf-search-mode .minerva-header .search-box { |
body.mw-mf-search-mode .minerva-header .search-box { |
||
display: block !important; |
display: block !important; |
||
opacity: 1 !important; |
|||
visibility: visible !important; |
|||
background: #fff !important; |
|||
padding: |
padding: 8px !important; |
||
background-color: #f0f0f0 !important; /* Grey drawer background */ |
|||
border-bottom: 1px solid #ccc; |
|||
box-shadow: 0 4px 6px rgba(0,0,0,0.1); |
|||
box-sizing: border-box !important; |
|||
} |
} |
||
/* |
/* 4. Style the Input Text (Make sure it's black) */ |
||
body.mw-mf-search-mode .minerva-header .search-box input { |
body.mw-mf-search-mode .minerva-header .search-box input { |
||
color: #000000 !important; |
|||
-webkit-text-fill-color: #000000 !important; |
|||
opacity: 1 !important; |
|||
padding-left: 10px !important; |
|||
background: #fff !important; |
background: #fff !important; |
||
color: #000 !important; |
|||
border: 1px solid #ccc !important; |
border: 1px solid #ccc !important; |
||
border-radius: 4px !important; |
border-radius: 4px !important; |
||
height: 36px !important; |
|||
opacity: 1 !important; |
|||
| ⚫ | |||
/* 4. Hide duplicate icons inside the drawer */ |
|||
body.mw-mf-search-mode .minerva-header .search-box .search-box-icon-overlay { |
|||
display: none !important; |
|||
} |
|||
| ⚫ | |||
| ⚫ | |||
opacity: 0.2 !important; |
|||
pointer-events: none; |
|||
} |
} |
||
Revision as of 13:24, 6 December 2025
/* All CSS here will be loaded for users of the mobile site */
/* Standard <youtube> (no lazy-load) */
.mw-parser-output iframe[data-extension="youtube"] {
width: 100% !important;
height: auto !important;
aspect-ratio: 16 / 9;
display: block;
}
/* Lazy-load wrapper + its thumbnail image */
.mw-parser-output .ext-YouTube-video {
width: 100% !important; /* override inline width="560px" etc. */
height: auto !important; /* override inline height */
}
.mw-parser-output .ext-YouTube-video img {
width: 100% !important; /* scale preview to screen */
height: auto !important;
aspect-ratio: 16 / 9;
display: block;
}
/* Optional: cap on very large screens (adjust 720px to taste) */
@media (min-width: 992px) {
.mw-parser-output iframe[data-extension="youtube"],
.mw-parser-output .ext-YouTube-video {
max-width: 720px;
margin: 0 auto;
}
}
/* CapSach — Mobile TOC overlay (all skins) */
#cps-open-toc {
position: fixed;
/* POSITION: Right side */
right: 16px; /* Changed from left: 16px */
left: auto; /* Safety: ensures left is unset */
/* POSITION: Lifted (to clear Google Anchor Ads) */
bottom: calc(120px + env(safe-area-inset-bottom, 0px));
/* SHAPE: Smaller Size (40px) */
width: 44px; /* Changed from 48px */
height: 44px; /* Changed from 48px */
border: 0; border-radius: 999px;
display: none;
align-items: center; justify-content: center;
font-size: 14px; font-weight: 600;
color: #fff; background: rgba(0,0,0,.1);
/* box-shadow: 0 2px 8px rgba(0,0,0,.0);*/
z-index: 1000; cursor: pointer;
-webkit-tap-highlight-color: transparent;
}
#cps-open-toc:focus { outline: 2px solid #36c; outline-offset: 2px; }
#cps-open-toc .label { display: none; } /* icon-only by default */
#cps-open-toc .icon { font-size: 20px; line-height: 1; }
/* Full-screen scrim */
#cps-toc-overlay {
position: fixed; inset: 0;
background: rgba(0,0,0,.1);
display: none; z-index: 1001;
}
#cps-toc-overlay.is-open { display: block; }
/* Bottom sheet panel */
#cps-toc-panel {
position: fixed; left: 0; right: 0; bottom: 0;
max-height: 85vh;
border-radius: 12px 12px 0 0;
background: #fff; color: #202122;
/* box-shadow: 0 -8px 20px rgba(0,0,0,.0);*/
padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)) 12px;
}
/* Header row */
#cps-toc-header {
display: flex; align-items: center; justify-content: space-between;
margin-bottom: 6px;
}
#cps-toc-title { font-size: 16px; font-weight: 600; margin: 0; }
#cps-toc-close {
background: transparent; border: 0; font-size: 22px; line-height: 1;
}
/* List */
#cps-toc-list {
list-style: none; margin: 0; padding: 4px 2px 6px;
max-height: 70vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
#cps-toc-list li { margin: 2px 0; }
#cps-toc-list a {
display: block; padding: 8px 10px; border-radius: 8px;
text-decoration: none; color: inherit;
}
#cps-toc-list a:focus, #cps-toc-list a:active {
outline: 2px solid #36c; background: #f5f6f7;
}
/* Indentation by heading level */
#cps-toc-list li[data-level="3"] { padding-left: 12px; }
#cps-toc-list li[data-level="4"] { padding-left: 24px; }
#cps-toc-list li[data-level="5"] { padding-left: 36px; }
#cps-toc-list li[data-level="6"] { padding-left: 48px; }
/* Only show on phone-ish widths; tablet/desktop keep native TOC */
@media (min-width: 768px) {
#cps-open-toc, #cps-toc-overlay { display: none !important; }
}
/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
html { scroll-behavior: auto; }
}
/* ======================================================= */
/* FIX: HIDE DUPLICATE "CONTENTS" TITLE IN MOBILE TOC */
/* ======================================================= */
/* This hides the original MediaWiki header inside your custom panel */
#cps-toc-panel .toctitle,
#cps-toc-panel #mw-toc-heading,
#cps-toc-panel h2 {
display: none !important;
}
/* ======================================================= */
/* 1. DESKTOP STICKY HEADER (Vector 2022 Skin) */
/* ======================================================= */
/* This part works perfectly, as confirmed. */
.vector-header-container {
position: fixed !important;
top: 0;
left: 0;
right: 0;
width: 100%;
z-index: 1000;
background-color: #fff;
box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
/* Pushes article content down so it isn't hidden behind the fixed header */
body.skin-vector-2022 {
padding-top: 60px;
}
.mw-page-container {
margin-top: 10px;
}
/* ======================================================= */
/* 2. FIXED TOP TOOLBAR (The "Mode Switch" Solution) */
/* ======================================================= */
/* --- A. READING MODE (The Sticky Toolbar) --- */
/* We style the header strictly when NOT searching */
body:not(.mw-mf-search-mode) .header-container.header-chrome {
position: fixed !important;
top: 0 !important;
left: 0 !important;
right: 0 !important;
height: 50px !important;
z-index: 1000 !important;
background-color: #ffffff !important;
border-bottom: 1px solid #eaecf0 !important;
/* Force layout */
display: flex !important;
align-items: center;
justify-content: center;
transform: none !important; /* Stop hiding on scroll */
transition: none !important;
}
/* Push content down so it isn't hidden behind the bar */
body.skin-minerva {
padding-top: 50px !important;
}
/* Hide standard elements during reading mode */
body:not(.mw-mf-search-mode) .header-container .navigation-drawer,
body:not(.mw-mf-search-mode) .minerva-header .search-box {
display: none !important;
}
/* --- B. CUSTOM BUTTONS (Visible ONLY when Reading) --- */
/* 1. HOME BUTTON (Left) */
body:not(.mw-mf-search-mode) .branding-box {
position: absolute !important;
top: 0; left: 0;
width: 60px; height: 50px;
display: flex !important;
align-items: center; justify-content: center;
z-index: 1002;
}
body:not(.mw-mf-search-mode) .branding-box a {
font-size: 0 !important; color: transparent !important;
}
body:not(.mw-mf-search-mode) .branding-box a::before {
content: "⌂"; font-size: 28px; color: #000; margin-top: -4px;
}
/* 2. SEARCH TRIGGER (Center) */
body:not(.mw-mf-search-mode) #searchIcon {
position: absolute !important;
top: 0; left: 50%;
transform: translateX(-50%);
width: 60px; height: 50px;
display: flex !important;
align-items: center; justify-content: center;
z-index: 1002;
background: transparent !important;
border: none; margin: 0; padding: 0;
box-shadow: none;
}
body:not(.mw-mf-search-mode) #searchIcon .minerva-icon {
font-size: 24px; color: #000; opacity: 0.7;
}
/* 3. TOC BUTTON (Right) */
body:not(.mw-mf-search-mode) #cps-open-toc {
display: flex !important;
position: absolute !important;
top: 3px; right: 5px;
bottom: auto; left: auto;
width: 44px; height: 44px;
z-index: 1002;
background: transparent !important;
color: #000 !important;
box-shadow: none !important;
}
/* --- C. SEARCH MODE (The "Transparent" Fix) --- */
/* When search activates, we HIDE the custom buttons so they don't block the view */
/* 1. Hide the Custom Buttons */
body.mw-mf-search-mode .branding-box,
body.mw-mf-search-mode #searchIcon,
body.mw-mf-search-mode #cps-open-toc {
display: none !important;
}
/* 2. Reset Header to allow Standard Search Bar */
/* We remove the fixed height so the search bar can fit naturally */
body.mw-mf-search-mode .header-container.header-chrome {
position: fixed !important;
top: 0 !important;
height: auto !important; /* Let it grow */
min-height: 50px !important;
background-color: #ffffff !important;
z-index: 1000 !important;
border-bottom: 1px solid #eaecf0;
}
/* 3. Show the Real Search Bar */
body.mw-mf-search-mode .minerva-header .search-box {
display: block !important;
opacity: 1 !important;
visibility: visible !important;
background: #fff !important;
padding: 8px !important;
}
/* 4. Style the Input Text (Make sure it's black) */
body.mw-mf-search-mode .minerva-header .search-box input {
color: #000000 !important;
-webkit-text-fill-color: #000000 !important;
opacity: 1 !important;
background: #fff !important;
border: 1px solid #ccc !important;
border-radius: 4px !important;
height: 36px !important;
}