nativescript-theme-core
Advanced tools
Comparing version 2.0.9 to 2.0.10
@@ -0,1 +1,15 @@ | ||
<a name="2.0.10 beta"></a> | ||
## [2.0.10 beta](https://github.com/NativeScript/theme/compare/v2.0.9...v2.0.10) (2019-09-01) | ||
### Features | ||
* Revise the Button styling, now all buttons have elevation in Android | ||
### Fixes | ||
* Fix the missing root view crash | ||
* Only load root class modifier if no support in core modules | ||
* Fix the jumping iOS Switch | ||
* Fix the Switch styling | ||
<a name="2.0.9 beta"></a> | ||
@@ -2,0 +16,0 @@ ## [2.0.9 beta](https://github.com/NativeScript/theme/compare/v2.0.8...v2.0.9) (2019-08-29) |
13
index.js
@@ -69,2 +69,3 @@ import * as app from "tns-core-modules/application"; | ||
/* Deprecated root class setters, now available in core modules */ | ||
function updateRootClasses(orientation, root = app.getRootView(), classes = []) { | ||
@@ -110,7 +111,13 @@ const classList = new ClassList(root.className); | ||
// Get notified when a modal is created. | ||
viewCommon._rootModalViews = new Proxy(viewCommon._rootModalViews, rootModalTrap); | ||
app.on(app.displayedEvent, () => { | ||
const root = app.getRootView(); | ||
// Bail out if no root view or root classes already set (pre 6.1). | ||
if (!root || root.cssClasses.has("ns-root")) { | ||
return; | ||
} | ||
// Get notified when a modal is created. | ||
viewCommon._rootModalViews = new Proxy(viewCommon._rootModalViews, rootModalTrap); | ||
const classList = new ClassList(root.className); | ||
@@ -117,0 +124,0 @@ |
{ | ||
"name": "nativescript-theme-core", | ||
"version": "2.0.9", | ||
"version": "2.0.10", | ||
"description": "Telerik NativeScript Core Theme", | ||
@@ -14,6 +14,6 @@ "author": "Telerik <support@telerik.com>", | ||
"platforms": { | ||
"android": "next", | ||
"ios": "next" | ||
"android": "6.1.0-rc-2019-08-30-013300-03", | ||
"ios": "6.1.0-rc-2019-08-29-230431-02" | ||
} | ||
} | ||
} |
@@ -60,6 +60,6 @@ # NativeScript Theme: Core V2 | ||
## Changing Core Theme | ||
## Setting Dark or Light mode | ||
Changing the core theme from light to dark is now easier - instead of loading a new file, just get the root view and | ||
set the `.ns-dark` class to it - this will change all colorization to dark tones. For instance, if your page root is | ||
Setting the theme mode from light to dark is now easier - instead of loading a new file, just find the root view and | ||
set `.ns-dark` class to it - this will change all colorization to dark tones. For instance, if your page root is | ||
RadSideDrawer, just add a class to it, like this: | ||
@@ -79,15 +79,16 @@ | ||
You can also do it from JavaScript like this, for instance: | ||
For **Angular**, if your root is a `page-router-outlet`, you can set the .ns-dark class on it - it will pass it down to the | ||
Frame it renders. | ||
## Setting Dark or Light mode from JavaScript | ||
Setting the theme mode from JavaScript is also much easier now - just import the theme and call Theme.setMode() with | ||
your preferred mode - either Theme.Light or Theme.dark, like this: | ||
```javascript | ||
import { getRootView } from "tns-core-modules/application"; | ||
import Theme from "nativescript-theme-core"; | ||
getRootView().className += " ns-dark"; | ||
Theme.setMode(Theme.Dark); // Or Theme.Light | ||
``` | ||
This of course won't remove your previously added classes. Also make sure the root view is already initialized by then. | ||
For **Angular**, if your root is a `page-router-outlet`, you can set the .ns-dark class on it - it will pass it down to the | ||
Frame it renders. | ||
## More Root Classes | ||
@@ -94,0 +95,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
470132
217
274