MediaWiki:Common.css: Difference between revisions

No edit summary
Tags: Mobile edit Mobile web edit
No edit summary
Line 8: Line 8:
@media screen and (max-width: 768px) {
@media screen and (max-width: 768px) {


  /* Stop right-floating boxes on mobile */
   .infobox,
   .infobox,
   .navbox,
   .navbox,
Line 21: Line 20:
     float: none !important;
     float: none !important;
     clear: both !important;
     clear: both !important;
     width: 100% !important;
     width: calc(100% - 1.5rem) !important;
     max-width: 100% !important;
     max-width: 34rem !important;
     min-width: 0 !important;
     min-width: 0 !important;
     margin: 1em 0 !important;
     margin: 1.25em auto !important;
     box-sizing: border-box !important;
     box-sizing: border-box !important;
   }
   }


  /* Make images inside boxes behave */
   .infobox img,
   .infobox img,
   .navbox img,
   .navbox img,
   table.infobox img,
   table.infobox img,
   table.navbox img {
   table.navbox img {
     max-width: 100% !important;
     max-width: 80% !important;
     height: auto !important;
     height: auto !important;
    display: block;
    margin-left: auto;
    margin-right: auto;
   }
   }


  /* Stop article text from wrapping beside boxes */
   .mw-parser-output > p,
   .mw-parser-output > p,
   .mw-parser-output > ul,
   .mw-parser-output > ul,
Line 44: Line 44:
   }
   }


  /* Give the page more comfortable mobile spacing */
   .mw-body,
   .mw-body,
   #content,
   #content,
Line 54: Line 53:
   }
   }


  /* Slightly reduce giant headings on phone */
   .mw-body h1,
   .mw-body h1,
   .mw-parser-output h1 {
   .mw-parser-output h1 {
     font-size: 2.1rem;
     font-size: 2.4rem;
     line-height: 1.15;
     line-height: 1.12;
    margin-top: 0.6em;
    margin-bottom: 0.55em;
   }
   }


Line 67: Line 67:
   }
   }


  /* Improve list readability inside infoboxes */
   .infobox ul,
   .infobox ul,
   .navbox ul,
   .navbox ul,
   table.infobox ul,
   table.infobox ul,
   table.navbox ul {
   table.navbox ul {
     padding-left: 1.4em;
     padding-left: 1.3em;
  }
}
 
The key changes are:
 
width: calc(100% - 1.5rem) !important;
max-width: 34rem !important;
margin: 1.25em auto !important;
 
That stops the box from touching the sides and makes it feel more intentional.
 
3. Optional: reduce that green vertical stripe
 
The green stripe is visually very strong on mobile. If it is part of the series box styling, soften it.
 
Add this inside the same mobile block:
 
@media screen and (max-width: 768px) {
  .infobox,
  .navbox,
  table.infobox,
  table.navbox {
    border-left: 4px solid var(--wk-green) !important;
   }
   }
}
}