-
Notifications
You must be signed in to change notification settings - Fork 12
/
debug.css
162 lines (135 loc) · 2.58 KB
/
debug.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/*------------------------------------*\
$DEBUG
\*------------------------------------*/
/**
* Enable this stylesheet to visually detect any improperly nested or
* potentially invalid markup, or any potentially inaccessible code.
*
* Red == definite error
* Yellow == double-check
* None == should be fine
*
* Please note that this method of checking markup quality should not be relied
* upon entirely. Validate your markup!
*/
/**
* Are there any empty elements in your page?
*/
:empty{
outline:5px solid yellow;
}
/**
* Images require `alt` attributes, empty `alt`s are fine but should be
* double-checked, no `alt` is bad and is flagged red.
*/
img{
outline:5px solid red;
}
img[alt]{
outline:none;
}
img[alt=""]{
outline:5px solid yellow;
}
/**
* Links sometimes, though not always, benefit from `title` attributes. Links
* without are never invalid but it’s a good idea to check.
*/
a{
outline:5px solid yellow;
}
a[title]{
outline:none;
}
/**
* Double-check any links whose `href` is something questionable.
*/
a[href="#"],
a[href*="javascript"]{
outline:5px solid yellow;
}
/**
* The `target` attribute ain’t too nice...
*/
a[target]{
outline:5px solid yellow;
}
/**
* Ensure any lists only contain `li`s as children.
*/
ul > *:not(li),
ol > *:not(li) {
outline: 5px solid red; }
/**
* It’s always nice to give `th`s `scope` attributes.
*/
th{
outline:5px solid yellow;
}
th[scope]{
outline:none;
}
/**
* `tr`s as children of `table`s ain’t great, did you need a `thead`/`tbody`?
*/
table > tr{
outline:5px solid yellow;
}
/**
* `tfoot` needs to come *before* `tbody`.
*/
tbody + tfoot{
outline:5px solid yellow;
}
/**
* Forms require `action` attributes
*/
form{
outline:5px solid red;
}
form[action]{
outline:none;
}
/**
* Various form-field types have required attributes. `input`s need `type`
* attributes, `textarea`s need `rows` and `cols` attributes and submit buttons
* need a `value` attribute.
*/
textarea,
input{
outline:5px solid red;
}
input[type]{
outline:none;
}
textarea[rows][cols]{
outline:none;
}
input[type=submit]{
outline:5px solid red;
}
input[type=submit][value]{
outline:none;
}
/**
* Avoid inline styles where possible.
*/
[style]{
outline:5px solid yellow;
}
/**
* You should avoid using IDs for CSS, is this doing any styling?
*/
[id]{
outline:5px solid yellow;
}
/**
* Definition lists should only contain DT and DD elements
*/
dl > * {
outline:5px solid red;
}
dl > dt,
dl > dd {
outline:none;
}