| 325 | } |
| 326 | |
| 327 | walkAtRules(name, callback) { |
| 328 | if (!callback) { |
| 329 | callback = name |
| 330 | return this.walk((child, i) => { |
| 331 | if (child.type === 'atrule') { |
| 332 | return callback(child, i) |
| 333 | } |
| 334 | }) |
| 335 | } |
| 336 | if (name instanceof RegExp) { |
| 337 | return this.walk((child, i) => { |
| 338 | if (child.type === 'atrule' && name.test(child.name)) { |
| 339 | return callback(child, i) |
| 340 | } |
| 341 | }) |
| 342 | } |
| 343 | return this.walk((child, i) => { |
| 344 | if (child.type === 'atrule' && child.name === name) { |
| 345 | return callback(child, i) |
| 346 | } |
| 347 | }) |
| 348 | } |
| 349 | |
| 350 | walkComments(callback) { |
| 351 | return this.walk((child, i) => { |