mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 23:40:14 +01:00
34 lines
871 B
TypeScript
34 lines
871 B
TypeScript
|
|
/**
|
||
|
|
* @license
|
||
|
|
* Copyright Akveo. All Rights Reserved.
|
||
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||
|
|
*/
|
||
|
|
|
||
|
|
import { Inject, Injectable } from '@angular/core';
|
||
|
|
import { DOCS } from '../../app.options';
|
||
|
|
|
||
|
|
@Injectable()
|
||
|
|
export class NgxStylesService {
|
||
|
|
|
||
|
|
constructor(@Inject(DOCS) private docs) {
|
||
|
|
}
|
||
|
|
|
||
|
|
mapThemedValues(classStyles: any): any {
|
||
|
|
return classStyles.map(item => {
|
||
|
|
item.styles.map(prop => {
|
||
|
|
prop.themedValues = [];
|
||
|
|
for (const themeName in this.docs.themes) {
|
||
|
|
if (this.docs.themes.hasOwnProperty(themeName)) {
|
||
|
|
prop.themedValues.push({
|
||
|
|
theme: this.docs.themes[themeName].name,
|
||
|
|
value: this.docs.themes[themeName].data[prop.name].value,
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return prop;
|
||
|
|
});
|
||
|
|
return item;
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|