Template:Sort under/styles.css: Difference between revisions

From RetroWikipedia
Jump to navigation Jump to search
imported>Jroberson108
Order.
 
imported>Jroberson108
Remove "html.client-js" specificity on most. Redo "Adjust {{vertical header}} space". Unnest media queries in case IE still used and has coarse pointer.
 
Line 10: Line 10:
  * - Windows 10: (all skins) Chrome, Firefox, Edge.
  * - Windows 10: (all skins) Chrome, Firefox, Edge.
  * - Android Galaxy S21 (MinervaNeue): Chrome, Firefox.
  * - Android Galaxy S21 (MinervaNeue): Chrome, Firefox.
  * - RetroWikipedia Android app.
  * - Wikipedia Android app.
  * - Print: Not styled.
  * - Print: Not styled.
  * - No JavaScript.
  * - No JavaScript.
Line 25: Line 25:
   * Reclaim old space.
   * Reclaim old space.
   */
   */
   html.client-js .sort-under.sortable.wikitable th.headerSort,
   .sort-under.sortable.wikitable th.headerSort,
   html.client-js .sort-under-center.sortable.wikitable th.headerSort {
   .sort-under-center.sortable.wikitable th.headerSort {
     padding-right: 0.4em;
     padding-right: 0.4em;
   }
   }
   html.client-js .sort-under.sortable:not(.wikitable) th.headerSort,
   .sort-under.sortable:not(.wikitable) th.headerSort,
   html.client-js .sort-under-center.sortable:not(.wikitable) th.headerSort {
   .sort-under-center.sortable:not(.wikitable) th.headerSort {
     padding-right: 1px;
     padding-right: 1px;
   }
   }
   html.client-js body.skin-minerva .sort-under.sortable.wikitable th.headerSort,
   body.skin-minerva .sort-under.sortable.wikitable th.headerSort,
   html.client-js body.skin-minerva .sort-under-center.sortable.wikitable th.headerSort {
   body.skin-minerva .sort-under-center.sortable.wikitable th.headerSort {
     padding-right: 0.2em;
     padding-right: 0.2em;
   }
   }
   html.client-js body.skin-timeless .sort-under.sortable.wikitable th.headerSort,
   body.skin-timeless .sort-under.sortable.wikitable th.headerSort,
   html.client-js body.skin-timeless .sort-under-center.sortable.wikitable th.headerSort {
   body.skin-timeless .sort-under-center.sortable.wikitable th.headerSort {
     padding-right: 0.5em;
     padding-right: 0.5em;
   }
   }
Line 55: Line 55:
   * Add new space.
   * Add new space.
   */
   */
   html.client-js .sort-under.sortable th.headerSort,
   .sort-under.sortable th.headerSort,
   html.client-js .sort-under.sortable th.unsortable,
   .sort-under.sortable th.unsortable,
   html.client-js .sort-under-center.sortable th.headerSort,
   .sort-under-center.sortable th.headerSort,
   html.client-js .sort-under-center.sortable th.unsortable {
   .sort-under-center.sortable th.unsortable {
     padding-bottom: 1em;
     padding-bottom: 1em;
   }
   }
   html.client-js body.skin-timeless .sort-under.sortable.wikitable th.headerSort,
   body.skin-timeless .sort-under.sortable.wikitable th.headerSort,
   html.client-js body.skin-timeless .sort-under.sortable.wikitable th.unsortable,
   body.skin-timeless .sort-under.sortable.wikitable th.unsortable,
   html.client-js body.skin-timeless .sort-under-center.sortable.wikitable th.headerSort,
   body.skin-timeless .sort-under-center.sortable.wikitable th.headerSort,
   html.client-js body.skin-timeless .sort-under-center.sortable.wikitable th.unsortable {
   body.skin-timeless .sort-under-center.sortable.wikitable th.unsortable {
     padding-bottom: 1.2em;
     padding-bottom: 1.2em;
   }
   }
   html.client-js body.skin-timeless .sort-under.sortable:not(.wikitable) th.headerSort,
   body.skin-timeless .sort-under.sortable:not(.wikitable) th.headerSort,
   html.client-js body.skin-timeless .sort-under.sortable:not(.wikitable) th.unsortable,
   body.skin-timeless .sort-under.sortable:not(.wikitable) th.unsortable,
   html.client-js body.skin-timeless .sort-under-center.sortable:not(.wikitable) th.headerSort,
   body.skin-timeless .sort-under-center.sortable:not(.wikitable) th.headerSort,
   html.client-js body.skin-timeless .sort-under-center.sortable:not(.wikitable) th.unsortable,
   body.skin-timeless .sort-under-center.sortable:not(.wikitable) th.unsortable,
   html.client-js body.skin-minerva .sort-under.sortable:not(.wikitable) th.headerSort,
   body.skin-minerva .sort-under.sortable:not(.wikitable) th.headerSort,
   html.client-js body.skin-minerva .sort-under.sortable:not(.wikitable) th.unsortable,
   body.skin-minerva .sort-under.sortable:not(.wikitable) th.unsortable,
   html.client-js body.skin-minerva .sort-under-center.sortable:not(.wikitable) th.headerSort,
   body.skin-minerva .sort-under-center.sortable:not(.wikitable) th.headerSort,
   html.client-js body.skin-minerva .sort-under-center.sortable:not(.wikitable) th.unsortable {
   body.skin-minerva .sort-under-center.sortable:not(.wikitable) th.unsortable {
     padding-bottom: 0.8em;
     padding-bottom: 0.8em;
   }
   }
Line 81: Line 81:
   * Align {{static row numbers}} column header text.
   * Align {{static row numbers}} column header text.
   */
   */
   html.client-js .static-row-numbers.sort-under.sortable thead tr:only-child::before,
   .static-row-numbers.sort-under.sortable thead tr:only-child::before,
   html.client-js .static-row-numbers.sort-under-center.sortable thead tr:only-child::before {
   .static-row-numbers.sort-under-center.sortable thead tr:only-child::before {
     padding-bottom: 0.9em;
     padding-bottom: 0.9em;
   }
   }
   html.client-js body.skin-timeless .static-row-numbers.sort-under.sortable thead tr:only-child::before,
   body.skin-timeless .static-row-numbers.sort-under.sortable thead tr:only-child::before,
   html.client-js body.skin-timeless .static-row-numbers.sort-under-center.sortable thead tr:only-child::before,
   body.skin-timeless .static-row-numbers.sort-under-center.sortable thead tr:only-child::before,
   html.client-js body.skin-minerva .static-row-numbers.sort-under.sortable thead tr:only-child::before,
   body.skin-minerva .static-row-numbers.sort-under.sortable thead tr:only-child::before,
   html.client-js body.skin-minerva .static-row-numbers.sort-under-center.sortable thead tr:only-child::before {
   body.skin-minerva .static-row-numbers.sort-under-center.sortable thead tr:only-child::before {
     padding-bottom: 0.8em;
     padding-bottom: 0.8em;
   }
   }
Line 95: Line 95:
   * Adjust {{vertical header}} space.
   * Adjust {{vertical header}} space.
   */
   */
   html.client-js .sort-under.sortable.wikitable th.ts-vertical-header.headerSort,
   .sort-under.sortable th.ts-vertical-header.headerSort,
   html.client-js .sort-under.sortable.wikitable th.ts-vertical-header.unsortable,
   .sort-under-center.sortable th.ts-vertical-header.headerSort {
  html.client-js .sort-under-center.sortable.wikitable th.ts-vertical-header.headerSort,
  html.client-js .sort-under-center.sortable.wikitable th.ts-vertical-header.unsortable {
     padding-top: 0.4em;
     padding-top: 0.4em;
    padding-right: 0.4em;
   }
   }
  html.client-js .sort-under.sortable:not(.wikitable) th.ts-vertical-header.headerSort,
}
  html.client-js .sort-under.sortable:not(.wikitable) th.ts-vertical-header.unsortable,
 
   html.client-js .sort-under-center.sortable:not(.wikitable) th.ts-vertical-header.headerSort,
/**
   html.client-js .sort-under-center.sortable:not(.wikitable) th.ts-vertical-header.unsortable {
* Increase touch screen button spacing for fat-finger error on header link.
     padding-top: 1px;
*/
@media screen and (pointer: coarse) {
   /* Arrows. */
   html.client-js .sort-under.sortable.wikitable th.headerSort {
     background-position: right bottom 0.5em;
   }
   }
  html.client-js .sort-under.sortable .ts-vertical-header > div,
   html.client-js .sort-under-center.sortable.wikitable th.headerSort {
   html.client-js .sort-under-center.sortable .ts-vertical-header > div {
     background-position: center bottom 0.5em;
     padding-top: 4px;
   }
   }
   html.client-js .sort-under.sortable:not(.wikitable) .ts-vertical-header > div,
   /* Space. */
   html.client-js .sort-under-center.sortable:not(.wikitable) .ts-vertical-header > div {
  .sort-under.sortable.wikitable th.headerSort,
     padding-bottom: 4px;
   .sort-under.sortable.wikitable th.unsortable,
  .sort-under-center.sortable.wikitable th.headerSort,
  .sort-under-center.sortable.wikitable th.unsortable {
     padding-bottom: 1.6em;
   }
   }
   html.client-js body.skin-minerva .sort-under.sortable.wikitable .ts-vertical-header > div,
   body.skin-timeless .sort-under.sortable.wikitable th.headerSort,
   html.client-js body.skin-minerva .sort-under-center.sortable.wikitable .ts-vertical-header > div {
  body.skin-timeless .sort-under.sortable.wikitable th.unsortable,
     padding-top: 2px;
  body.skin-timeless .sort-under-center.sortable.wikitable th.headerSort,
   body.skin-timeless .sort-under-center.sortable.wikitable th.unsortable {
     padding-bottom: 1.8em;
   }
   }
   html.client-js body.skin-timeless .sort-under.sortable.wikitable .ts-vertical-header > div,
   /* {{Static row numbers}}. */
   html.client-js body.skin-timeless .sort-under-center.sortable.wikitable .ts-vertical-header > div {
  .static-row-numbers.sort-under.sortable.wikitable thead tr:only-child::before,
     padding-top: 0;
   .static-row-numbers.sort-under-center.sortable.wikitable thead tr:only-child::before {
     padding-bottom: 1.5em;
   }
   }
 
   body.skin-timeless .static-row-numbers.sort-under.sortable.wikitable thead tr:only-child::before,
  /**
  body.skin-timeless .static-row-numbers.sort-under-center.sortable.wikitable thead tr:only-child::before,
  * Increase touch screen button spacing for fat-finger error on header link.
  body.skin-minerva .static-row-numbers.sort-under.sortable.wikitable thead tr:only-child::before,
  */
  body.skin-minerva .static-row-numbers.sort-under-center.sortable.wikitable thead tr:only-child::before {
   @media (pointer: coarse) {
    padding-bottom: 1.4em;
    /* Arrows. */
    html.client-js .sort-under.sortable.wikitable th.headerSort {
      background-position: right bottom 0.5em;
    }
    html.client-js .sort-under-center.sortable.wikitable th.headerSort {
      background-position: center bottom 0.5em;
    }
    /* Space. */
    html.client-js .sort-under.sortable.wikitable th.headerSort,
    html.client-js .sort-under.sortable.wikitable th.unsortable,
    html.client-js .sort-under-center.sortable.wikitable th.headerSort,
    html.client-js .sort-under-center.sortable.wikitable th.unsortable {
      padding-bottom: 1.6em;
    }
    html.client-js body.skin-timeless .sort-under.sortable.wikitable th.headerSort,
    html.client-js body.skin-timeless .sort-under.sortable.wikitable th.unsortable,
    html.client-js body.skin-timeless .sort-under-center.sortable.wikitable th.headerSort,
    html.client-js body.skin-timeless .sort-under-center.sortable.wikitable th.unsortable {
      padding-bottom: 1.8em;
    }
    /* {{Static row numbers}}. */
    html.client-js .static-row-numbers.sort-under.sortable.wikitable thead tr:only-child::before,
    html.client-js .static-row-numbers.sort-under-center.sortable.wikitable thead tr:only-child::before {
      padding-bottom: 1.5em;
    }
    html.client-js body.skin-timeless .static-row-numbers.sort-under.sortable.wikitable thead tr:only-child::before,
    html.client-js body.skin-timeless .static-row-numbers.sort-under-center.sortable.wikitable thead tr:only-child::before,
    html.client-js body.skin-minerva .static-row-numbers.sort-under.sortable.wikitable thead tr:only-child::before,
    html.client-js body.skin-minerva .static-row-numbers.sort-under-center.sortable.wikitable thead tr:only-child::before {
      padding-bottom: 1.4em;
    }
   }
   }
}
}

Latest revision as of 07:42, 3 August 2025

/* {{pp-template}} */
/**
 * Reposition sort arrows under column header text in the same cell.
 *
 * Table classes:
 * - sort-under (consensus right)
 * - sort-under-center
 *
 * Tested:
 * - Windows 10: (all skins) Chrome, Firefox, Edge.
 * - Android Galaxy S21 (MinervaNeue): Chrome, Firefox.
 * - Wikipedia Android app.
 * - Print: Not styled.
 * - No JavaScript.
 *
 * Note:
 * Can't align {{static row numbers}} column label after sorting when exactly
 * one header row followed by any "sorttop" rows.
 * See Phab:T355492 - "Move sorttop rows from thead to second tbody".
 * Lint error:
 * thead tr:first-child:has(+ tr.sorttop)::before {}
 */
@media screen {
  /**
   * Reclaim old space.
   */
  .sort-under.sortable.wikitable th.headerSort,
  .sort-under-center.sortable.wikitable th.headerSort {
    padding-right: 0.4em;
  }
  .sort-under.sortable:not(.wikitable) th.headerSort,
  .sort-under-center.sortable:not(.wikitable) th.headerSort {
    padding-right: 1px;
  }
  body.skin-minerva .sort-under.sortable.wikitable th.headerSort,
  body.skin-minerva .sort-under-center.sortable.wikitable th.headerSort {
    padding-right: 0.2em;
  }
  body.skin-timeless .sort-under.sortable.wikitable th.headerSort,
  body.skin-timeless .sort-under-center.sortable.wikitable th.headerSort {
    padding-right: 0.5em;
  }

  /**
   * Reposition arrows.
   */
  html.client-js .sort-under.sortable th.headerSort {
    background-position: right bottom 0.2em;
  }
  html.client-js .sort-under-center.sortable th.headerSort {
    background-position: center bottom 0.2em;
  }

  /**
   * Add new space.
   */
  .sort-under.sortable th.headerSort,
  .sort-under.sortable th.unsortable,
  .sort-under-center.sortable th.headerSort,
  .sort-under-center.sortable th.unsortable {
    padding-bottom: 1em;
  }
  body.skin-timeless .sort-under.sortable.wikitable th.headerSort,
  body.skin-timeless .sort-under.sortable.wikitable th.unsortable,
  body.skin-timeless .sort-under-center.sortable.wikitable th.headerSort,
  body.skin-timeless .sort-under-center.sortable.wikitable th.unsortable {
    padding-bottom: 1.2em;
  }
  body.skin-timeless .sort-under.sortable:not(.wikitable) th.headerSort,
  body.skin-timeless .sort-under.sortable:not(.wikitable) th.unsortable,
  body.skin-timeless .sort-under-center.sortable:not(.wikitable) th.headerSort,
  body.skin-timeless .sort-under-center.sortable:not(.wikitable) th.unsortable,
  body.skin-minerva .sort-under.sortable:not(.wikitable) th.headerSort,
  body.skin-minerva .sort-under.sortable:not(.wikitable) th.unsortable,
  body.skin-minerva .sort-under-center.sortable:not(.wikitable) th.headerSort,
  body.skin-minerva .sort-under-center.sortable:not(.wikitable) th.unsortable {
    padding-bottom: 0.8em;
  }

  /**
   * Align {{static row numbers}} column header text.
   */
  .static-row-numbers.sort-under.sortable thead tr:only-child::before,
  .static-row-numbers.sort-under-center.sortable thead tr:only-child::before {
    padding-bottom: 0.9em;
  }
  body.skin-timeless .static-row-numbers.sort-under.sortable thead tr:only-child::before,
  body.skin-timeless .static-row-numbers.sort-under-center.sortable thead tr:only-child::before,
  body.skin-minerva .static-row-numbers.sort-under.sortable thead tr:only-child::before,
  body.skin-minerva .static-row-numbers.sort-under-center.sortable thead tr:only-child::before {
    padding-bottom: 0.8em;
  }

  /**
   * Adjust {{vertical header}} space.
   */
  .sort-under.sortable th.ts-vertical-header.headerSort,
  .sort-under-center.sortable th.ts-vertical-header.headerSort {
    padding-top: 0.4em;
    padding-right: 0.4em;
  }
}

/**
 * Increase touch screen button spacing for fat-finger error on header link.
 */
@media screen and (pointer: coarse) {
  /* Arrows. */
  html.client-js .sort-under.sortable.wikitable th.headerSort {
    background-position: right bottom 0.5em;
  }
  html.client-js .sort-under-center.sortable.wikitable th.headerSort {
    background-position: center bottom 0.5em;
  }
  /* Space. */
  .sort-under.sortable.wikitable th.headerSort,
  .sort-under.sortable.wikitable th.unsortable,
  .sort-under-center.sortable.wikitable th.headerSort,
  .sort-under-center.sortable.wikitable th.unsortable {
    padding-bottom: 1.6em;
  }
  body.skin-timeless .sort-under.sortable.wikitable th.headerSort,
  body.skin-timeless .sort-under.sortable.wikitable th.unsortable,
  body.skin-timeless .sort-under-center.sortable.wikitable th.headerSort,
  body.skin-timeless .sort-under-center.sortable.wikitable th.unsortable {
    padding-bottom: 1.8em;
  }
  /* {{Static row numbers}}. */
  .static-row-numbers.sort-under.sortable.wikitable thead tr:only-child::before,
  .static-row-numbers.sort-under-center.sortable.wikitable thead tr:only-child::before {
    padding-bottom: 1.5em;
  }
  body.skin-timeless .static-row-numbers.sort-under.sortable.wikitable thead tr:only-child::before,
  body.skin-timeless .static-row-numbers.sort-under-center.sortable.wikitable thead tr:only-child::before,
  body.skin-minerva .static-row-numbers.sort-under.sortable.wikitable thead tr:only-child::before,
  body.skin-minerva .static-row-numbers.sort-under-center.sortable.wikitable thead tr:only-child::before {
    padding-bottom: 1.4em;
  }
}