Repository navigation
Css gradients - #5534
Css gradients#5534
Conversation
… applied to style.
|
Can one of the admins verify this patch? |
2 similar comments
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
pana-cc
left a comment
There was a problem hiding this comment.
Looks great,
Just one thing, can you extend the background-image type, rather than introducing a new property. I think the CSS spec the linear-gradient radial-gradient etc. are part of the possible values for a background-image.
Otherwise looks great.
Thank you for your contribution, this was one of the things I really wanted to see implemented in {N}.
| public background: string; | ||
| public backgroundColor: Color; | ||
| public backgroundImage: string; | ||
| public backgroundGradient: string; |
There was a problem hiding this comment.
In the CSS spec the gradients (linear and radial) are set on the background image:
https://developer.mozilla.org/en-US/docs/Web/CSS/background-image
There is no background-gradient property.
| return true; | ||
| } | ||
| } | ||
| export const backgroundGradientProperty = new CssProperty<Style, LinearGradient>({ |
There was a problem hiding this comment.
Again, I think this should be extending the type of the background-image instead of introducing a new property.
There was a problem hiding this comment.
I've just committed this fix, could you give it another look?
… gradient to background-image.
pana-cc
left a comment
There was a problem hiding this comment.
Looks good! :)
I wonder if the background-image should remain string or be promoted to string | LinearGradient, but either way I am ok with it.
|
Thanks @vultix - this is an awesome feature. We are going to run our internal CI tests over this PR and do a code review in the following days so expect updates! |
| } | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
There is а tslint error caused by this line:
ERROR: tns-core-modules/ui/styling/linear-gradient.ts[61, 1]: Consecutive blank lines are forbidden
|
test |
|
test branch_functional_tests#css-gradients-tests branch_widgets#vultix/css-gradients |
1 similar comment
|
test branch_functional_tests#css-gradients-tests branch_widgets#vultix/css-gradients |
|
Hey @vultix, thank you for your contribution and especially additional tests cases included in uitests app. Android related issues:
2.UI tests agains uitest app. (background-shorthand example, background and etc) Most of the exception that we get there is "match of undefined in refreshBorderDrawable". This is the stack trace: IOS related issues:
Please let me know if you need some additional information. |
|
@SvetoslavTsenov My apologies for those problems. I have been unable to run the test app on android due to a strange error. That aside, I have found the problem causing "match of undefined in refreshBorderDrawable" and have pushed that fix in. |
|
That's ok! I will rerun tests. |
|
test branch_functional_tests#css-gradients-tests branch_widgets#vultix/css-gradients |
|
Hey @vultix, great job! All tests on our CI has passed successfully. I will try to cover few scenarios more and confirm new images that we are going to use for verification as soon as possible. |
|
test branch_functional_tests#css-gradients-tests branch_widgets#vultix/css-gradients |
chore(linear-gradient): fix equality comparer
|
@vultix could you rebase to master branch since there are some very minor changes? |
|
test branch_functional_tests#css-gradients-tests branch_widgets#vultix/css-gradients |
|
test branch_widgets#vultix/css-gradients |
|
Merging this PR, since the failures are related to the newly added UI test. |
|
Thanks for this one team! |
|
This is awesome!! I'd be happy to send you a swag package in honor of this great PR! @vultix please email me with your t-shirt size if you'd like! jen.looper @ progress.com |
|
so, how to use this ? sorry for the noob question |
|
I'm getting an error similar to what was mentioned above: #5534 (comment) "imageUri.match is not a function"I just added a line of code from the examples to a panel:
I'll open an official ticket once I search around for a solution more. |
|
@datanotion yeah i also did that |
|
For everyone looking for documentation on how to use the gradients, the link in the 4.1 release post is broken, this link works: https://docs.nativescript.org/cookbook/ui/styling#gradients |
|
css gradient not working , |
|
@vultix Wow thanks a lot for this! I was wondering how difficult would it be to have the gradients work on the action bar as well? |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |

PR Checklist
What is the current behavior?
No support for css gradients.
What is the new behavior?
Css properties background and background-gradient now support the CSS linear-gradient spec.
I.E.:
Fixes #539
Note: this PR is dependent upon PR #116 on the tns-core-modules-widgets project. The changes will be breaking on android without this PR.