You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bug is in the Hooks.injectValue function. Specifically, CSS.RegEx.valueSplit converts #ff0000 -2px 0px 0px 0px, #00ff00 2px 0px 0px 0px into the wrong pieces. The code just needs to apply the same action to every item in the list. I've created the following replacement function which works for our needs, feel free to use it as you will. If you want I can tidy it up into a PR, but your documentation says not to :-). Also the fact that line endings are ^M instead of \n make it much more difficult to work in the codebase and lastly it would be great if you could hook up package.json such that npm test works. Thanks!
P.S. the regex is needed to capture the case of rgb(0,0,0) 0px 0px 0px, . It is just looking for a comma outside of parens(). I am not sure if there is any other valid CSS that can have commas in them, but they would also need to be detected with the regex.
injectValue: function(fullHookName,hookValue,rootPropertyValue){varhookData=CSS.Hooks.registered[fullHookName];if(hookData){varhookRoot=hookData[0],hookPosition=hookData[1],rootPropertyValueParts,rootPropertyValueUpdated;rootPropertyValue=CSS.Hooks.cleanRootPropertyValue(hookRoot,rootPropertyValue);rootPropertyValueUpdated=rootPropertyValue.split(/, +(?![^(]*?\))/g).map(function(item){/* Split rootPropertyValue into its individual hook values, replace the targeted value with hookValue, then reconstruct the rootPropertyValue string. */rootPropertyValueParts=item.toString().match(CSS.RegEx.valueSplit);rootPropertyValueParts[hookPosition]=hookValue;returnrootPropertyValueParts.join(" ");}).join(', ');returnrootPropertyValueUpdated;}else{/* If the provided fullHookName isn't a registered hook, return the rootPropertyValue that was passed in. */returnrootPropertyValue;}}
The text was updated successfully, but these errors were encountered:
You can set git itself to change line endings on pull and push ;-)
From what I remember you also have the background style like this - linear gradient(keywords, color number%, color number%, ...), another background using a different format, etc....
Box-shadow can have the argument order in multiple ways which all. I always put the color at the end as recommended by MDN - and chrome always puts the colour at the start.
Perhaps there should be a colour only version of this that finds rgb/rgba/# values for adjusting?
Repro example:
http://jsfiddle.net/65xCP/138/
The bug is in the Hooks.injectValue function. Specifically, CSS.RegEx.valueSplit converts
#ff0000 -2px 0px 0px 0px, #00ff00 2px 0px 0px 0px
into the wrong pieces. The code just needs to apply the same action to every item in the list. I've created the following replacement function which works for our needs, feel free to use it as you will. If you want I can tidy it up into a PR, but your documentation says not to :-). Also the fact that line endings are ^M instead of \n make it much more difficult to work in the codebase and lastly it would be great if you could hook up package.json such thatnpm test
works. Thanks!P.S. the regex is needed to capture the case of rgb(0,0,0) 0px 0px 0px, . It is just looking for a comma outside of parens(). I am not sure if there is any other valid CSS that can have commas in them, but they would also need to be detected with the regex.
The text was updated successfully, but these errors were encountered: