-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Conversation
@HighwayChile This works great. Can you add 2 unit tests: 1 for |
@redmunds Yes! Perfect opportunity -- I'm just starting to look at how brackets tests are organized. |
Excellent -- let me know if you have any questions. |
@@ -162,7 +162,7 @@ define(function (require, exports, module) { | |||
|
|||
// Check for gradient. -webkit-gradient() can have parens in parameters | |||
// nested 2 levels. Other gradients can only nest 1 level. | |||
var gradientRegEx = /-webkit-gradient\((?:[^\(]*?(?:\((?:[^\(]*?(?:\([^\)]*?\))*?)*?\))*?)*?\)|(?:(?:-moz-|-ms-|-o-|-webkit-|\s)((repeating-)?linear-gradient)|(?:-moz-|-ms-|-o-|-webkit-|\s)((repeating-)?radial-gradient))(\((?:[^\)]*?(?:\([^\)]*?\))*?)*?\))/gi, | |||
var gradientRegEx = /-webkit-gradient\((?:[^\(]*?(?:\((?:[^\(]*?(?:\([^\)]*?\))*?)*?\))*?)*?\)|(?:(?:-moz-|-ms-|-o-|-webkit-|\s?)((repeating-)?linear-gradient)|(?:-moz-|-ms-|-o-|-webkit-|\s?)((repeating-)?radial-gradient))(\((?:[^\)]*?(?:\([^\)]*?\))*?)*?\))/gi, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HighwayChile After thinking about this a bit more, instead of making preceding whitespace optional, I think we should add option for a colon. This will eliminate false positives for something like xyz-linear-gradient(...)
. Will that work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@redmunds hmm, let me look at the regex more closely.
@redmunds after looking at the regex more, your suggestion is more readable and better matching. Will try to get some tests in tomorrow. Woohoo! |
@redmunds ok tests are in |
.whitespaceCheck_linear_gradient { | ||
background : linear-gradient(to bottom, black 0%, white 100%); | ||
background: linear-gradient(to bottom, black 0%, white 100%); | ||
background :linear-gradient(to bottom, black 0%, white 100%); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most common CSS whitespace style between property and value is prop: val
, and the second most popular is no whitespace at all: prop:val
so add that case (both here and for radial-gradient
).
@HighwayChile Just 2 more minor comments. |
@redmunds I used a percentage for the radial values because I got an odd result when using the px values. It looks like when the test.css is read for testing, the px value is interpreted as a percentage value -- then it fails because the test is expecting the px value.
I can look into this more if it's helpful. Otherwise, I'll stick with the percentage values. |
Look good. Thanks. Merging. |
made whitespace character optional
@redmunds Awesome, Thanks! |
Addresses #8028 - Quick View doesn't recognize linear-gradient if no space before it
Updated regex to make whitespace character optional before "linear" or "radial"