Open Closed

How to create my own theme? #3974


User avatar
0
PedroCadevilla created

I want to add a PersonalTheme to the selection of themes (dark - ligth - personal) and be able to use it from there

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

3 Answer(s)
  • User Avatar
    0
    muhammedaltug created

    Hello,

    What is your version and what is your UI type?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    PedroCadevilla created

    Angular and the version is 6.0

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    muhammedaltug created

    Hello,

    You can implement with following steps

    • Create a provider for changing Lepton-x theme style defaults

      import { LPX_THEMES, LpxTheme, LPX_THEME_STYLES_DEFAULTS } from '@volosoft/ngx-lepton-x';
      
      export const MY_THEME_PROVIDER: Provider = {
        provide: LPX_THEMES,
        useFactory: () => {
          const defaults = LPX_THEME_STYLES_DEFAULTS;
          const myTheme = new LpxTheme({
            icon: 'bi bi-sun',
            label: 'My Theme',
            bundles: [
              {
                bundleName: 'my-theme',
              },
              {
                bundleName: 'bootstrap-my-theme',
              },
            ],
            styleName: 'myTheme',
          });
          return [...defaults, myTheme];
        },
      };
      
    • Add this provider to AppModule's providers array

      import { MY_THEME_PROVIDER } from './my-theme-provider'
      @NgModule({
        declarations: [AppComponent],
        imports: [
            // imports
        ],
        providers: [
          MY_THEME_PROVIDER,
        ],
        bootstrap: [AppComponent],
      })
      export class AppModule {}
      
    • Add your bundles to projects.YourProject.architect.build.options.styles key which is in angular.json

      {
          "input": "src/my-theme.scss",
          "inject": false,
          "bundleName": "my-theme"
      },
      {
          "input": "src/bootstrap-my-theme.scss",
          "inject": false,
          "bundleName": "bootstrap-my-theme"
      },
      
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 24, 2026, 12:09
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.