mirror of
https://github.com/ArthurDanjou/website.git
synced 2026-01-28 10:50:34 +01:00
Remove useless safelist classes
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { Post } from '~~/types'
|
import type { Post } from '~~/types'
|
||||||
|
|
||||||
|
const appConfig = useAppConfig()
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const { data: postContent } = await useAsyncData<Post>(`writing:${route.params.slug}`, async () => await queryContent<Post>(`/writing/${route.params.slug}`).findOne())
|
const { data: postContent } = await useAsyncData<Post>(`writing:${route.params.slug}`, () => queryContent<Post>(`/writing/${route.params.slug}`).findOne())
|
||||||
|
|
||||||
if (!postContent.value) {
|
if (!postContent.value) {
|
||||||
throw showError({
|
throw showError({
|
||||||
@@ -85,7 +87,8 @@ async function handleLike() {
|
|||||||
</div>
|
</div>
|
||||||
<ClientOnly>
|
<ClientOnly>
|
||||||
<ContentRenderer
|
<ContentRenderer
|
||||||
class="mt-12"
|
class="mt-12 prose dark:prose-invert max-w-none"
|
||||||
|
:class="`prose-${appConfig.ui.primary}`"
|
||||||
:value="postContent"
|
:value="postContent"
|
||||||
/>
|
/>
|
||||||
<template #fallback>
|
<template #fallback>
|
||||||
@@ -98,6 +101,7 @@ async function handleLike() {
|
|||||||
</template>
|
</template>
|
||||||
</ClientOnly>
|
</ClientOnly>
|
||||||
<footer class="my-8 space-y-8">
|
<footer class="my-8 space-y-8">
|
||||||
|
<UDivider />
|
||||||
<p class="text-subtitle">
|
<p class="text-subtitle">
|
||||||
Thanks for reading this post! If you liked it, please consider sharing it with your friends. <strong>Don't forget to leave a like!</strong>
|
Thanks for reading this post! If you liked it, please consider sharing it with your friends. <strong>Don't forget to leave a like!</strong>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -1,23 +1,15 @@
|
|||||||
import type { Config } from 'tailwindcss'
|
import type { Config } from 'tailwindcss'
|
||||||
|
import typography from '@tailwindcss/typography'
|
||||||
import { ColorsTheme } from './types'
|
import { ColorsTheme } from './types'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
content: [
|
||||||
|
'content/**/*.md',
|
||||||
|
],
|
||||||
safelist: [
|
safelist: [
|
||||||
// Theme text colors
|
...Object.values(ColorsTheme).map(color => `prose-${color}`),
|
||||||
...Object.values(ColorsTheme).map(color => `text-${color}-500`),
|
],
|
||||||
...Object.values(ColorsTheme).map(color => `!text-${color}-500`),
|
plugins: [
|
||||||
...Object.values(ColorsTheme).map(color => `hover:text-${color}-500`),
|
typography(),
|
||||||
...Object.values(ColorsTheme).map(color => `group-hover:text-${color}-500`),
|
|
||||||
...'bg-black dark:bg-white dark:text-black text-white'.split(' '),
|
|
||||||
|
|
||||||
// Theme background colors
|
|
||||||
...Object.values(ColorsTheme).map(color => `bg-${color}-500`),
|
|
||||||
...Object.values(ColorsTheme).map(color => `hover:bg-${color}-500`),
|
|
||||||
...'text-black dark:text-white'.split(' '),
|
|
||||||
|
|
||||||
// Theme border colors
|
|
||||||
...Object.values(ColorsTheme).map(color => `border-${color}-500`),
|
|
||||||
...Object.values(ColorsTheme).map(color => `hover:border-${color}-500`),
|
|
||||||
...'border-black dark:border-white'.split(' '),
|
|
||||||
],
|
],
|
||||||
} satisfies Partial<Config>
|
} satisfies Partial<Config>
|
||||||
|
|||||||
Reference in New Issue
Block a user