Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept whitespace in var( --var ) expression #93

Merged
merged 2 commits into from
Feb 21, 2019

Conversation

benwest
Copy link
Contributor

@benwest benwest commented Feb 20, 2019

Accept whitespace in var( --var ) expressions

Fix #27

@@ -10,7 +10,7 @@ var cloneSpliceParentOntoNodeWhen = require('./clone-splice-parent-onto-node-whe
// var() = var( <custom-property-name> [, <any-value> ]? )
// matches `name[, fallback]`, captures "name" and "fallback"
// See: http://dev.w3.org/csswg/css-variables/#funcdef-var
var RE_VAR_FUNC = (/var\((--[^,\s]+?)(?:\s*,\s*(.+))?\)/);
var RE_VAR_FUNC = (/var\(\s*(--[^,\s]+?)(?:\s*,\s*(.+))?\s*\)/);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benwest Let's add some tests

@MadLittleMods
Copy link
Owner

Thanks @benwest, looks good! We just need some tests to ensure this continues working in the future

Copy link
Contributor Author

@benwest benwest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's this?

@MadLittleMods MadLittleMods merged commit 500f2fa into MadLittleMods:master Feb 21, 2019
MadLittleMods added a commit that referenced this pull request Feb 21, 2019
@MadLittleMods
Copy link
Owner

Thanks for the contribution @benwest! This is shipped in [email protected] and published to npm 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants