mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
css-value parse fix to match the new parse function export.
This commit is contained in:
7
css-value/reworkcss-value.d.ts
vendored
7
css-value/reworkcss-value.d.ts
vendored
@ -1,10 +1,13 @@
|
|||||||
declare module "css-value" {
|
declare module "css-value" {
|
||||||
export interface CSSValue {
|
interface CSSValue {
|
||||||
type: string;
|
type: string;
|
||||||
string: string;
|
string: string;
|
||||||
unit: string;
|
unit: string;
|
||||||
value: number;
|
value: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function parse(cssValue: string): Array<CSSValue>;
|
interface ParserFunction {
|
||||||
|
(cssValue: string): Array<CSSValue>;
|
||||||
|
}
|
||||||
|
export = ParserFunction;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ import colorModule = require("color");
|
|||||||
import types = require("utils/types");
|
import types = require("utils/types");
|
||||||
import enums = require("ui/enums");
|
import enums = require("ui/enums");
|
||||||
import dts = require("ui/styling/background");
|
import dts = require("ui/styling/background");
|
||||||
import cssValue = require("css-value");
|
var cssValue = require("css-value");
|
||||||
|
|
||||||
export class Background implements dts.Background {
|
export class Background implements dts.Background {
|
||||||
public static default = new Background(undefined, undefined, undefined, undefined, undefined);
|
public static default = new Background(undefined, undefined, undefined, undefined, undefined);
|
||||||
@ -83,7 +83,7 @@ export class Background implements dts.Background {
|
|||||||
|
|
||||||
// size
|
// size
|
||||||
if (this.size) {
|
if (this.size) {
|
||||||
let values = cssValue.parse(this.size);
|
let values = cssValue(this.size);
|
||||||
|
|
||||||
if (values.length === 2) {
|
if (values.length === 2) {
|
||||||
let vx = values[0];
|
let vx = values[0];
|
||||||
@ -126,7 +126,7 @@ export class Background implements dts.Background {
|
|||||||
|
|
||||||
// position
|
// position
|
||||||
if (this.position) {
|
if (this.position) {
|
||||||
let values = cssValue.parse(this.position);
|
let values = cssValue(this.position);
|
||||||
let spaceX = width - imageWidth;
|
let spaceX = width - imageWidth;
|
||||||
let spaceY = height - imageHeight;
|
let spaceY = height - imageHeight;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user