| 356 | } |
| 357 | |
| 358 | walkDecls(prop, callback) { |
| 359 | if (!callback) { |
| 360 | callback = prop |
| 361 | return this.walk((child, i) => { |
| 362 | if (child.type === 'decl') { |
| 363 | return callback(child, i) |
| 364 | } |
| 365 | }) |
| 366 | } |
| 367 | if (prop instanceof RegExp) { |
| 368 | return this.walk((child, i) => { |
| 369 | if (child.type === 'decl' && prop.test(child.prop)) { |
| 370 | return callback(child, i) |
| 371 | } |
| 372 | }) |
| 373 | } |
| 374 | return this.walk((child, i) => { |
| 375 | if (child.type === 'decl' && child.prop === prop) { |
| 376 | return callback(child, i) |
| 377 | } |
| 378 | }) |
| 379 | } |
| 380 | |
| 381 | walkRules(selector, callback) { |
| 382 | if (!callback) { |