Skip to content

Commit 7edf561

Browse files
ADjenkovsis0k0
authored andcommitted
Revert "Css gradients" (NativeScript#5772)
This reverts commit 5a83a1c.
1 parent 5a83a1c commit 7edf561

19 files changed

Lines changed: 24 additions & 397 deletions

apps/app/ui-tests-app/button/border-playground.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ export function onToggle(args: EventData) {
3434
target.backgroundImage = target.backgroundImage ? undefined : `~/ui-tests-app/resources/images/test2.png`;
3535
debugConsole.text += `> background-image: ${target.backgroundImage}\n`;
3636
}
37-
else if (button.text === "BGGradient") {
38-
const gradient = "linear-gradient(to right, purple, red)";
39-
target.backgroundImage = typeof target.backgroundImage === "object" ? undefined : gradient;
40-
debugConsole.text += `> background-image: ${gradient} \n`;
41-
}
4237

4338
scrollView.scrollToVerticalOffset(scrollView.scrollableHeight, true);
4439
}

apps/app/ui-tests-app/button/border-playground.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<StackLayout id="target" row="1" col="1">
1818
<Button text="BGColor" tap="onToggle"/>
1919
<Button text="BGImage" tap="onToggle"/>
20-
<Button text="BGGradient" tap="onToggle"/>
2120
</StackLayout>
2221
<StackLayout id="right" class="button-container" row="1" col="2">
2322
<Button text="Color" id="borderRightColor" tap="onToggle"/>

apps/app/ui-tests-app/css/background-image-linear-gradient.ts

Lines changed: 0 additions & 41 deletions
This file was deleted.

apps/app/ui-tests-app/css/background-image-linear-gradient.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

apps/app/ui-tests-app/css/background-shorthand.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ const tests = [
99
{ name: "black hex color only", background: "#000000" },
1010
{ name: "yellow hex color only", background: "#ffff00" },
1111
{ name: "blue color only", background: "blue" },
12-
1312
{ name: "repeat image only", background: "url(\"~/ui-tests-app/resources/images/icon.png\")" },
14-
{ name: "linear gradient red-blue only", background: "linear-gradient(to bottom, red, blue)"},
1513

1614
{ name: "[straight] image only, no-repeat ", background: "url(\"~/ui-tests-app/resources/images/icon.png\") no-repeat" },
1715
{ name: "[straight] green color, image, no-repeat", background: "green url(\"~/ui-tests-app/resources/images/icon.png\") no-repeat" },
@@ -20,7 +18,7 @@ const tests = [
2018
{ name: "[straight] orange hex color, image, no-repeat, position percents", background: "#F9791F url(\"~/ui-tests-app/resources/images/icon.png\") no-repeat 100% 100%" },
2119
{ name: "[straight] green color, image, repeat-x, position percents", background: "green url(\"~/ui-tests-app/resources/images/icon.png\") repeat-x 100% 100%" },
2220
{ name: "[straight] blue color, image, repeat-x, position", background: "blue url(\"~/ui-tests-app/resources/images/icon.png\") repeat-x 150 150" },
23-
21+
2422
{ name: "[shuffle] no-repeat, image only", background: "no-repeat url(\"~/ui-tests-app/resources/images/icon.png\")" },
2523
{ name: "[shuffle] no-repeat, green color, image, ", background: "no-repeat green url(\"~/ui-tests-app/resources/images/icon.png\")" },
2624
{ name: "[shuffle] yellow hex color, position pixels, image, no-repeat", background: "#ffff00 200px 200px url(\"~/ui-tests-app/resources/images/icon.png\") no-repeat" },

apps/app/ui-tests-app/css/gradient-border.css

Lines changed: 0 additions & 77 deletions
This file was deleted.

apps/app/ui-tests-app/css/gradient-border.xml

Lines changed: 0 additions & 22 deletions
This file was deleted.

apps/app/ui-tests-app/css/main-page.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export function loadExamples() {
3030
examples.set("label-border", "css/label-border");
3131
examples.set("text-view-border", "css/text-view-border");
3232
examples.set("image-border", "css/image-border");
33-
examples.set("gradient-border", "css/gradient-border");
3433
examples.set("layouts-border-overlap", "css/layouts-border-overlap");
3534
examples.set("measure-tests", "css/measure-tests");
3635
examples.set("all-uniform-border", "css/all-uniform-border");
@@ -42,6 +41,5 @@ export function loadExamples() {
4241
examples.set("non-uniform-radius", "css/non-uniform-radius");
4342
examples.set("missing-background-image", "css/missing-background-image");
4443
examples.set("background-shorthand", "css/background-shorthand");
45-
examples.set("background-image-linear-gradient", "css/background-image-linear-gradient");
4644
return examples;
4745
}

tns-core-modules/ui/core/view/view-common.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ import {
2121

2222
import { createViewFromEntry } from "../../builder";
2323
import { StyleScope } from "../../styling/style-scope";
24-
import { LinearGradient } from "../../styling/linear-gradient";
2524

2625
export * from "../../styling/style-properties";
2726
export * from "../view-base";
28-
export { LinearGradient };
2927

3028
import * as am from "../../animation";
3129
let animationModule: typeof am;
@@ -437,10 +435,10 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
437435
this.style.backgroundColor = value;
438436
}
439437

440-
get backgroundImage(): string | LinearGradient {
438+
get backgroundImage(): string {
441439
return this.style.backgroundImage;
442440
}
443-
set backgroundImage(value: string | LinearGradient) {
441+
set backgroundImage(value: string) {
444442
this.style.backgroundImage = value;
445443
}
446444

tns-core-modules/ui/core/view/view.d.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ import { ViewBase, Property, EventData, Color } from "../view-base";
77
import { Animation, AnimationDefinition, AnimationPromise } from "../../animation";
88
import { HorizontalAlignment, VerticalAlignment, Visibility, Length, PercentLength } from "../../styling/style-properties";
99
import { GestureTypes, GestureEventData, GesturesObserver } from "../../gestures";
10-
import { LinearGradient } from "../../styling/linear-gradient";
1110

1211
export * from "../view-base";
1312
export * from "../../styling/style-properties";
14-
export { LinearGradient };
1513

1614
export function PseudoClassHandler(...pseudoClasses: string[]): MethodDecorator;
1715

@@ -221,7 +219,7 @@ export abstract class View extends ViewBase {
221219
/**
222220
* Gets or sets the background image of the view.
223221
*/
224-
backgroundImage: string | LinearGradient;
222+
backgroundImage: string;
225223

226224
/**
227225
* Gets or sets the minimum width the view may grow to.

0 commit comments

Comments
 (0)