I’m using PrimeVue with Tailwindcss based on tailwind.primevue. I try using the Timeline
component from Lara preset. It’s weird that its eventseperator
is missing. Any help is appreciated.
tailwind.config.js
/** @type {import('tailwindcss').Config} */
export default {
content: [
'./index.html',
'./src/**/*.{vue,js,ts,jsx,tsx}',
'./node_modules/primevue/**/*.{vue,js,ts,jsx,tsx}'
],
theme: {
extend: {
colors: {
primary: 'rgb(var(--primary))',
'primary-inverse': 'rgb(var(--primary-inverse))',
'primary-hover': 'rgb(var(--primary-hover))',
'primary-active-color': 'rgb(var(--primary-active-color))',
'primary-highlight': 'rgb(var(--primary)/var(--primary-highlight-opacity))',
'primary-highlight-inverse': 'rgb(var(--primary-highlight-inverse))',
'primary-highlight-hover': 'rgb(var(--primary)/var(--primary-highlight-hover-opacity))',
'primary-50': 'rgb(var(--primary-50))',
'primary-100': 'rgb(var(--primary-100))',
'primary-200': 'rgb(var(--primary-200))',
'primary-300': 'rgb(var(--primary-300))',
'primary-400': 'rgb(var(--primary-400))',
'primary-500': 'rgb(var(--primary-500))',
'primary-600': 'rgb(var(--primary-600))',
'primary-700': 'rgb(var(--primary-700))',
'primary-800': 'rgb(var(--primary-800))',
'primary-900': 'rgb(var(--primary-900))',
'primary-950': 'rgb(var(--primary-950))',
'surface-0': 'rgb(var(--surface-0))',
'surface-50': 'rgb(var(--surface-50))',
'surface-100': 'rgb(var(--surface-100))',
'surface-200': 'rgb(var(--surface-200))',
'surface-300': 'rgb(var(--surface-300))',
'surface-400': 'rgb(var(--surface-400))',
'surface-500': 'rgb(var(--surface-500))',
'surface-600': 'rgb(var(--surface-600))',
'surface-700': 'rgb(var(--surface-700))',
'surface-800': 'rgb(var(--surface-800))',
'surface-900': 'rgb(var(--surface-900))',
'surface-950': 'rgb(var(--surface-950))'
}
}
},
plugins: []
}
main.ts
const app = createApp(App)
app.use(PrimeVue, {
ripple: true,
unstyled: true,
pt: Lara
});
app.use(router)
app.component('Timeline', Timeline)
app.component('Galleria', Galleria)
postcss.config.js
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
main.css
@import './base.css';
@tailwind base;
@tailwind components;
@tailwind utilities;
html {
font-size: 14px;
}
// rest of styles
MyTimeline.vue
<template>
<div
ref="el"
:class="['card transition-all duration-500', isVisible ? 'opacity-100' : 'opacity-0']"
>
<Timeline :value="events" class="w-full md:w-[20rem] items-center">
<template #opposite="slotProps">
<small class="text-surface-600">{{ slotProps.item.date }}</small>
</template>
<template #content="slotProps">
{{ slotProps.item.status }}
</template>
</Timeline>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { useElementVisibility } from '@vueuse/core'
const el = ref(null)
const isVisible = useElementVisibility(el)
const events = ref([
{ status: 'Ordered', date: '15/10/2020 10:30', icon: 'pi pi-shopping-cart', color: '#9C27B0' },
{ status: 'Processing', date: '15/10/2020 14:00', icon: 'pi pi-cog', color: '#673AB7' },
{ status: 'Shipped', date: '15/10/2020 16:15', icon: 'pi pi-shopping-cart', color: '#FF9800' },
{ status: 'Delivered', date: '16/10/2020 10:00', icon: 'pi pi-check', color: '#607D8B' }
])
</script>
I’ve tried to inspect the element I see the div have no style applied though I checked the Timeline in Lara preset file the style exists. Same thing happened for Aura preset.
Web Inspect on Timeline
separator: ({ props }) => ({
class: [
'flex items-center flex-initial',
{
'flex-col': props.layout === 'vertical',
'flex-row': props.layout === 'horizontal'
}
]
}),
marker: {
class: [
'flex self-baseline',
'w-4 h-4',
'rounded-full border-2 border-primary bg-surface-0 dark:bg-surface-900/40'
]
},