Use updatePrimary and updateSurface actions in AppConfig

pull/5507/head
mertsincan 2024-03-27 13:15:11 +00:00
parent b532a016f9
commit a9f08884c0
1 changed files with 6 additions and 3 deletions

View File

@ -38,7 +38,7 @@
</template>
<script>
import { palette, $dt, updatePreset, updateTheme } from 'primevue/themes';
import { updatePrimary, updateSurface } from 'primevue/themes';
export default {
data() {
@ -101,7 +101,10 @@ export default {
document.startViewTransition(() => this.applyTheme(type, color));
},
applyTheme(type, color) {
updatePreset({
if (type === 'primary') updatePrimary(color.palette);
else if (type === 'surface') updateSurface(color.palette);
/*updatePreset({
semantic:
type === 'surface'
? {
@ -112,7 +115,7 @@ export default {
}
}
: { [type]: color.palette }
});
});*/
/*for (const shade in color.palette) {
document.documentElement.style.setProperty(`--p-${type}-${shade}`, `${color.palette[shade]}`);