-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrules.php
309 lines (309 loc) · 9.67 KB
/
rules.php
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<?php
/* Need to add !important */
$rules = array(
"at-rules" => array(
"2.1" => array(
"charset" => "/@charset ([^\{]+)\{((?!@charset)[\s\S])*(?=\}(?![^\{]*\}))}/mi",
"import" => "/@import ([^\{]+)\{((?!@import)[\s\S])*(?=\}(?![^\{]*\}))}/mi",
"media" => "/@media ([^\{]+)\{((?!@media)[\s\S])*(?=\}(?![^\{]*\}))}/mi",
"page" => "/@page ([^\{]+)\{((?!@page)[\s\S])*(?=\}(?![^\{]*\}))}/mi"
),
"3" => array(
"font-face" => "/@font-face ([^\{]+)\{((?!@font-face)[\s\S])*(?=\}(?![^\{]*\}))}/mi",
"namespace" => "/@namespace ([^\{]+)\{((?!@namespace)[\s\S])*(?=\}(?![^\{]*\}))}/mi"
)
),
"selectors" => array(
"2.1" => array(
"." => "/\.[a-zA-Z0-9-_]{1,100}/",
"#" => "/\#[a-zA-Z0-9-_]{1,100}/",
"E" => "/^[a-zA-Z0-9]+$/",
"*" => "/^[\*]+$/"
),
"3" => array(
// "ns|e" => "/(a-zA-Z0-9-_)|/"
)
),
"attribute_selectors" => array(
"2.1" => array(
"[att]" => "/\[(a-zA-Z0-9^=){1}]/",
"[att=val]" => "/\[(.*?)=(\"?)(.*?)(\"?)]/",
"[att|=val]" => "/\[(.*?)\|=(\"?)(.*?)(\"?)]/",
"[att~=val]" => "/\[(.*?)\~=(\"?)(.*?)(\"?)]/"
),
"3" => array(
"[ns|att]" => "/\[(.*?)\|[(\"?)(.*?)(\"?)]/",
"[att^=val]" => "/\[(.*?)\^=[(\"?)(.*?)(\"?)]/",
"[att*=val]" => "/\[(.*?)\*=[(\"?)(.*?)(\"?)]/",
"[att$=val]" => "/\[(.*?)\$=[(\"?)(.*?)(\"?)]/"
)
),
"combinators" => array(
"2.1" => array(
"E+F" => "/[a-zA-Z0-9-_]{1,100} \+ [a-zA-Z0-9-_]{1,100}/",
"E>F" => "/[a-zA-Z0-9-_]{1,100} \> [a-zA-Z0-9-_]{1,100}/",
"E F" => "/[a-zA-Z0-9-_]{1,100}\s[a-zA-Z0-9-_]{1,100}/"
),
"3" => array(
"E~F" => "/[a-zA-Z0-9-_^@]{1,100} \~ [a-zA-Z0-9-_]{1,100}/"
)
),
"pseudo_classes" => array(
"2.1" => array(
":active" => "/:active/",
":first-child" => "/:first-child/",
":focus" => "/:focus/",
":hover" => "/:hover/",
":lang" => "/:lang\((\s?)\)/",
":link" => "/:link/",
":visited" => "/:visited/"
),
"3" => array(
":root" => "/:root/",
":nth-child" => "/:nth-child\((\d?)\)/",
":nth-last-child" => "/:nth-last-child\((\d?)\)/",
":nth-of-type" => "/:nth-of-type\((\d?)\)/",
":nth-last-of-type" => "/:nth-last-of-type\((\d?)\)/",
":last-child" => "/:last-child/",
":first-of-type" => "/:first-of-type/",
":last-of-type" => "/:last-of-type/",
":only-child" => "/:only-child/",
":only-of-type" => "/:only-of-type/",
":empty" => "/:empty/",
":target" => "/:target/",
":not" => "/:not\((\s?)\)/",
":enabled" => "/:enabled/",
":disabled" => "/:disabled/",
":checked" => "/:checked/",
":indeterminate" => "/:indeterminate/",
":default" => "/:default/",
":valid" => "/:valid/",
":invalid" => "/:invalid/",
":in-range" => "/:in-range/",
":out-of-range" => "/:out-of-range/",
":required" => "/:required/",
":optional" => "/:optional/",
":read-only" => "/:read-only/",
":read-write" => "/:read-write/"
)
),
"pseudo_elements" => array(
"2.1" => array(
":after" => "/([a-zA-Z0-9-_]):after/",
":before" => "/([a-zA-Z0-9-_]):before/",
":first-letter" => "/([a-zA-Z0-9-_]):first-letter/",
":first-line" => "/([a-zA-Z0-9-_]):first-line/"
),
"3" => array(
"::after" => "/([a-zA-Z0-9-_])::after/",
"::before" => "/([a-zA-Z0-9-_])::before/",
"::first-letter" => "/([a-zA-Z0-9-_])::first-letter/",
"::first-line" => "/([a-zA-Z0-9-_])::first-line/",
"::selection" => "/([a-zA-Z0-9-_])::selection/",
"::value" => "/([a-zA-Z0-9-_])::value/",
"::choices" => "/([a-zA-Z0-9-_])::choices/",
"::repeat-item" => "/([a-zA-Z0-9-_])::repeat-item/",
"::repeat-index" => "/([a-zA-Z0-9-_])::repeat-index/"
)
),
/* Properties */
"2d-transforms" => array(
"2.1" => array(),
"3" => array(
"transform" => "//",
"transform-origin" => "//"
)
),
"list" => array(
"2.1" => array(
"list-style" => "//",
"list-style-image" => "//",
"list-style-position" => "//",
"list-style-type" => "//"
),
"3" => array()
),
"color-background" => array(
"2.1" => array(
"color" => "//",
"background" => "//",
"background-attachment" => "//",
"background-color" => "//",
"background-image" => "//",
"background-position" => "//",
"background-repeat" => "//"
),
"3" => array(
"color-profile" => "//",
"rendering-intent" => "//",
"background" => "//",
"background-clip" => "//",
"background-origin" => "//",
"background-break" => "//",
"background-size" => "//"
)
),
"font-text" => array(
"2.1" => array(
"direction" => "/direction/",
"font" => "/^[font]+$/",
"font-family" => "/font-family/",
"font-size" => "/font-size/",
"font-style" => "/font-style/",
"font-variant" => "/font-variant/",
"font-weight" => "/font-weight/",
"letter-spacing" => "/letter-spacing/",
"line-height" => "/line-height/",
"text-align" => "/text-align/",
"text-decoration" => "/text-decoration/",
"text-indent" => "/text-indent/",
"text-transform" => "/text-transform/",
"unicode-bidi" => "/unicode-bidi/",
"vertical-align" => "/vertical-align/",
"white-space" => "/white-space/",
"word-spacing" => "/word-spacing/"
),
"3" => array(
"font-effect" => "/font-effect/",
"font-emphasize" => "/font-emphasize/",
"font-size" => "/font-size/",
"font-smooth" => "/font-smooth/",
"font-stretch" => "/font-stretch/",
"hanging-punctuation" => "/hanging-punctuation/",
"punctuation-trim" => "/punctuation-trim/",
"ruby-align" => "/ruby-align/",
"ruby-overhang" => "/ruby-overhang/",
"ruby-position" => "/ruby-position/",
"ruby-span" => "/ruby-span/",
"text-align" => "/text-align/",
"text-emphasis" => "/text-emphasis/",
"text-justify" => "/text-justify/",
"text-outline" => "/text-outline/",
"text-overflow" => "/text-overflow/",
"text-shadow" => "/text-shadow/",
"text-wrap" => "/text-wrap/",
"word-break" => "/word-break/",
"word-wrap" => "/word-wrap/",
"writing-mode" => "/writing-mode/"
)
),
"generated-content" => array(
"2.1" => array(
"content" => "/^[content]+$/",
"counter-increment" => "/counter-increment/",
"counter-reset" => "/counter-reset/",
"quotes" => "/^[quotes]+$/"
),
"3" => array()
),
"border-layout" => array(
"2.1" => array(
"border" => "/^[border]+$/",
"border-bottom" => "/^[border-bottom]+$/",
"border-bottom-color" => "/border-bottom-color/",
"border-bottom-style" => "/border-bottom-style/",
"border-bottom-width" => "/border-bottom-width/",
"border-collapse" => "/border-collapse/",
"border-color" => "/border-color/",
"border-left" => "/^[border-left]+$/",
"border-left-color" => "/border-left-color/",
"border-left-style" => "/border-left-style/",
"border-left-width" => "/border-left-width/",
"border-right" => "/^[border-right]+$/",
"border-right-color" => "/border-right-color/",
"border-right-style" => "/border-right-style/",
"border-right-width" => "/border-right-width/",
"border-spacing" => "/border-spacing/",
"border-style" => "/border-style/",
"border-top" => "/^[border-top]+$/",
"border-top-color" => "/border-top-color/",
"border-top-style" => "/border-top-style/",
"border-top-width" => "/border-top-width/",
"border-width" => "/border-width/",
"caption-side" => "/caption-side/",
"clear" => "/clear/",
"empty-cells" => "/empty-cells/",
"float" => "/float/",
"margin" => "/^[margin]+$/",
"margin-right" => "/margin-right/",
"margin-left" => "/margin-left/",
"margin-top" => "/margin-top/",
"margin-bottom" => "/margin-bottom/",
"padding" => "/^[padding]+$/",
"padding-right" => "/padding-right/",
"padding-left" => "/padding-left/",
"padding-top" => "/padding-top/",
"padding-bottom" => "/padding-bottom/",
"table-layout" => "/table-layout/"
),
"3" => array(
"border-break" => "/border-break/",
"border-image" => "/border-image/",
"border-radius" => "/border-radius/",
"box-shadow" => "/box-shadow/"
)
),
"positioning" => array(
"2.1" => array(
"bottom" => "/bottom/",
"clip" => "/clip/",
"display" => "/display/",
"height" => "/height/",
"left" => "/left/",
"max-height" => "/max-height/",
"max-width" => "/max-width/",
"min-height" => "/min-height/",
"min-width" => "/min-width/",
"overflow" => "/overflow/",
"position" => "/position/",
"right" => "/right/",
"top" => "/top/",
"visibility" => "/visibility/",
"width" => "/width/",
"z-index" => "/z-index/"
),
"3" => array(
"overflow-x" => "/overflow-x/",
"overflow-y" => "/overflow-y/"
)
),
"printing" => array(
"2.1" => array(
"orphans" => "/orphans/",
"page-break-after" => "/page-break-after/",
"page-break-before" => "/page-break-before/",
"page-break-inside" => "/page-break-inside/",
"widows" => "/widows/"
),
"3" => array(
"fit" => "/^[fit]+$/",
"fit-position" => "/fit-position/",
"image-orientation" => "/image-orientation/",
"page" => "/page/",
"size" => "/size/"
)
),
"user-interface" => array(
"2.1" => array(
"cursor" => "/cursor/",
"outline" => "/^[outline]+$/",
"outline-color" => "/outline-color/",
"outline-style" => "/outline-style/",
"outline-width" => "/outline-width/"
),
"3" => array(
"appearance" => "/appearance/",
"box-sizing" => "/box-sizing/",
"icon" => "/icon/",
"nav-down" => "/nav-down/",
"nav-index" => "/nav-index/",
"nav-left" => "/nav-left/",
"nav-right" => "/nav-right/",
"nav-up" => "/nav-up/",
"outline-offset" => "/outline-offset/",
"outline-radius" => "/outline-radius/",
"resize" => "/resize/"
)
)
);
?>