MCPcopy
hub / github.com/postcss/postcss / walkAtRules

Method walkAtRules

lib/container.js:327–348  ·  view source on GitHub ↗
(name, callback)

Source from the content-addressed store, hash-verified

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) => {

Callers 2

OnceFunction · 0.80
container.test.tsFile · 0.80

Calls 1

walkMethod · 0.95

Tested by 1

OnceFunction · 0.64