Skip to content

Commit

Permalink
Some updates to the readme
Browse files Browse the repository at this point in the history
Fixes to app-compat
  • Loading branch information
bundyo committed Aug 27, 2019
1 parent 2585771 commit 33cb8d1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Home of the core NativeScript theme 2.0 beta. The documentation of the beta them

* The theme is now **applied using Element selectors**, if you need the old classes approach - it has moved to .compat CSS/SCSS files, e.g. `core.compat.css` and `blue.compat.css`.
* Theme 2.0 beta **requires some JavaScript to be loaded** which helps with the styling.
* Theme 2.0 replaces node-sass with **dart-sass** which is more up to date feature-wise and doesn't have a native dependency.
* Theme 2.0 replaces node-sass with **sass** which is more up to date feature-wise and doesn't have a native dependency.

## Usage

Expand Down Expand Up @@ -69,6 +69,12 @@ RadSideDrawer, just add a class to it, like this:
</drawer:RadSideDrawer>
```

If your root is a frame, you can do this

```html
<Frame class="ns-dark" defaultPage="root"></Frame>
```

You can also do it from JavaScript like this, for instance:

```javascript
Expand All @@ -77,7 +83,10 @@ import { getRootView } from "tns-core-modules/application";
getRootView().className += " ns-dark";
```

This of course won't remove your previously added classes.
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

Expand Down
16 changes: 8 additions & 8 deletions app-compat/app-root/app-root.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<drawer:RadSideDrawer
class="ns-statusbar-transparent"
class="ns-statusbar-transparent side-drawer"
xmlns:drawer="nativescript-ui-sidedrawer"
xmlns:themes="pages/themes"
loaded="onLoaded">
Expand All @@ -8,16 +8,16 @@
</drawer:RadSideDrawer.drawerTransition>

<drawer:RadSideDrawer.drawerContent>
<GridLayout rows="auto, *" class="nt-drawer__content page">
<StackLayout class="nt-drawer__header">
<Image src="~/assets/images/N.png" tap="{{ viewHome }}" class="nt-drawer__header-image"/>
<Label text="NativeScript Theme Project" textWrap="true" class="nt-drawer__header-brand" />
<GridLayout rows="auto, *" class="page">
<StackLayout class="sidedrawer-header">
<Image src="~/assets/images/N.png" tap="{{ viewHome }}" class="sidedrawer-header-image"/>
<Label text="NativeScript Theme Project" textWrap="true" class="sidedrawer-header-brand" />
</StackLayout>
<ListView class="list-view" row="1" items="{{ pages }}" itemTap="{{ onNavigationItemTap }}">
<ListView.itemTemplate>
<StackLayout orientation="horizontal">
<Label text="{{ 'fa-' + icon | fonticon }}" class="fa nt-icon" />
<Label text="{{ text || value }}" />
<StackLayout class="sidedrawer-list-item" orientation="horizontal">
<Label text="{{ 'fa-' + icon | fonticon }}" class="fa sidedrawer-list-item-icon" />
<Label text="{{ text || value }}" class="sidedrawer-list-item-text" />
</StackLayout>
</ListView.itemTemplate>
</ListView>
Expand Down
2 changes: 1 addition & 1 deletion nsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"useLegacyWorkflow": false,
"appPath": "app"
"appPath": "app-compat"
}
2 changes: 1 addition & 1 deletion src/scss/mixins/components/_side--drawer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

.sidedrawer-list-item-icon {
margin: 0 16 0 16;
padding-top: 14;
padding-top: 6;
width: 24;
text-align: center;
font-size: 20;
Expand Down

0 comments on commit 33cb8d1

Please sign in to comment.