-
-
Notifications
You must be signed in to change notification settings - Fork 319
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
fix: handle 2 color-stop-length in linear-gradient #1215
fix: handle 2 color-stop-length in linear-gradient #1215
Conversation
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.
Please consider my review comment and run yarn fixlint
to format the code so the linting step passes.
@@ -74,7 +74,9 @@ function optimise(decl) { | |||
!isFinalStop && | |||
lastStop && | |||
lastStop.number === '0' && | |||
lastStop.unit.toLowerCase() !== 'deg' | |||
lastStop.unit.toLowerCase() !== 'deg' && |
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.
I would suggest to revert these changes and instead change line 63 to
if (arg.length !== 3) {
All of the existing processing assumes the one-stop syntax (it expects [something, space, something]
as arg
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.
Then background:linear-gradient(#ffe500 0% 0%,#121 100%)
=> background:linear-gradient(#121)
would be ignored but i think this is justified.
I change the code again today.
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.
Changed the code as you suggested now, the case i mentioned is unhandled.
f208a95
to
f2f12cc
Compare
f2f12cc
to
ff8a9eb
Compare
Codecov Report
@@ Coverage Diff @@
## master #1215 +/- ##
=======================================
Coverage 96.54% 96.54%
=======================================
Files 116 116
Lines 3614 3614
Branches 1064 1064
=======================================
Hits 3489 3489
Misses 117 117
Partials 8 8
Continue to review full report at Codecov.
|
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.
Thanks for the updates!
fixes #1205