Skip to content

Commit

Permalink
chore(demo): update getting started
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Sep 4, 2024
1 parent 3a66401 commit 164f030
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 85 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
```ts
import {Component} from '@angular/core';
import {TuiRoot} from '@taiga-ui/core';
// ..

@Component({
standalone: true,
Expand All @@ -10,7 +10,6 @@ import {TuiRoot} from '@taiga-ui/core';
// ...
],
templateUrl: './app.component.html',
styleUrls: ['./my.component.scss', './my.component.less'],
})
export class App {}
```
7 changes: 0 additions & 7 deletions projects/demo/src/modules/app/home/examples/styles.less.md

This file was deleted.

13 changes: 0 additions & 13 deletions projects/demo/src/modules/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ export class Home {
'./examples/project-json-styles.md?raw'
);

protected readonly angularJsonGlobalSingleStyles = import(
'./examples/angular-json-global-single-styles.md?raw'
);

protected readonly stylesLess = import('./examples/styles.less.md?raw');
protected readonly appTemplate = import('./examples/app-template.md?raw');
protected readonly assets = import('./examples/assets.md?raw');
protected readonly nxAssets = import('./examples/nx-assets.md?raw');
Expand All @@ -38,12 +33,4 @@ export class Home {
protected readonly nxMigrate = import('./examples/nx-migrate.md?raw');
protected readonly standalone = import('./examples/app-standalone.md?raw');
protected readonly standaloneMain = import('./examples/main-standalone.md?raw');

protected readonly customGlobalStyle = import(
'../../../../../styles/taiga-ui-global.less?raw'
).then(({default: content}) => ({
default: content
.replaceAll("@import '", "@import '@taiga-ui/styles/")
.replace('@taiga-ui/styles/@taiga-ui/core', '@taiga-ui/core'),
}));
}
74 changes: 26 additions & 48 deletions projects/demo/src/modules/app/home/home.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ <h2 class="tui-space_top-10">Manual</h2>
Root component
</a>
</li>
<li>
<a
fragment="ng-event-plugins"
routerLink="."
tuiLink
>
NG_EVENT_PLUGINS
</a>
</li>
<li>
<a
fragment="icons"
Expand Down Expand Up @@ -145,43 +154,6 @@ <h2 class="tui-space_top-10">Manual</h2>
</tui-tabs-with-more>
<ng-container *ngIf="styles.activeItemIndex === 0">
<tui-doc-code [code]="angularJsonStyles" />

<tui-accordion class="tui-space_top-3">
<tui-accordion-item>
How setup global styles from
<code>&#64;taiga-ui/styles</code>
?

<ng-template tuiAccordionItemContent>
If you want use global styles with default fonts out-of-the-box, you need install
<code>npm i &#64;taiga-ui/styles</code>
and put this code:

<tui-doc-code
filename="angular.json"
[code]="angularJsonGlobalSingleStyles"
/>

<tui-doc-code
filename="styles.less"
[code]="stylesLess"
/>

<tui-notification class="tui-space_top-3">
<div>
Also you can use not all styles from global, but only the ones you need, for example
<code>&#64;taiga-ui/styles/markup/tui-mobile-only</code>
or something else from the list below:
</div>
</tui-notification>

<tui-doc-code
filename="styles.less"
[code]="customGlobalStyle"
/>
</ng-template>
</tui-accordion-item>
</tui-accordion>
</ng-container>
<tui-doc-code
*ngIf="styles.activeItemIndex === 1"
Expand Down Expand Up @@ -213,12 +185,6 @@ <h2 class="tui-space_top-10">Manual</h2>
>
<tui-doc-tab src="assets/icons/ts.svg">app.component.ts</tui-doc-tab>
</button>
<button
*tuiItem
tuiTab
>
<tui-doc-tab src="assets/icons/ts.svg">main.ts</tui-doc-tab>
</button>
<button
*tuiItem
tuiTab
Expand All @@ -232,18 +198,30 @@ <h2 class="tui-space_top-10">Manual</h2>
/>
<tui-doc-code
*ngIf="ngStandalone.activeItemIndex === 1"
[code]="standaloneMain"
/>
<tui-doc-code
*ngIf="ngStandalone.activeItemIndex === 2"
[code]="appTemplate"
/>

<h2
id="ng-event-plugins"
class="tui-space_top-10"
>
4. NG_EVENT_PLUGINS
</h2>
<tui-tabs-with-more class="tabs">
<button
*tuiItem
tuiTab
>
<tui-doc-tab src="assets/icons/ts.svg">main.ts</tui-doc-tab>
</button>
</tui-tabs-with-more>
<tui-doc-code [code]="standaloneMain" />

<h2
id="icons"
class="tui-space_top-10"
>
4. Icons
5. Icons
</h2>

<tui-tabs-with-more
Expand Down

0 comments on commit 164f030

Please sign in to comment.