Update TW docs

pull/4243/head
Cagatay Civici 2023-08-06 17:52:53 +03:00
parent c023a2cc6e
commit c2ee6817cd
4 changed files with 97 additions and 3534 deletions

View File

@ -0,0 +1,86 @@
<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
<NuxtLink to="/tailwind">Tailwind Customization</NuxtLink> section for an example.
</p>
<DocSectionCode :code="code1" hideToggleCode importCode hideCodeSandbox hideStackBlitz />
<p>A playground sample with the pre-built Tailwind theme.</p>
<DocSectionCode :code="code2" embedded />
</DocSectionText>
</template>
<script>
export default {
data() {
return {
code1: {
basic: `
export const TRANSITIONS = {
toggleable: {
enterFromClass: 'max-h-0',
enterActiveClass: 'overflow-hidden transition-all duration-500 ease-in-out',
enterToClass: 'max-h-40 ',
leaveFromClass: 'max-h-40',
leaveActiveClass: 'overflow-hidden transition-all duration-500 ease-in',
leaveToClass: 'max-h-0'
},
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 {
panel: {
header: ({ props }) => ({
class: [
'flex items-center justify-between', // flex and alignments
'border border-gray-300 bg-gray-100 text-gray-700 rounded-tl-lg rounded-tr-lg', // borders and colors
'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80', // Dark mode
{ 'p-5': !props.toggleable, 'py-3 px-5': props.toggleable } // condition
]
}),
title: 'leading-none font-bold',
toggler: {
class: [
'inline-flex items-center justify-center overflow-hidden relative no-underline', // alignments
'w-8 h-8 text-gray-600 border-0 bg-transparent rounded-full transition duration-200 ease-in-out', // widths, borders, and transitions
'hover:text-gray-900 hover:border-transparent hover:bg-gray-200 dark:hover:text-white/80 dark:hover:bg-gray-800/80 dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]', // hover
'focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)]' // focus
]
},
togglerIcon: 'inline-block',
content: {
class: [
'p-5 border border-gray-300 bg-white text-gray-700 border-t-0 last:rounded-br-lg last:rounded-bl-lg',
'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80' // Dark mode
]
},
transition: TRANSITIONS.toggleable
}
}
`
},
code2: {
composition: `
<template>
<div class="card">
<Panel header="Header">
<p class="m-0">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
</Panel>
</div>
</template>
<script setup>
<\/script>`
}
};
}
};
</script>

View File

@ -10,6 +10,7 @@
<script> <script>
import StyledDoc from './StyledDoc.vue'; import StyledDoc from './StyledDoc.vue';
import TailwindDoc from './TailwindDoc.vue';
import UnstyledDoc from './UnstyledDoc.vue'; import UnstyledDoc from './UnstyledDoc.vue';
export default { export default {
@ -24,7 +25,15 @@ export default {
{ {
id: 'unstyled', id: 'unstyled',
label: 'Unstyled', label: 'Unstyled',
component: UnstyledDoc component: UnstyledDoc,
description: 'Theming is implemented with the pass through properties in unstyled mode.',
children: [
{
id: 'tailwind',
label: 'Tailwind',
component: TailwindDoc
}
]
} }
] ]
}; };

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@
<div class="doc-main"> <div class="doc-main">
<div class="doc-intro"> <div class="doc-intro">
<h1>Tailwind CSS</h1> <h1>Tailwind CSS</h1>
<p>Tailwind is a popular utility-first CSS library that fits perfectly to the unstyled mode of PrimeVue. A built-in Tailwind theme is even available to get started in no time.</p> <p>Tailwind is a popular utility-first CSS library that fits perfectly to the unstyled mode of PrimeVue. A <b>built-in Tailwind theme</b> is even available to get started in no time.</p>
</div> </div>
<DocSections :docs="docs" /> <DocSections :docs="docs" />
</div> </div>
@ -19,7 +19,6 @@
</template> </template>
<script> <script>
import ApiDoc from '@/doc/tailwind/ApiDoc';
import CustomizationDoc from '@/doc/tailwind/CustomizationDoc.vue'; import CustomizationDoc from '@/doc/tailwind/CustomizationDoc.vue';
import ExampleDoc from '@/doc/tailwind/ExampleDoc'; import ExampleDoc from '@/doc/tailwind/ExampleDoc';
import SetupDoc from '@/doc/tailwind/SetupDoc'; import SetupDoc from '@/doc/tailwind/SetupDoc';
@ -42,11 +41,6 @@ export default {
id: 'example', id: 'example',
label: 'Example', label: 'Example',
component: ExampleDoc component: ExampleDoc
},
{
id: 'api',
label: 'Theme API',
component: ApiDoc
} }
] ]
}; };