diff --git a/src/lib/style-properties.html b/src/lib/style-properties.html index 2003695f20..e939c55081 100644 --- a/src/lib/style-properties.html +++ b/src/lib/style-properties.html @@ -98,6 +98,10 @@ var m; while (m = this.rx.VAR_CAPTURE.exec(cssText)) { props[m[1]] = true; + var def = m[2]; + if (def && def.match(this.rx.IS_VAR)) { + props[def] = true; + } } }, @@ -336,6 +340,7 @@ // var(--a, fallback-literal(with-one-nested-parens)) VAR_MATCH: /(^|\W+)var\([\s]*([^,)]*)[\s]*,?[\s]*((?:[^,)]*)|(?:[^;]*\([^;)]*\)))[\s]*?\)/gim, VAR_CAPTURE: /\([\s]*(--[^,\s)]*)(?:,[\s]*(--[^,\s)]*))?(?:\)|,)/gim, + IS_VAR: /^--/, BRACKETED: /\{[^}]*\}/g, HOST_PREFIX: '(?:^|[^.])', HOST_SUFFIX: '($|[.:[\\s>+~])' diff --git a/test/unit/styling-cross-scope-var.html b/test/unit/styling-cross-scope-var.html index d97d6ee626..eae25ff82c 100644 --- a/test/unit/styling-cross-scope-var.html +++ b/test/unit/styling-cross-scope-var.html @@ -199,6 +199,26 @@ + + + + + + +