primevue-mirror/apps/showcase/doc/theming/styled/utils/UpdatePresetDoc.vue

41 lines
1018 B
Vue
Raw Normal View History

2024-03-30 23:15:56 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>Merges the provided tokens to the current preset, an example would be changing the primary color palette dynamically.</p>
</DocSectionText>
<DocSectionCode :code="code" hideToggleCode importCode hideStackBlitz />
</template>
<script>
export default {
data() {
return {
code: {
basic: `
2024-06-11 12:21:12 +00:00
import { updatePreset } from '@primevue/themes';
2024-03-30 23:15:56 +00:00
const changePrimaryColor() {
updatePreset({
semantic: {
primary: {
50: '{indigo.50}',
100: '{indigo.100}',
200: '{indigo.200}',
300: '{indigo.300}',
400: '{indigo.400}',
500: '{indigo.500}',
600: '{indigo.600}',
700: '{indigo.700}',
800: '{indigo.800}',
900: '{indigo.900}',
950: '{indigo.950}'
}
}
})
}
`
}
};
}
};
</script>