Skip to content

Commit

Permalink
Fixes #1974: Correct custom property regexp's so that `--foo: \n var(…
Browse files Browse the repository at this point in the history
…--bar);` is supported.
  • Loading branch information
Steven Orvell committed Jul 8, 2015
1 parent b97788d commit 1924ec8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/lib/style-properties.html
Original file line number Diff line number Diff line change
Expand Up @@ -344,15 +344,15 @@
},

rx: {
VAR_ASSIGN: /(?:^|[;\n]\s*)(--[\w-]*?):\s*?(?:([^;{]*?)|{([^}]*)})(?:(?=[;\n])|$)/gim,
MIXIN_MATCH: /(?:^|\W+)@apply[\s]*\(([^)]*)\)/im,
VAR_ASSIGN: /(?:^|[;\n]\s*)(--[\w-]*?):\s*(?:([^;{]*)|{([^}]*)})(?:(?=[;\n])|$)/gi,
MIXIN_MATCH: /(?:^|\W+)@apply[\s]*\(([^)]*)\)/i,
// note, this supports:
// var(--a)
// var(--a, --b)
// var(--a, fallback-literal)
// var(--a, fallback-literal(with-one-nested-parens))
VAR_MATCH: /(^|\W+)var\([\s]*([^,)]*)[\s]*,?[\s]*((?:[^,)]*)|(?:[^;]*\([^;)]*\)))[\s]*?\)/gim,
VAR_CAPTURE: /\([\s]*(--[^,\s)]*)(?:,[\s]*(--[^,\s)]*))?(?:\)|,)/gim,
VAR_MATCH: /(^|\W+)var\([\s]*([^,)]*)[\s]*,?[\s]*((?:[^,)]*)|(?:[^;]*\([^;)]*\)))[\s]*?\)/gi,
VAR_CAPTURE: /\([\s]*(--[^,\s)]*)(?:,[\s]*(--[^,\s)]*))?(?:\)|,)/gi,
IS_VAR: /^--/,
BRACKETED: /\{[^}]*\}/g,
HOST_PREFIX: '(?:^|[^.#[:])',
Expand Down
3 changes: 2 additions & 1 deletion test/unit/styling-cross-scope-var.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
}

#gc4 {
--grand-child-scope-var: var(--gc4-scope);
--grand-child-scope-var:
var(--gc4-scope);
}
</style>

Expand Down

0 comments on commit 1924ec8

Please sign in to comment.