MDL-43804 themes: Update css not to use r0 and r1 identifiers for table rows

This commit is contained in:
Ankit Agarwal 2014-01-22 17:20:07 +08:00
parent 183515da23
commit 6b21643236
18 changed files with 63 additions and 45 deletions

View File

@ -1426,6 +1426,9 @@ class html_writer {
* method. In most cases this is not an issue at all so we do not clone by default for performance
* and memory consumption reasons.
*
* Please do not use .r0/.r1 for css, as they will be removed in Moodle 2.9.
* @todo MDL-43902 , remove r0 and r1 from tr classes.
*
* @param html_table $table data to be rendered
* @return string HTML code
*/

View File

@ -978,6 +978,9 @@ class flexible_table {
/**
* This function is not part of the public api.
*
* Please do not use .r0/.r1 for css, as they will be removed in Moodle 2.9.
* @todo MDL-43902 , remove r0 and r1 from tr classes.
*/
function print_row($row, $classname = '') {
static $suppress_lastrow = NULL;

View File

@ -532,10 +532,10 @@ table.quizreviewsummary td.cell {
clear: left;
}
#categoryquestions .r1 {
#categoryquestions > tbody > tr:nth-of-type(even) {
background: #e4e4e4;
}
#categoryquestions .r1.highlight {
#categoryquestions > tbody > tr:nth-of-type(even).highlight {
background-color: #AAFFAA;
}
#categoryquestions .header {

View File

@ -373,10 +373,10 @@ h2.tagline {
border: 1px solid #C8C9C7;
border-width: 0 1px;
}
.user .r1 .cell,
#categoryquestions .r1 .cell,
.group .r1 .cell,
.admin table .r1 .cell {
.user > tbody > tr:nth-of-type(even) .cell,
#categoryquestions > tbody > tr:nth-of-type(even) .cell,
.group > tbody > tr:nth-of-type(even) .cell,
.admin table > tbody > tr:nth-of-type(even) .cell {
background-color: #EEE;
}
.singlebutton,

View File

@ -1375,8 +1375,8 @@ html[dir=rtl] .formrow label.formlabel { float:right; }
html[dir=rtl] .configphp {direction:ltr;text-align:left;}
table.flexible .r0, table.generaltable .r0 {background-color: #F0F0F0;}
table.flexible .r1, table.generaltable .r1 {background-color: #FAFAFA;}
table.flexible > tbody > tr:nth-of-type(odd), table.generaltable > tbody > tr:nth-of-type(odd) {background-color: #F0F0F0;}
table.flexible > tbody > tr:nth-of-type(even), table.generaltable > tbody > tr:nth-of-type(even) {background-color: #FAFAFA;}
table.flexible .emptyrow {display: none;}
/* Form element: listing */
@ -1452,8 +1452,8 @@ body.jsenabled .formlisting {
table.collection th { font-size: inherit !important; border-width: 1px; border-style: solid; border-color: #CCCCCC; vertical-align: middle; padding-left: 5px; padding-right: 5px; vertical-align: top; text-align: center !important; }
table.collection td { border-width: 1px; border-style: solid; border-color: #CCCCCC; vertical-align: middle; padding-left: 5px; padding-right: 5px; vertical-align: top; }
table.collection .r1 { background-color: #FFFFFF; }
table.collection .r0 { background-color: #F6F6F6; }
table.collection > tbody > tr:nth-of-type(even) { background-color: #FFFFFF; }
table.collection > tbody > tr:nth-of-type(odd) { background-color: #F6F6F6; }
table.collection ul { margin: 0.5em 0.5em 0.5em 2em; }
.dir-rtl table.collection ul { margin: 0.5em 2em 0.5em 0.5em; }

View File

@ -213,8 +213,8 @@ div#dock {
.path-mod-survey {
.surveytable {
.r0 {background-color: #eee;}
.r1 {background-color: #ddd;}
> tbody > tr:nth-of-type(odd) {background-color: #eee;}
> tbody > tr:nth-of-type(even) {background-color: #ddd;}
.rblock label {text-align: center;}
}
.resultgraph, .reportsummary, .studentreport, .reportbuttons, .centerpara {

File diff suppressed because one or more lines are too long

View File

@ -936,10 +936,10 @@ td.eventskey {
padding: 2px 8px;
}
#page-user-action_redir .generaltable .r1 td,
#page-user-index #participants .r0 td,
#page-user-action_redir .generaltable > tbody > tr:nth-of-type(even) td,
#page-user-index #participants > tbody > tr:nth-of-type(odd) td,
.path-mod-choice .results .count,
.path-mod-forum .forumheaderlist .r1 td {
.path-mod-forum .forumheaderlist > tbody > tr:nth-of-type(even) td {
background: #f3f8ed;
}

View File

@ -596,10 +596,10 @@ table#user-grades tr.avg td.vmarked {
font-size:90%;
border:1px solid #999;
}
.userenrolment tr.r0 {
.userenrolment > tbody > tr:nth-of-type(odd) {
background-color: #F9F9F9;
}
.userenrolment tr.r1 {
.userenrolment > tbody > tr:nth-of-type(even) {
background-color: #F3F3F3;
}
.userenrolment td {

View File

@ -146,8 +146,8 @@ th.header,
.generalbox th,
.generaltable th.header {background-image:url([[pix:theme|trend/__setting_trendcolor__/gradient_h]]);background-color:[[setting:blockheaderbackground]];background-repeat:repeat-x;border-top:1px solid #C6BDA8;}
#modules, #compatibleblockstable {margin-left:auto; margin-right:auto;}
table.flexible .r0, table.generaltable .r0 {background-color: #F0F0F0;}
table.flexible .r1, table.generaltable .r1 {background-color: #FAFAFA;}
table.flexible > tbody > tr:nth-of-type(odd), table.generaltable > tbody > tr:nth-of-type(odd) {background-color: #F0F0F0;}
table.flexible > tbody > tr:nth-of-type(even), table.generaltable > tbody > tr:nth-of-type(even) {background-color: #FAFAFA;}
/* admin pages */
div#chooseuser {border:0 transparent none;}
@ -202,15 +202,15 @@ pre, code, tt {
color:grey;
}
#listdirectories tr.r0,
#listtables tr.r0,
#listfields tr.r0 {
#listdirectories > tbody > tr:nth-of-type(odd)
#listtables > tbody > tr:nth-of-type(odd),
#listfields > tbody > tr:nth-of-type(odd) {
background: none repeat scroll 0 0 #F0F0F0;
}
#listdirectories tr.r1,
#listtables tr.r1,
#listfields tr.r1 {
#listdirectories > tbody > tr:nth-of-type(even),
#listtables > tbody > tr:nth-of-type(even),
#listfields > tbody > tr:nth-of-type(even) {
background: none repeat scroll 0 0 #FAFAFA;
}

View File

@ -13,7 +13,7 @@
background-repeat: repeat-x;
background-position: left top;
}
.path-mod-forum .forumheaderlist .r1 td {
.path-mod-forum .forumheaderlist > tbody > tr:nth-of-type(even) td {
background-color: #f5f5f5;
}
.forumpost .topic {

View File

@ -872,7 +872,7 @@ table#categoryquestions th a {
padding: 0;
}
tr.r1 td {
> tbody > tr:nth-of-type(even) td {
background-color: #f9f9f9;
}

View File

@ -83,11 +83,11 @@
.admin .informationbox {border-color:#BBBBBB;background-color:#FFFFFF;}
#page-admin-index .adminerror {background-color:#FF6666;}
#page-admin-index .c0 {background-color: #FAFAFA;}
.path-admin .blockstable .r0 {background-color: #F0F0F0;}
.path-admin .blockstable .r1 {background-color: #FAFAFA;}
.path-admin .blockstable > tbody > tr:nth-of-type(odd) {background-color: #F0F0F0;}
.path-admin .blockstable > tbody > tr:nth-of-type(even) {background-color: #FAFAFA;}
.path-admin .incompatibleblockstable td.c0 {color: #ff0000;}
table.flexible .r0 {background-color: #F0F0F0;}
table.flexible .r1 {background-color: #FAFAFA;}
table.flexible > tbody > tr:nth-of-type(odd) {background-color: #F0F0F0;}
table.flexible > tbody > tr:nth-of-type(even) {background-color: #FAFAFA;}
#page-admin-report-security-index #timewarning {text-align:center;}
#adminsettings fieldset {background-color: #EEE;border:1px solid #BBB;color: #000;}
@ -105,8 +105,8 @@ table.flexible .r1 {background-color: #FAFAFA;}
#page-admin-qtypes .cell.c3 {font-size: 0.7em;}
#page-admin-lang .translator {border-color: #DDDDDD;}
#page-admin-lang .translator tr.r0 {background-color: #F0F0F0;}
#page-admin-lang .translator tr.r1 {background-color: #FAFAFA;}
#page-admin-lang .translator > tbody > tr:nth-of-type(odd) {background-color: #F0F0F0;}
#page-admin-lang .translator > tbody > tr:nth-of-type(even) {background-color: #FAFAFA;}
#page-admin-lang .translator .strkey {color: #666666;}
#page-admin-lang .translator .bothmissing {background-color: #EF6868;}
#page-admin-lang .translator .mastermissing {background-color: #FEFF7F;}

View File

@ -129,7 +129,7 @@ table.formtable tbody th {background-color: transparent;background-image: none;}
.logtable {margin-left:auto;margin-right:auto;}
.logtable td {font-size: 0.8em;}
.logtable th {font-size: 0.9em;}
.logtable .r1 {background-color:#EEEEEE;}
.logtable > tbody > tr:nth-of-type(even) {background-color:#EEEEEE;}
/**
* Blog
@ -428,14 +428,14 @@ table#tag-management-list {margin: 10px auto;width: 80%;}
* Enrol
*/
.userenrolment {border:1px solid #999;}
.userenrolment tr.r0 {background-color:#F9F9F9;}
.userenrolment tr.r1 {background-color:#F3F3F3;}
.userenrolment > tbody > tr:nth-of-type(odd) {background-color:#F9F9F9;}
.userenrolment > tbody > tr:nth-of-type(even) {background-color:#F3F3F3;}
.userenrolment td {border:1px solid #E9E9E9;border-top-color:#F6F6F6;border-right-color:#EEE;border-left-color:#F3F3F3;}
.userenrolment td.c0 {border-left-width:0;}
.userenrolment td.lastcol {border-right-color:#999;}
.userenrolment .col_bulkops {vertical-align:middle;text-align:center;}
.userenrolment .r0 .col_bulkops {background-color:#FFFFFF;}
.userenrolment .r1 .col_bulkops {background-color:#F9F9F9;}
.userenrolment > tbody > tr:nth-of-type(odd) .col_bulkops {background-color:#FFFFFF;}
.userenrolment > tbody > tr:nth-of-type(even) .col_bulkops {background-color:#F9F9F9;}
.userenrolment tr.lastrow td {border-bottom-width:0;}
.userenrolment .col_userdetails {min-width:35%;}
.userenrolment .col_role .role a img {height:8px;}

View File

@ -7,8 +7,8 @@
#page-grade-index .grades {border-color:#000;}
#page-grade-index .grades td {border-color:#E0E0E0;}
#page-grade-index .grades .r0 {background-color: #FFF;}
#page-grade-index .grades .r1 {background-color: #F0F0F0;}
#page-grade-index .grades > tbody > tr:nth-of-type(odd) {background-color: #FFF;}
#page-grade-index .grades > tbody > tr:nth-of-type(even) {background-color: #F0F0F0;}
td.grade div.overridden {background-color: #DDDDDD;}

View File

@ -156,8 +156,8 @@ a#mod-scorm-log-toggle {font-size: 0.7em;font-weight: bold;}
.path-mod-survey .resultgraph {text-align:center;border-width:1px;border-style: solid;}
.path-mod-survey .questiontext {font-size:1em;}
.path-mod-survey .surveytable .rblock label {text-align: center;}
#page-mod-survey-view .r0 {background-color: #EEEEEE;}
#page-mod-survey-view .r1 {background-color: #DDDDDD;}
#page-mod-survey-view > tbody > tr:nth-of-type(odd) {background-color: #EEEEEE;}
#page-mod-survey-view > tbody > tr:nth-of-type(even) {background-color: #DDDDDD;}
#page-mod-survey-report .reportsummary,
#page-mod-survey-report .studentreport,
#page-mod-survey-report .reportbuttons,

View File

@ -6,8 +6,8 @@
.que .history {font-size:0.8em;}
.que .incorrect {background-color: #faa;}
.que .partiallycorrect {background-color: #ff9;}
.que .r0 {background-color: #F5F5F5;}
.que .r1 {background-color: #EEE;}
.que > tbody > tr:nth-of-type(odd) {background-color: #F5F5F5;}
.que > tbody > tr:nth-of-type(even) {background-color: #EEE;}
#chooseqtype .qtypename {font-weight: bold;}

View File

@ -1,6 +1,18 @@
This files describes API changes in /theme/* themes,
information provided here is intended especially for theme designer.
=== 2.7 ===
* Please update your css to use 'tr:nth-of-type(odd/even)' instead of '.ro/.r1' to apply tr specific css for various tables.
These classes are deprecated now and will be removed in Moodle 2.9. Here is an example to update your css:-
old code
table.generaltable .r0 {background-color: #F0F0F0;}
table.generaltable .r1 {background-color: #F0F0F0;}
new code
table.generaltable > tbody > tr:nth-of-type(odd) {background-color: #F0F0F0;}
table.generaltable > tbody > tr:nth-of-type(even) {background-color: #F0F0F0;}
=== 2.6 ===
Removed themes: