MediaWiki:Mobile.css: Difference between revisions

From Candypedia
No edit summary
Tags: Mobile edit Mobile web edit
No edit summary
Tags: Mobile edit Mobile web edit
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
@media screen and (max-width: 720px) {
@media screen and (max-width: 720px) {
   /* 1) Un-hide the navbox that Minerva’s mobile CSS has display:none’d */
   /* 1) Make the outer navbox a capped, scrollable container */
   .content .navbox,
   .content .navbox,
   .content .vertical-navbox {
   .content .vertical-navbox {
     display: block !important;
     display: block !important;
     visibility: visible !important;
     max-width: 90vw !important;       /* never wider than 90% of viewport */
     height: auto !important;
     width: auto !important;           /* let it shrink below 100% if it can */
     max-height: none !important;
     overflow-x: hidden !important;       /* horizontal scroll if content spills */
     opacity: 1 !important;
     -webkit-overflow-scrolling: touch !important;
     box-sizing: border-box;
     box-sizing: border-box;
     width: 100% !important;
     margin: 0 auto 1em;               /* center & give a little bottom spacing */
   }
   }
 
  /* kill that inline width:1% on the group header */
   /* 2) Turn the inner table into a scroll container */
  .content .navbox-group {
    padding-left: 1em!important;
    text-indent: .75em!important;
  }
.content table {
    margin: 0!important;
    overflow: hidden!important;
}
   /* 2) Make the inner wrapper inline-block so it shrink-wraps its contents */
   .content .navbox-inner {
   .content .navbox-inner {
     display: block !important;
     display: inline-block !important;
     overflow-x: auto !important;
     width: auto !important;
    -webkit-overflow-scrolling: touch !important;
     min-width: 0 !important;
    width: max-content !important;
     min-width: 100% !important;
   }
   }


   /* 3) Lay out all your groups/items in a single row */
   /* 3) Turn each list into a flex container that wraps onto new lines */
   .content .navbox-group,
   .content .navbox-group,
   .content .navbox-list {
   .content .navbox-list {
     white-space: nowrap !important;
     display: flex !important;
    width: auto !important;
    flex-wrap: wrap !important;        /* allow items to wrap */
    align-items: center;
     margin: 0 !important;
     margin: 0 !important;
     padding: 0 !important;
     padding: 0 !important;
    gap: 0.5em;                        /* spacing between items */
   }
   }
  /* 4) Style each item appropriately */
   .content .navbox-group > li,
   .content .navbox-group > li,
   .content .navbox-list > li {
   .content .navbox-list > li {
     display: inline-block !important;
     display: inline-block !important; /* so padding/margins apply cleanly */
     float: none !important;
     float: none !important;
    margin: 0 !important;
   }
   }
}
}

Latest revision as of 22:19, 24 April 2025

@media screen and (max-width: 720px) {
  /* 1) Make the outer navbox a capped, scrollable container */
  .content .navbox,
  .content .vertical-navbox {
    display: block !important;
    max-width: 90vw !important;        /* never wider than 90% of viewport */
    width: auto !important;            /* let it shrink below 100% if it can */
    overflow-x: hidden !important;       /* horizontal scroll if content spills */
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box;
    margin: 0 auto 1em;                /* center & give a little bottom spacing */
  }
  /* kill that inline width:1% on the group header */
  .content .navbox-group {
    padding-left: 1em!important;
    text-indent: .75em!important;
  }
.content table {
    margin: 0!important;
    overflow: hidden!important;
}
  /* 2) Make the inner wrapper inline-block so it shrink-wraps its contents */
  .content .navbox-inner {
    display: inline-block !important;
    width: auto !important;
    min-width: 0 !important;
  }

  /* 3) Turn each list into a flex container that wraps onto new lines */
  .content .navbox-group,
  .content .navbox-list {
    display: flex !important;
    width: auto !important;
    flex-wrap: wrap !important;        /* allow items to wrap */
    align-items: center;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0.5em;                         /* spacing between items */
  }

  /* 4) Style each item appropriately */
  .content .navbox-group > li,
  .content .navbox-list > li {
    display: inline-block !important;  /* so padding/margins apply cleanly */
    float: none !important;
    margin: 0 !important;
  }
}