primevue-mirror/doc/overlaypanel/theming/TailwindDoc.vue

72 lines
2.3 KiB
Vue
Raw Normal View History

2023-08-07 09:03:52 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>
PrimeVue offers a built-in Tailwind theme to get you started quickly. The default values related to the component are displayed below. The component can easily be styled with your own design based on Tailwind utilities, see the
2023-08-07 12:40:22 +00:00
<PrimeVueNuxtLink to="/tailwind">Tailwind Customization</PrimeVueNuxtLink> section for an example.
2023-08-07 09:03:52 +00:00
</p>
2023-09-22 12:54:14 +00:00
<DocSectionCode :code="code1" hideToggleCode importCode hideCodeSandbox hideStackBlitz scrollable />
2023-08-16 13:58:31 +00:00
<p class="mt-4">A playground sample with the pre-built Tailwind theme.</p>
2023-08-07 09:03:52 +00:00
<DocSectionCode :code="code2" embedded />
</DocSectionText>
</template>
<script>
export default {
data() {
return {
code1: {
2023-10-15 09:38:39 +00:00
basic: `
export const TRANSITIONS = {
2023-08-07 09:03:52 +00:00
overlay: {
enterFromClass: 'opacity-0 scale-75',
enterActiveClass: 'transition-transform transition-opacity duration-150 ease-in',
leaveActiveClass: 'transition-opacity duration-150 ease-linear',
leaveToClass: 'opacity-0'
}
};
export default {
overlaypanel: {
root: {
class: [
'bg-white text-gray-700 border-0 rounded-md shadow-lg',
'z-40 transform origin-center',
2023-10-18 06:58:43 +00:00
'absolute left-0 top-0 mt-3',
2023-08-07 09:03:52 +00:00
'before:absolute before:w-0 before:-top-3 before:h-0 before:border-transparent before:border-solid before:ml-6 before:border-x-[0.75rem] before:border-b-[0.75rem] before:border-t-0 before:border-b-white dark:before:border-b-gray-900',
'dark:border dark:border-blue-900/40 dark:bg-gray-900 dark:text-white/80'
]
},
2023-10-18 06:58:43 +00:00
content: {
class: 'p-5 items-center flex'
},
2023-08-07 09:03:52 +00:00
transition: TRANSITIONS.overlay
}
}
`
},
code2: {
2023-09-22 12:54:14 +00:00
composition: `
<template>
2023-08-07 09:03:52 +00:00
<div class="card flex justify-center">
<Button type="button" icon="pi pi-image" label="Image" @click="toggle" />
<OverlayPanel ref="op">
<img src="https://primefaces.org/cdn/primevue/images/product/bamboo-watch.jpg" alt="Bamboo Watch" />
</OverlayPanel>
</div>
</template>
<script setup>
import { ref } from "vue";
const op = ref();
const toggle = (event) => {
op.value.toggle(event);
}
2023-10-15 09:38:39 +00:00
<\/script>
`
2023-08-07 09:03:52 +00:00
}
};
}
};
</script>