Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

A few more simple rules. Fixed a typo.

  • Loading branch information...
commit 43f7ba49577652a21bc95ae0d3d5f385f3fdb514 1 parent 958e099
Brian J authored
Showing with 60 additions and 11 deletions.
  1. +60 −11 debugCSS.css
View
71 debugCSS.css
@@ -25,12 +25,16 @@
/* ERROR MESSAGES */
/******************/
-/* All errors should try to post a message explaning the problem. */
+/* All errors should try to post a message explaining the problem. */
+table:not([summary]):after,
table > tr:after,
+table th:not([scope]):after,
table thead td:after,
table > tbody:first-child:after,
+table > tbody + tfoot:after,
table > tr:first-child:last-child:after,
table > tbody > tr:first-child:last-child:after,
+table > *:not(thead):not(tfoot):not(tbody):not(tr):not(colgroup):not(caption):after,
table[border]:after,
img:not([alt]):after,
a:not([href]):after,
@@ -59,11 +63,16 @@ html[xmlns] a h6:after,
ol > *:not(li),
ul > *:not(li),
dl > *:not(dt):not(dd):after,
+form > *:not(fieldset):after,
+fieldset *:not(legend):first-child:after,
+center:after,
+u:after,
font:after,
b:after,
i:after,
blink:after,
marquee:after {
+ border: 1px solid #000;
color: #000;
display: block;
font-family: helvetica;
@@ -80,25 +89,45 @@ marquee:after {
element.
*/
+table:not([summary]):after {
+ background: green;
+ content: 'Should you have a SUMMARY attribute on your TABLE?';
+}
+
table > tr:after {
background: yellow;
- content: 'Table does not have a tbody';
+ content: 'TABLE does not have a TBODY.';
+}
+
+table th:not([scope]):after {
+ background: green;
+ content: 'Should TH have a SCOPE attribute (ROW or COL)?.';
}
table thead td:after {
background: green;
- content: 'Cells in thead should be th.';
+ content: 'Cells in THEAD should be TH.';
}
table > tbody:first-child:after {
background: green;
- content: 'Do you need a thead or tfoot?';
+ content: 'Do you need a THEAD or TFOOT?';
+}
+
+table > tbody + tfoot:after {
+ background: yellow;
+ content: 'TBODY should come after TFOOT.';
}
table > tr:first-child:last-child:after,
table > tbody > tr:first-child:last-child:after {
background: green;
- content: 'Only one table row in table. Are you using it for layout?';
+ content: 'Only one TR in TABLE. Are you using it for layout?';
+}
+
+table > *:not(thead):not(tfoot):not(tbody):not(tr):not(colgroup):not(caption):after {
+ background: yellow;
+ content: 'Only THEAD/TFOOT/TBODY/COLGROUP/CAPTION/TR can be children of a TABLE';
}
table[border]:after {
@@ -108,7 +137,7 @@ table[border]:after {
img:not([alt]):after {
background: yellow;
- content: 'Image does not have an alt tag.';
+ content: 'Image does not have an ALT attribute.';
}
a[href="#"]:after,
@@ -127,17 +156,17 @@ a[onmouseout]:after {
label:not([for]):after {
background: green;
- content: 'Should label have a for attribute?';
+ content: 'Should LABEL have a FOR attribute?';
}
nav:not([role]):after {
background: yellow;
- content: 'Nav element should have a role.';
+ content: 'NAV element should have a ROLE attribute.';
}
div[role="img"]:not([aria-label]):after {
background: yellow;
- content: 'Div used as image should have aria-label';
+ content: 'DIV used as image should have ARIA-LABEL.';
}
h1 div:after,
@@ -169,6 +198,18 @@ dl > *:not(dt):not(dd):after {
content: 'Only DT/DD can be children of a DL';
}
+form > *:not(fieldset):after {
@imbrianj Owner
imbrianj added a note

Not completely certain of the "form > *:not(fieldset)" rule as it's not necessarily wrong - but is good practice in most cases. Leaving it in for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ background: green;
+ content: 'Should you be using a FIELDSET?';
+}
+
+fieldset *:not(legend):first-child:after {
+ background: green;
+ content: 'Should your FIELDSET be using a LEGEND?';
+}
+
+center:after,
+u:after,
font:after {
background: yellow;
content: 'Deprecated tag used.';
@@ -180,7 +221,7 @@ i:after,
blink:after,
marquee:after {
background: green;
- content: 'Should you be using strong or em?';
+ content: 'Should you be using STRONG or EM?';
}
/******************/
@@ -192,6 +233,8 @@ marquee:after {
messing with the document flow.
*/
+table:not([summary]),
+table th:not([scope]),
table thead td,
table > tr:first-child:last-child,
table > tbody > tr:first-child:last-child,
@@ -202,6 +245,8 @@ i {
}
table > tr,
+table > tbody + tfoot,
+table > *:not(thead):not(tfoot):not(tbody):not(tr):not(colgroup):not(caption),
table[border],
img:not([alt]),
a:not([href]),
@@ -229,7 +274,11 @@ html[xmlns] a h5,
html[xmlns] a h6,
ol > *:not(li),
ul > *:not(li),
-dl > *:not(dt):not(dd):after,
+dl > *:not(dt):not(dd),
+form > *:not(fieldset),
+fieldset *:not(legend):first-child,
+center,
+u,
font,
blink,
marquee {
@imbrianj

Not completely certain of the "form > *:not(fieldset)" rule as it's not necessarily wrong - but is good practice in most cases. Leaving it in for now.

Please sign in to comment.
Something went wrong with that request. Please try again.