WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 74336a3

Browse files
Merge pull request #8 from angularcafe/dev
docs(menu): Update menu & sidebar style
2 parents c302a5c + 950c38e commit 74336a3

File tree

3 files changed

+35
-15
lines changed

3 files changed

+35
-15
lines changed

projects/docs/src/app/shared/components/header/header.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22
<nav class="flex h-full items-center justify-between px-6 lg:pl-6 lg:pr-6 xl:pr-6">
33
<!-- Left side - aligned with sidebar -->
44
<div class="flex items-center gap-4">
5-
<button class="lg:hidden" uiButton variant="ghost" size="icon" (click)="toggle()">
6-
<ng-icon name="tablerMenu" size="18px" />
7-
</button>
8-
<a routerLink="/" class="hidden lg:block">
9-
<img class="hidden h-9 w-auto md:block dark:hidden" src="assets/slateui-logo.svg" alt="Slate UI" />
10-
<img class="hidden h-9 w-auto dark:md:block" src="assets/slateui-logo-dark.svg" alt="Slate UI" />
5+
<a routerLink="/">
6+
<img class="h-8 md:h-9 w-auto dark:hidden" src="assets/slateui-logo.svg" alt="Slate UI" />
7+
<img class="hidden h-8 md:h-9 w-auto dark:block" src="assets/slateui-logo-dark.svg" alt="Slate UI" />
118
</a>
129
</div>
1310

1411
<!-- Right side - aligned with quick links -->
15-
<div class="flex gap-x-1 sm:gap-x-2">
12+
<div class="hidden md:flex gap-x-1 sm:gap-x-2">
1613
<a uiButton variant="ghost" size="icon" target="_blank"
1714
href="https://github.com/angularcafe/slateui">
1815
<ng-icon name="bootstrapGithub" size="18px" />
@@ -24,5 +21,10 @@
2421
<ng-icon name="tablerBlur" size="18px" />
2522
</button>
2623
</div>
24+
<div class="md:hidden">
25+
<button class="lg:hidden" uiButton variant="ghost" size="icon" (click)="toggle()">
26+
<ng-icon name="tablerMenu" size="24px" />
27+
</button>
28+
</div>
2729
</nav>
2830
</header>

projects/docs/src/app/shared/components/sidebar/sidebar.html

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22
<div class="fixed inset-0 z-50 bg-black/50 lg:hidden" (click)="menuOpen.set(false)">
33
<div class="h-full overflow-y-auto w-72 bg-background border-r border-border px-6 py-6" (click)="$event.stopPropagation()">
44
<div class="flex items-center justify-between mb-6">
5-
<a routerLink="/">
6-
<img class="h-9 w-auto lg:hidden dark:hidden" src="assets/slateui-logo.svg" alt="Slate UI" />
7-
<img class="hidden h-9 w-auto lg:hidden dark:block" src="assets/slateui-logo-dark.svg" alt="Slate UI" />
8-
</a>
9-
<button uiButton variant="ghost" size="icon" (click)="menuOpen.set(false)">
10-
<ng-icon name="lucideX" class="h-4 w-4" />
5+
<div class="flex gap-x-1 sm:gap-x-2">
6+
<a uiButton variant="ghost" size="icon" target="_blank"
7+
href="https://github.com/angularcafe/slateui">
8+
<ng-icon name="bootstrapGithub" size="18px" />
9+
</a>
10+
<a uiButton variant="ghost" size="icon" target="_blank" href="https://x.com/immohammadjaved">
11+
<ng-icon name="bootstrapTwitterX" size="18px" />
12+
</a>
13+
<button uiButton variant="ghost" size="icon" (click)="toggleTheme()">
14+
<ng-icon name="tablerBlur" size="18px" />
15+
</button>
16+
</div>
17+
<button uiButton variant="outline" size="icon" (click)="menuOpen.set(false)">
18+
<ng-icon name="lucideX" size="18px" />
1119
</button>
1220
</div>
1321
<ng-container [ngTemplateOutlet]="content" />

projects/docs/src/app/shared/components/sidebar/sidebar.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import { NgTemplateOutlet } from '@angular/common';
2-
import { Component, model, signal } from '@angular/core';
2+
import { Component, inject, model, signal } from '@angular/core';
33
import { RouterLink, RouterLinkActive } from '@angular/router';
4+
import { bootstrapGithub, bootstrapTwitterX } from '@ng-icons/bootstrap-icons';
45
import { NgIcon, provideIcons } from '@ng-icons/core';
56
import { lucideX } from '@ng-icons/lucide';
7+
import { tablerBlur } from '@ng-icons/tabler-icons';
8+
import { ThemeService } from '@slateui/theme';
69
import { UiButton } from 'ui';
710

811
interface NavLink {
@@ -21,10 +24,11 @@ interface NavSection {
2124
selector: 'docs-sidebar',
2225
standalone: true,
2326
imports: [RouterLink, NgIcon, NgTemplateOutlet, RouterLinkActive, UiButton],
24-
viewProviders: [provideIcons({ lucideX })],
27+
viewProviders: [provideIcons({ lucideX, bootstrapGithub, bootstrapTwitterX, tablerBlur })],
2528
templateUrl: './sidebar.html'
2629
})
2730
export class Sidebar {
31+
themeService = inject(ThemeService);
2832
// Two-way binding model signal for menu state
2933
readonly menuOpen = model(false);
3034

@@ -85,4 +89,10 @@ export class Sidebar {
8589
closeMenu(): void {
8690
this.menuOpen.set(false);
8791
}
92+
93+
toggleTheme() {
94+
this.themeService.setTheme(
95+
this.themeService.isDark() ? 'light' : 'dark'
96+
);
97+
}
8898
}

0 commit comments

Comments
 (0)