Browse Source

Merge pull request #23759 from abpframework/issue-2886

Update Angular docs for logo configuration and theming
pull/23778/head
sumeyye 11 months ago
committed by GitHub
parent
commit
3cebdd6f60
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 17
      docs/en/framework/ui/angular/component-replacement.md
  2. 21
      docs/en/framework/ui/angular/modifying-the-menu.md
  3. 36
      docs/en/ui-themes/lepton-x-lite/angular.md

17
docs/en/framework/ui/angular/component-replacement.md

@ -213,6 +213,23 @@ function configureRoutes() {
![LogoComponent](./images/logo-component.png)
Note
- If your goal is only to change the logo image or application name, you don't need to replace the component. Prefer providing the logo via `@abp/ng.theme.shared` so all themes/components consume it consistently:
```ts
// app.config.ts
import { provideLogo, withEnvironmentOptions } from '@abp/ng.theme.shared';
import { environment } from './environments/environment';
export const appConfig: ApplicationConfig = {
providers: [
provideLogo(withEnvironmentOptions(environment)),
],
};
```
If you still want to completely replace the logo component UI, follow the steps below:
Run the following command in `angular` folder to create a new component called `LogoComponent`.
```bash

21
docs/en/framework/ui/angular/modifying-the-menu.md

@ -5,7 +5,7 @@ The menu is inside the `ApplicationLayoutComponent` in the @abp/ng.theme.basic p
## How to Add a Logo
The `logoUrl` property in the environment variables is the url of the logo.
The `logoUrl` property in the environment variables is the url of the logo.
You can add your logo to `src/assets` folder and set the `logoUrl` as shown below:
@ -20,6 +20,25 @@ export const environment = {
};
```
Then provide the logo at application startup using the Theme Shared provider. This makes the logo (and application name) available to all ABP/Theme components (including LeptonX brand component) via injection tokens.
```ts
// app.config.ts
import { provideLogo, withEnvironmentOptions } from '@abp/ng.theme.shared';
import { environment } from './environments/environment';
export const appConfig: ApplicationConfig = {
providers: [
// ... other providers
provideLogo(withEnvironmentOptions(environment)),
],
};
```
Notes
- This approach works across themes. If you are using LeptonX, the brand logo component reads these values automatically; you don't need any theme-specific code.
- You can still override visuals with CSS variables if desired. See the LeptonX section for CSS overrides.
## How to Add a Navigation Element
### Via `RoutesService`

36
docs/en/ui-themes/lepton-x-lite/angular.md

@ -60,7 +60,39 @@ export const appConfig: ApplicationConfig = {
```
To change the logos and brand color of `LeptonX`, simply add the following CSS to the `styles.scss`
To change the logos and brand color of `LeptonX`, you have two options:
1) Provide logo and application name via the Theme Shared provider (recommended)
```ts
// app.config.ts
import { provideLogo, withEnvironmentOptions } from '@abp/ng.theme.shared';
import { environment } from './environments/environment';
export const appConfig: ApplicationConfig = {
providers: [
// ...
provideLogo(withEnvironmentOptions(environment)),
],
};
```
Ensure your environment contains the logo url and app name:
```ts
// environment.ts
export const environment = {
// ...
application: {
name: 'MyProjectName',
logoUrl: '/assets/images/logo.png',
},
};
```
The LeptonX brand component reads these values automatically from `@abp/ng.theme.shared`.
2) Or override via CSS variables in `styles.scss`
```css
:root {
@ -74,6 +106,8 @@ To change the logos and brand color of `LeptonX`, simply add the following CSS t
- `--lpx-logo-icon` is a square icon used when the menu is collapsed.
- `--lpx-brand` is a color used throughout the application, especially on active elements.
Tip: You can combine both approaches. For example, provide the main logo via `provideLogo(...)` and still fine-tune visuals (sizes, colors) with CSS.
### Server Side
In order to migrate to LeptonX on your server side projects (Host and/or AuthServer projects), please follow the [Server Side Migration](asp-net-core.md) document.

Loading…
Cancel
Save