File tree Expand file tree Collapse file tree 3 files changed +34
-2
lines changed Expand file tree Collapse file tree 3 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import { provideStore } from '@ngxs/store';
33
44import { TranslateModule } from '@ngx-translate/core' ;
55
6- import Aura from '@primeng/themes/aura' ;
76import { ConfirmationService , MessageService } from 'primeng/api' ;
87import { providePrimeNG } from 'primeng/config' ;
98
@@ -16,6 +15,7 @@ import { STATES } from '@core/constants';
1615import { provideTranslation } from '@core/helpers' ;
1716
1817import { GlobalErrorHandler } from './core/handlers' ;
18+ import CustomPreset from './core/helpers/custom-preset' ;
1919import { authInterceptor , errorInterceptor } from './core/interceptors' ;
2020import { routes } from './app.routes' ;
2121
@@ -26,7 +26,7 @@ export const appConfig: ApplicationConfig = {
2626 provideStore ( STATES , withNgxsReduxDevtoolsPlugin ( { disabled : false } ) ) ,
2727 providePrimeNG ( {
2828 theme : {
29- preset : Aura ,
29+ preset : CustomPreset ,
3030 options : {
3131 darkModeSelector : false ,
3232 cssLayer : {
Original file line number Diff line number Diff line change 1+ import { definePreset , palette } from '@primeng/themes' ;
2+ import Aura from '@primeng/themes/aura' ;
3+
4+ const primaryPalette = palette ( getCssVariableValue ( '--pr-blue-1' ) ) ;
5+ const secondaryPalette = palette ( getCssVariableValue ( '--bg-blue-3' ) ) ;
6+ const successPalette = palette ( getCssVariableValue ( '--green-1' ) ) ;
7+ const dangerPalette = palette ( getCssVariableValue ( '--red-1' ) ) ;
8+ const infoPalette = palette ( getCssVariableValue ( '--blue-1' ) ) ;
9+
10+ const CustomPreset = definePreset ( Aura , {
11+ semantic : {
12+ primary : primaryPalette ,
13+ surface : secondaryPalette ,
14+ red : dangerPalette ,
15+ green : successPalette ,
16+ sky : infoPalette ,
17+ colorScheme : {
18+ light : {
19+ primary : {
20+ hoverColor : getCssVariableValue ( '--pr-blue-3' ) ,
21+ } ,
22+ } ,
23+ } ,
24+ } ,
25+ } ) ;
26+
27+ function getCssVariableValue ( variableName : string ) : string {
28+ return getComputedStyle ( document . documentElement ) . getPropertyValue ( variableName ) . trim ( ) ;
29+ }
30+
31+ export default CustomPreset ;
Original file line number Diff line number Diff line change 1+ export * from './custom-preset' ;
12export * from './http.helper' ;
23export * from './i18n.helper' ;
34export * from './link-validator.helper' ;
You can’t perform that action at this time.
0 commit comments