mirror of
https://github.com/thangisme/notes.git
synced 2025-11-23 13:12:25 -05:00
Initial commit
This commit is contained in:
21
node_modules/stylelint/lib/utils/findAtRuleContext.js
generated
vendored
Normal file
21
node_modules/stylelint/lib/utils/findAtRuleContext.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
/* @flow */
|
||||
"use strict"
|
||||
|
||||
/**
|
||||
* Find the at-rule in which a rule is nested.
|
||||
*
|
||||
* Returns `null` if the rule is not nested within an at-rule.
|
||||
*/
|
||||
module.exports = function findAtRuleContext(
|
||||
rule/*: postcss$rule */
|
||||
)/*: ?postcss$atRule*/ {
|
||||
const parent = rule.parent
|
||||
|
||||
if (parent.type === "root") {
|
||||
return null
|
||||
}
|
||||
if (parent.type === "atrule") {
|
||||
return parent
|
||||
}
|
||||
return findAtRuleContext(parent)
|
||||
}
|
||||
Reference in New Issue
Block a user