MediaWiki:Mobile.css: Difference between revisions
Appearance
Content deleted Content added
No edit summary |
No edit summary |
||
| Line 157: | Line 157: | ||
/* We apply 'position: sticky' ONLY when the search overlay is CLOSED. |
/* We apply 'position: sticky' ONLY when the search overlay is CLOSED. |
||
The ':not(.mw-mf-search-mode)' part is the magic switch. |
The ':not(.mw-mf-search-mode)' part is the magic switch. |
||
- When reading: Header is sticky. |
|||
- When you click Search: This entire block is disabled. |
|||
The header reverts to normal, allowing the search bar to |
|||
expand, text to appear, and the icon to sit correctly |
|||
using the default skin settings. |
|||
*/ |
*/ |
||
body:not(.mw-mf-search-mode) .header-container.header-chrome { |
body:not(.mw-mf-search-mode) .header-container.header-chrome { |
||
| Line 169: | Line 163: | ||
position: sticky; |
position: sticky; |
||
top: 0; |
top: 0; |
||
/* Z-Index 99 is sufficient |
/* Z-Index 99 is sufficient for reading mode */ |
||
z-index: 99; |
z-index: 99; |
||
background-color: #ffffff; |
background-color: #ffffff; |
||
| Line 176: | Line 170: | ||
} |
} |
||
/* Safeguard: Ensure the search box sits on top of the white header background |
/* Safeguard: Ensure the search box sits on top of the white header background |
||
so text doesn't get buried behind it. |
so text doesn't get buried behind it. |
||
*/ |
*/ |
||
body:not(.mw-mf-search-mode) .minerva-header .search-box { |
body:not(.mw-mf-search-mode) .minerva-header .search-box { |
||
| Line 185: | Line 179: | ||
/* ======================================================= */ |
/* ======================================================= */ |
||
/* FIX: MOBILE SEARCH INPUT VISIBILITY |
/* FIX: MOBILE SEARCH INPUT VISIBILITY (THE NUCLEAR FIX) */ |
||
/* ======================================================= */ |
/* ======================================================= */ |
||
/* 1. |
/* 1. When search is active, ensure header background is white and on top */ |
||
body.mw-mf-search-mode .header-container.header-chrome { |
body.mw-mf-search-mode .header-container.header-chrome { |
||
| ⚫ | |||
z-index: 1000 !important; |
z-index: 1000 !important; |
||
| ⚫ | |||
} |
} |
||
/* 2. |
/* 2. Target ALL inputs inside the search box during search mode |
||
We use [type="search"] to target the REAL input, not the "trigger" |
|||
| ⚫ | |||
*/ |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
color: #000000 !important; |
|||
text-shadow: none !important; |
|||
-webkit-text-fill-color: # |
-webkit-text-fill-color: #000000 !important; /* Force iOS black text */ |
||
opacity: 1 !important; |
|||
background: #ffffff !important; |
|||
| ⚫ | |||
| ⚫ | |||
box-shadow: none !important; |
|||
} |
} |
||
/* 3. Ensure the placeholder text is also visible |
/* 3. Ensure the placeholder text is also visible */ |
||
body.mw-mf-search-mode .minerva-header .search-box input |
body.mw-mf-search-mode .minerva-header .search-box input[type="search"]::placeholder { |
||
color: #72777d !important; |
color: #72777d !important; |
||
opacity: 1 !important; |
opacity: 1 !important; |
||
-webkit-text-fill-color: #72777d !important; |
|||
} |
|||
/* 4. Force the Form container to be visible and have height */ |
|||
body.mw-mf-search-mode .search-box form { |
|||
display: block !important; |
|||
visibility: visible !important; |
|||
height: auto !important; |
|||
margin: 0 !important; |
|||
} |
} |
||
Revision as of 16:21, 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. MOBILE STICKY HEADER (Minerva Skin) */
/* ======================================================= */
/* We apply 'position: sticky' ONLY when the search overlay is CLOSED.
The ':not(.mw-mf-search-mode)' part is the magic switch.
*/
body:not(.mw-mf-search-mode) .header-container.header-chrome {
position: -webkit-sticky;
position: sticky;
top: 0;
/* Z-Index 99 is sufficient for reading mode */
z-index: 99;
background-color: #ffffff;
border-bottom: 1px solid #eaecf0;
width: 100%;
}
/* Safeguard: Ensure the search box sits on top of the white header background
so text doesn't get buried behind it.
*/
body:not(.mw-mf-search-mode) .minerva-header .search-box {
position: relative;
z-index: 100;
}
/* ======================================================= */
/* FIX: MOBILE SEARCH INPUT VISIBILITY (THE NUCLEAR FIX) */
/* ======================================================= */
/* 1. When search is active, ensure header background is white and on top */
body.mw-mf-search-mode .header-container.header-chrome {
background-color: #ffffff !important;
z-index: 1000 !important;
}
/* 2. Target ALL inputs inside the search box during search mode
We use [type="search"] to target the REAL input, not the "trigger"
*/
body.mw-mf-search-mode .minerva-header .search-box input[type="search"] {
color: #000000 !important;
text-shadow: none !important;
-webkit-text-fill-color: #000000 !important; /* Force iOS black text */
opacity: 1 !important;
background: #ffffff !important;
z-index: 1001 !important;
position: relative !important;
box-shadow: none !important;
}
/* 3. Ensure the placeholder text is also visible */
body.mw-mf-search-mode .minerva-header .search-box input[type="search"]::placeholder {
color: #72777d !important;
opacity: 1 !important;
-webkit-text-fill-color: #72777d !important;
}
/* 4. Force the Form container to be visible and have height */
body.mw-mf-search-mode .search-box form {
display: block !important;
visibility: visible !important;
height: auto !important;
margin: 0 !important;
}