Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I haven't tested all of them, but I believe this should completely fix issue #45
All tests pass, and all the examples seem to work the same.
Rather than hacking up more hardcoded stuff, I went for a more general solution so that almost any CSS value will work.
The general gist of it is that numbers (with or without unit) are given a type of "number", functions are given a type of "function", space-separated values are given a type of "multi", and everything else is given a type of "normal".
And the parsing is designed to be extremely lenient, so that
foo(bar, 50qux)
is legal. This lets it handle all kinds of values (assuming it works in the browser, of course).Bonus: discrete values like "font-weight: bold" work now.
One downside is I got rid of
morpheus.parseTransform
andmorpheus.formatTransform
. Not sure why those were public in the first place.Also, apparently trying to set "boxShadow" causes the browser to go into an infinite loop (!) which I think is related to the parser, but that hopefully shouldn't be too hard to fix.