mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 20:11:24 +08:00

Needed to have a nice structured cookbook dir in the docs Includes: Move the data-module tests under the data dir Move the frame tests under the ui dir Rename the dialog.md file to dialogs.md Fix the web-view title Add previous_url attributes to each article for SEO Rename the style dir to styling to match the reference Fix the frame-tests path
61 lines
1.9 KiB
TypeScript
61 lines
1.9 KiB
TypeScript
import color = require("color");
|
|
import button = require("ui/button");
|
|
import stack = require("ui/layouts/stack-layout");
|
|
import helper = require("../helper");
|
|
|
|
export var test_value_Inherited_stronger_than_Default = function () {
|
|
let page = helper.getCurrentPage();
|
|
let btn = new button.Button();
|
|
let testStack = new stack.StackLayout();
|
|
page.content = testStack;
|
|
testStack.addChild(btn);
|
|
page.css = "stackLayout { color: red; }";
|
|
helper.assertViewColor(btn, "#FF0000");
|
|
page.css = "";
|
|
}
|
|
|
|
export var test_value_Css_stronger_than_Inherited = function () {
|
|
let page = helper.getCurrentPage();
|
|
let testStack = new stack.StackLayout();
|
|
page.content = testStack;
|
|
|
|
let btn = new button.Button();
|
|
testStack.addChild(btn);
|
|
page.css = "stackLayout { color: red; } button { color: blue; }";
|
|
|
|
helper.assertViewColor(btn, "#0000FF");
|
|
}
|
|
|
|
export var test_value_Local_stronger_than_Css = function () {
|
|
let testPage = helper.getCurrentPage();
|
|
let testStack = new stack.StackLayout();
|
|
testPage.content = testStack;
|
|
|
|
let btn = new button.Button();
|
|
testStack.addChild(btn);
|
|
testPage.css = "button { color: red; }";
|
|
|
|
helper.assertViewColor(btn, "#FF0000");
|
|
btn.style.color = new color.Color("#0000FF");
|
|
helper.assertViewColor(btn, "#0000FF");
|
|
btn.style.color = undefined;
|
|
helper.assertViewColor(btn, "#FF0000");
|
|
}
|
|
|
|
export var test_value_VisualState_stronger_than_Local = function () {
|
|
let testPage = helper.getCurrentPage();
|
|
|
|
let testStack = new stack.StackLayout();
|
|
testPage.content = testStack;
|
|
|
|
let btn = new button.Button();
|
|
btn.style.color = new color.Color("#FF0000");
|
|
testStack.addChild(btn);
|
|
testPage.css = "button:pressed { color: #0000FF; }";
|
|
|
|
helper.assertViewColor(btn, "#FF0000");
|
|
btn._goToVisualState("pressed");
|
|
helper.assertViewColor(btn, "#0000FF");
|
|
btn._goToVisualState("normal");
|
|
helper.assertViewColor(btn, "#FF0000");
|
|
} |