Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ module.exports = ({

function isAlreadyNested (rule) {
let container = rule.parent

let count = 0
let max = 100
while (container !== null && container.type !== 'root') {
if (count > max) {
return true
}
if (
container.type === 'atrule' &&
container.params.includes('hover: hover')
Expand All @@ -52,6 +56,7 @@ module.exports = ({
}

container = container.parent
count += 1
}

return false
Expand Down