Skip to content

Commit

Permalink
Merge pull request #3170 from NativeScript/nnikolov/SetFunctionsForCs…
Browse files Browse the repository at this point in the history
…sFileAndResources

Export set function for cssFile and resources.
  • Loading branch information
Nedyalko Nikolov authored Nov 28, 2016
2 parents b650bbb + 0b7ea27 commit 4012dab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tns-core-modules/application/application-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export var mainEntry: frame.NavigationEntry;

export var cssFile: string = "app.css"

export function setCssFileName(cssFileName: string) {
cssFile = cssFileName;
}

export var appSelectors: RuleSet[] = [];
export var additionalSelectors: RuleSet[] = [];
export var cssSelectors: RuleSet[] = [];
Expand All @@ -42,6 +46,10 @@ export var keyframes: any = {};

export var resources: any = {};

export function setResources(res: any) {
resources = res;
}

export var onUncaughtError: (error: definition.NativeScriptError) => void = undefined;

export var onLaunch: (context: any) => any = undefined;
Expand Down
10 changes: 10 additions & 0 deletions tns-core-modules/application/application.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,22 @@ declare module "application" {
*/
export var resources: any;

/**
* Sets application level static resources.
*/
export function setResources(resources: any);

/**
* The application level css file name (starting from the application root). Used to set css across all pages.
* Css will be applied for every page and page css will be applied after.
*/
export var cssFile: string;

/**
* Sets css file name for the application.
*/
export function setCssFileName(cssFile: string);

//@private
export var appSelectors: RuleSet[];
export var additionalSelectors: RuleSet[];
Expand Down

0 comments on commit 4012dab

Please sign in to comment.