الگو:Static row numbers/styles.css: تفاوت میان نسخه‌ها

از اسلامیکال
پرش به ناوبری پرش به جستجو
(صفحه‌ای تازه حاوی «←‏{{pp-template}}: table.static-row-numbers { counter-reset: rowNumber; } body.skin-minerva .static-row-numbers2.sortable { counter-reset: rowNumber -1; } body.skin-minerva .static-row-numbers2.sortable.static-row-header-two { counter-reset: rowNumber -2; } table.static-row-numbers tr::before { display: table-cell; padding: 0 0.5em; text-align: right; } table.static-row-numbers tr::before { content: ""; } body:not(.sk...» ایجاد کرد)
 
بدون خلاصۀ ویرایش
برچسب: واگردانی دستی
 
(۳ نسخهٔ میانیِ ایجادشده توسط همین کاربر نشان داده نشد)
خط ۱: خط ۱:
/* {{pp-template}} */
/* {{pp-template}} */
table.static-row-numbers {
/**
* Add a static (unsortable) column of numbers to the left of a table.
* Optionally disable numbers on specific rows for headers (no borders) or data
* (borders). Optionally display column header text: "No." or hash ("#").
*
* Classes:
* - table.static-row-numbers
* - table.static-row-header-text
* - table.static-row-header-hash
* - tr.static-row-header
* - tr.static-row-numbers-norank
*
* Tested:
* - Windows 10: (all skins) Chrome, Firefox, Edge.
* - Android Galaxy S21 (MinervaNeue): Chrome, Firefox.
* - Wikipedia Android app.
* - Print.
* - No JavaScript.
* - Sticky gadget in Windows browsers (default skin).
* - Dark Reader browser extention in Windows browsers (default skin).
*
* Notes:
* - Sortable moves to thead any header rows and (after sort) sorttop rows.
* - Sticky gadget (.mw-sticky-header) moves to thead any wikitable header rows.
*/
.static-row-numbers {
   counter-reset: rowNumber;
   counter-reset: rowNumber;
}
}
body.skin-minerva .static-row-numbers2.sortable {
.static-row-numbers tr::before {
  counter-reset: rowNumber -1;
   content: "";
}
body.skin-minerva .static-row-numbers2.sortable.static-row-header-two {
   counter-reset: rowNumber -2;
}
table.static-row-numbers tr::before {
   display: table-cell;
   display: table-cell;
   padding: 0 0.5em;
   padding-right: 0.5em;
  padding-left: 0.5em;
   text-align: right;
   text-align: right;
  vertical-align: inherit;
}
}
table.static-row-numbers tr::before {
.static-row-numbers.wikitable tr::before {
   content: "";
   background-color: #eaecf0;
}
}
body:not(.skin-minerva) .static-row-numbers.sortable tbody tr:not(.static-row-header):not(.static-row-numbers-norank)::before,
 
body.skin-minerva .static-row-numbers tbody tr:not(:first-child):not(.static-row-header):not(.static-row-numbers-norank)::before,
/**
table.static-row-numbers:not(.sortable) tbody tr:not(:first-child):not(.static-row-header):not(.static-row-numbers-norank)::before {
* Add count to all tbody rows except for two classes. If no thead, skip the
* first tbody row which may not have one of the two classes:
*/
.static-row-numbers thead + tbody tr:first-child:not(.static-row-header):not(.static-row-numbers-norank)::before,
.static-row-numbers tbody tr:not(:first-child):not(.static-row-header):not(.static-row-numbers-norank)::before {
   counter-increment: rowNumber;
   counter-increment: rowNumber;
   vertical-align: inherit;
   content: counter(rowNumber);
}
}


/*
/**
table.static-row-numbers.sortable thead tr::before,
* Add column label to first row in thead or, if no thead, in tbody:
table.static-row-numbers tr.static-row-header::before,
*/
body.skin-minerva .static-row-numbers tbody tr:first-child::before,
.static-row-header-text.static-row-numbers thead tr:first-child::before,
table.static-row-numbers:not(.sortable) tbody tr:first-child::before,
.static-row-header-text.static-row-numbers caption + tbody tr:first-child::before,
body.skin-minerva .static-row-numbers.static-row-header-two tbody tr:nth-child(2)::before,
.static-row-header-text.static-row-numbers tbody:first-child tr:first-child::before {
table.static-row-numbers.static-row-header-two:not(.sortable) tbody tr:nth-child(2)::before {
  content: "No.";
   content: "";
  font-weight: bold;
}*/
}
.static-row-header-hash.static-row-numbers thead tr:first-child::before,
.static-row-header-hash.static-row-numbers caption + tbody tr:first-child::before,
.static-row-header-hash.static-row-numbers tbody:first-child tr:first-child::before {
   content: "#";
  font-weight: bold;
}


.static-row-header-hash thead tr::before {
/**
   content: "#";
* Add borders in numbers column.
*
* Windows Firefox tr::before doesn't inherit color, so hard set.
* Plain table borders on Timeless {{row hover highlight}} mw-datatable.
*/
/* Wikitable. */
.static-row-numbers.wikitable tr::before {
  border: 0 solid #a2a9b1;
}
.static-row-numbers.wikitable thead + tbody tr:first-child:not(.static-row-header)::before,
.static-row-numbers.wikitable tbody tr:not(:first-child):not(.static-row-header)::before {
  border-width: 1px;
}
body.skin-monobook .static-row-numbers.wikitable tr::before {
  border-color: #aaaaaa;
}
body.skin-timeless .static-row-numbers.wikitable tr::before {
   border-color: #c8ccd1;
}
}
.static-row-header-row thead tr::before {
body.skin-minerva .static-row-numbers.wikitable tr::before {
   content: "Row";
   border-color: rgba(84,89,93,.3);
}
}
.static-row-numbers.wikitable tr::before {
/* Plain with border. */
   background-color: #eaecf0;
table[border].static-row-numbers:not(.wikitable) tr::before {
   border: 0 inset #202122;
}
}
body:not(.skin-minerva) .static-row-numbers.mw-datatable:not(.wikitable) tr::before {
table[border].static-row-numbers:not(.wikitable) thead + tbody tr:first-child:not(.static-row-header)::before,
   background-color: #eaeeff;
table[border].static-row-numbers:not(.wikitable) tbody tr:not(:first-child):not(.static-row-header)::before {
   border-width: 1px;
}
}
table.static-row-numbers.wikitable tbody tr:not(.static-row-header)::before ,
body.skin-monobook table[border].static-row-numbers:not(.wikitable) tr::before,
body:not(.skin-minerva) .static-row-numbers.mw-datatable:not(.wikitable) tbody tr::before {
body.skin-timeless table[border].static-row-numbers:not(.wikitable):not(.mw-datatable) tr::before {
   border:1px solid #a2a9b1;
   border-color: #000000;
}
}
.static-row-numbers-period2 tbody tr::before {
/* Plain with optional border + .mw-datatable. */
   content: counter(rowNumber) ".";
body.skin-timeless .static-row-numbers.mw-datatable:not(.wikitable) tr::before {
   border: 0 solid #c8ccd1;
}
}
.srn-white-background {
body.skin-timeless .static-row-numbers.mw-datatable:not(.wikitable) thead + tbody tr:first-child:not(.static-row-header)::before,
  background: #fff;
body.skin-timeless .static-row-numbers.mw-datatable:not(.wikitable) tbody tr:not(:first-child):not(.static-row-header)::before {
  border-width: 1px;
}
}
.static-row-numbers tr:hover {
/* Minerva mobile. */
  background: #eaf3ff;
@media all and (max-width: 720px) {
  /* Wikitable. */
  body.skin-minerva .static-row-numbers.wikitable tr::before {
    border-left-width: 1px;
  }
  body.skin-minerva .static-row-numbers.wikitable thead tr:first-child::before,
  body.skin-minerva .static-row-numbers.wikitable caption + tbody tr:first-child::before,
  body.skin-minerva .static-row-numbers.wikitable tbody:first-child tr:first-child::before {
    border-top-width: 1px;
  }
  body.skin-minerva .static-row-numbers.wikitable tbody tr:last-child::before,
  body.skin-minerva .static-row-numbers.wikitable tfoot tr:last-child::before {
    border-bottom-width: 1px;
  }
}
}

نسخهٔ کنونی تا ‏۲۴ مهٔ ۲۰۲۴، ساعت ۰۲:۲۵

/* {{pp-template}} */
/**
 * Add a static (unsortable) column of numbers to the left of a table.
 * Optionally disable numbers on specific rows for headers (no borders) or data
 * (borders). Optionally display column header text: "No." or hash ("#").
 *
 * Classes:
 * - table.static-row-numbers
 * - table.static-row-header-text
 * - table.static-row-header-hash
 * - tr.static-row-header
 * - tr.static-row-numbers-norank
 *
 * Tested:
 * - Windows 10: (all skins) Chrome, Firefox, Edge.
 * - Android Galaxy S21 (MinervaNeue): Chrome, Firefox.
 * - Wikipedia Android app.
 * - Print.
 * - No JavaScript.
 * - Sticky gadget in Windows browsers (default skin).
 * - Dark Reader browser extention in Windows browsers (default skin).
 *
 * Notes:
 * - Sortable moves to thead any header rows and (after sort) sorttop rows.
 * - Sticky gadget (.mw-sticky-header) moves to thead any wikitable header rows.
 */
.static-row-numbers {
  counter-reset: rowNumber;
}
.static-row-numbers tr::before {
  content: "";
  display: table-cell;
  padding-right: 0.5em;
  padding-left: 0.5em;
  text-align: right;
  vertical-align: inherit;
}
.static-row-numbers.wikitable tr::before {
  background-color: #eaecf0;
}

/**
 * Add count to all tbody rows except for two classes. If no thead, skip the
 * first tbody row which may not have one of the two classes:
 */
.static-row-numbers thead + tbody tr:first-child:not(.static-row-header):not(.static-row-numbers-norank)::before,
.static-row-numbers tbody tr:not(:first-child):not(.static-row-header):not(.static-row-numbers-norank)::before {
  counter-increment: rowNumber;
  content: counter(rowNumber);
}

/**
 * Add column label to first row in thead or, if no thead, in tbody:
 */
.static-row-header-text.static-row-numbers thead tr:first-child::before,
.static-row-header-text.static-row-numbers caption + tbody tr:first-child::before,
.static-row-header-text.static-row-numbers tbody:first-child tr:first-child::before {
  content: "No.";
  font-weight: bold;
}
.static-row-header-hash.static-row-numbers thead tr:first-child::before,
.static-row-header-hash.static-row-numbers caption + tbody tr:first-child::before,
.static-row-header-hash.static-row-numbers tbody:first-child tr:first-child::before {
  content: "#";
  font-weight: bold;
}

/**
 * Add borders in numbers column.
 *
 * Windows Firefox tr::before doesn't inherit color, so hard set.
 * Plain table borders on Timeless {{row hover highlight}} mw-datatable.
 */
/* Wikitable. */
.static-row-numbers.wikitable tr::before {
  border: 0 solid #a2a9b1;
}
.static-row-numbers.wikitable thead + tbody tr:first-child:not(.static-row-header)::before,
.static-row-numbers.wikitable tbody tr:not(:first-child):not(.static-row-header)::before {
  border-width: 1px;
}
body.skin-monobook .static-row-numbers.wikitable tr::before {
  border-color: #aaaaaa;
}
body.skin-timeless .static-row-numbers.wikitable tr::before {
  border-color: #c8ccd1;
}
body.skin-minerva .static-row-numbers.wikitable tr::before {
  border-color: rgba(84,89,93,.3);
}
/* Plain with border. */
table[border].static-row-numbers:not(.wikitable) tr::before {
  border: 0 inset #202122;
}
table[border].static-row-numbers:not(.wikitable) thead + tbody tr:first-child:not(.static-row-header)::before,
table[border].static-row-numbers:not(.wikitable) tbody tr:not(:first-child):not(.static-row-header)::before {
  border-width: 1px;
}
body.skin-monobook table[border].static-row-numbers:not(.wikitable) tr::before,
body.skin-timeless table[border].static-row-numbers:not(.wikitable):not(.mw-datatable) tr::before {
  border-color: #000000;
}
/* Plain with optional border + .mw-datatable. */
body.skin-timeless .static-row-numbers.mw-datatable:not(.wikitable) tr::before {
  border: 0 solid #c8ccd1;
}
body.skin-timeless .static-row-numbers.mw-datatable:not(.wikitable) thead + tbody tr:first-child:not(.static-row-header)::before,
body.skin-timeless .static-row-numbers.mw-datatable:not(.wikitable) tbody tr:not(:first-child):not(.static-row-header)::before {
  border-width: 1px;
}
/* Minerva mobile. */
@media all and (max-width: 720px) {
  /* Wikitable. */
  body.skin-minerva .static-row-numbers.wikitable tr::before {
    border-left-width: 1px;
  }
  body.skin-minerva .static-row-numbers.wikitable thead tr:first-child::before,
  body.skin-minerva .static-row-numbers.wikitable caption + tbody tr:first-child::before,
  body.skin-minerva .static-row-numbers.wikitable tbody:first-child tr:first-child::before {
    border-top-width: 1px;
  }
  body.skin-minerva .static-row-numbers.wikitable tbody tr:last-child::before,
  body.skin-minerva .static-row-numbers.wikitable tfoot tr:last-child::before {
    border-bottom-width: 1px;
  }
}