Skip to content

Commit 6fb7aa3

Browse files
authored
Add font toggle to playground (#27)
1 parent 213c955 commit 6fb7aa3

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

src/app/app.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ <h2>Datatable</h2>
9494
</ul>
9595

9696
<div class="options">
97+
<ff-button (click)="toggleFont()">Font</ff-button>
9798
<ff-button (click)="toggleTheme()"
9899
><span class="yellow-dark">Dark</span> / <span class="yellow-light">Light</span></ff-button
99100
>

src/app/app.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,8 @@ ul.components-list {
3535
position: fixed;
3636
top: 20px;
3737
right: 20px;
38+
39+
ff-button {
40+
margin-left: 5px;
41+
}
3842
}

src/app/app.component.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export class AppComponent implements OnInit {
2828
{ name: 'something', displayName: 'Something', property: null, html: true },
2929
];
3030

31+
private readonly appRoot: HTMLElement = document.querySelector('app-root')!;
32+
3133
ngOnInit(): void {
3234
this.datasource.data = [
3335
{
@@ -57,6 +59,10 @@ export class AppComponent implements OnInit {
5759
document.body.classList.toggle('ff-dark-theme');
5860
}
5961

62+
protected toggleFont(): void {
63+
this.appRoot.classList.toggle('no-font');
64+
}
65+
6066
protected changeSearchQuery(): void {
6167
this.searchText = 'Eekum Bokum';
6268
}

src/styles.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
@use '../dist/angular-components';
22

3+
app-root {
4+
font-family: 'Inter', sans-serif;
5+
6+
&.no-font {
7+
font-family: unset;
8+
}
9+
}
10+
311
.yellow-dark {
412
color: inherit;
513
}

0 commit comments

Comments
 (0)