From 15ddfffa22f9c3bb7cdbca05104bc6edac20dc7d Mon Sep 17 00:00:00 2001 From: xilan Date: Fri, 11 Dec 2020 19:23:38 +0800 Subject: [PATCH 1/3] fix: nested selector property override --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 515652f..c85d0aa 100644 --- a/index.js +++ b/index.js @@ -138,13 +138,13 @@ const rule = actual => { root.walkRules(rule => { const uniqueDecls = {}; rule.walkDecls(decl => { - uniqueDecls[decl.prop] = decl; + uniqueDecls[`${decl.prop}_${decl.parent.selector}`] = decl; }); function check(prop, index) { const decl = uniqueDecls[prop]; const value = decl.value; - const unprefixedProp = postcss.vendor.unprefixed(prop); + const unprefixedProp = postcss.vendor.unprefixed(prop.split('_')[0]); const unprefixedValue = postcss.vendor.unprefixed(value); ignored.forEach(ignore => { From c85a231996b54c8238395547c3b6254e9f6a3f83 Mon Sep 17 00:00:00 2001 From: xilan Date: Fri, 11 Dec 2020 19:36:12 +0800 Subject: [PATCH 2/3] fix: nested selector property override --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index c85d0aa..72c5669 100644 --- a/index.js +++ b/index.js @@ -138,7 +138,8 @@ const rule = actual => { root.walkRules(rule => { const uniqueDecls = {}; rule.walkDecls(decl => { - uniqueDecls[`${decl.prop}_${decl.parent.selector}`] = decl; + const { selector, indexes } = decl.parent; + uniqueDecls[`${decl.prop}_${selector}${JSON.stringify(indexes)}`] = decl; }); function check(prop, index) { From d0a76165b25665edbe24593bcba9ec7e0634b6bc Mon Sep 17 00:00:00 2001 From: xilan Date: Fri, 11 Dec 2020 19:54:10 +0800 Subject: [PATCH 3/3] fix: nested selector property override --- index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 72c5669..0057cdd 100644 --- a/index.js +++ b/index.js @@ -138,14 +138,13 @@ const rule = actual => { root.walkRules(rule => { const uniqueDecls = {}; rule.walkDecls(decl => { - const { selector, indexes } = decl.parent; - uniqueDecls[`${decl.prop}_${selector}${JSON.stringify(indexes)}`] = decl; + uniqueDecls[`${decl.prop}_${JSON.stringify(decl.source.start)}`] = decl; }); function check(prop, index) { const decl = uniqueDecls[prop]; const value = decl.value; - const unprefixedProp = postcss.vendor.unprefixed(prop.split('_')[0]); + const unprefixedProp = postcss.vendor.unprefixed(prop.split("_")[0]); const unprefixedValue = postcss.vendor.unprefixed(value); ignored.forEach(ignore => {