Jump to content

MediaWiki:Mobile.css: Difference between revisions

From Insurer Brain
Content deleted Content added
No edit summary
Tag: Manual revert
No edit summary
Tag: Reverted
Line 28: Line 28:
margin: 0 auto;
margin: 0 auto;
}
}
}

/* Back-to-top (CapSach) — all skins; show only on mobile-ish widths */
#cps-backtotop {
position: fixed;

/* base placement */
right: 16px;
bottom: 16px;

/* iOS safe area awareness (fallback 0px keeps desktops fine) */
bottom: calc(16px + env(safe-area-inset-bottom, 0px));

width: 48px;
height: 48px;
border: 0;
border-radius: 999px;
display: none; /* toggled by JS via .is-visible */
align-items: center;
justify-content: center;
font-size: 22px;
line-height: 1;
color: #fff;
background: rgba(0,0,0,.65);
box-shadow: 0 2px 8px rgba(0,0,0,.15);
z-index: 1000;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
}

#cps-backtotop.is-visible { display: flex; }

#cps-backtotop:focus {
outline: 2px solid #36c;
outline-offset: 2px;
}

/* Show only on narrow screens (tweak breakpoint as you like) */
@media (min-width: 768px) {
#cps-backtotop { display: none !important; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
html { scroll-behavior: auto; }
}

/* Never print the button */
@media print {
#cps-backtotop { display: none !important; }
}
}

Revision as of 17:34, 17 October 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;
  }
}

/* Back-to-top (CapSach) — all skins; show only on mobile-ish widths */
#cps-backtotop {
  position: fixed;

  /* base placement */
  right: 16px;
  bottom: 16px;

  /* iOS safe area awareness (fallback 0px keeps desktops fine) */
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));

  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  display: none;            /* toggled by JS via .is-visible */
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  color: #fff;
  background: rgba(0,0,0,.65);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  z-index: 1000;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#cps-backtotop.is-visible { display: flex; }

#cps-backtotop:focus {
  outline: 2px solid #36c;
  outline-offset: 2px;
}

/* Show only on narrow screens (tweak breakpoint as you like) */
@media (min-width: 768px) {
  #cps-backtotop { display: none !important; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Never print the button */
@media print {
  #cps-backtotop { display: none !important; }
}