mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 08:52:34 +00:00
Theming API: Add unstyled
check to decide whether theme can be loaded or not
This commit is contained in:
parent
5700f617cd
commit
feaa8dd8a9
2 changed files with 8 additions and 0 deletions
|
@ -33,6 +33,9 @@ export default {
|
|||
if (!newValue) {
|
||||
BaseComponentStyle.loadStyle(this.$styleOptions);
|
||||
this.$options.style && this.$style.loadStyle(this.$styleOptions);
|
||||
} else {
|
||||
// load theme
|
||||
this._loadThemeStyles();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -108,6 +111,8 @@ export default {
|
|||
ObjectUtils.isNotEmpty(globalCSS) && BaseStyle.loadStyle(globalCSS, { name: 'global', ...this.$styleOptions });
|
||||
},
|
||||
_loadThemeStyles() {
|
||||
if (this.isUnstyled) return;
|
||||
|
||||
// common
|
||||
if (!Theme.isStyleNameLoaded('common')) {
|
||||
const { primitive, semantic, global } = this.$style?.getCommonThemeCSS?.() || {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue