diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index b57d4a0..f0279f7 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -1,6 +1,14 @@ import { defineConfig } from 'vitepress' import UnoCSS from 'unocss/vite' -import { presetUno, presetWind, presetTypography } from 'unocss' +import { colors } from '@fmhy/colors' +import { presetUno, presetWind } from 'unocss' + +const safelist = Object.entries(colors).flatMap(([group, shades]) => + Object.keys(shades).flatMap((shade) => [ + `text-${group}-${shade}`, + `bg-${group}-${shade}` + ]) +) export default defineConfig({ title: 'Design System', @@ -8,7 +16,12 @@ export default defineConfig({ cleanUrls: true, vite: { plugins: [ - UnoCSS({ presets: [presetUno(), presetWind(), presetTypography()] }) + // @ts-expect-error + UnoCSS({ + theme: { colors: colors }, + safelist, + presets: [presetUno(), presetWind()] + }) ] }, themeConfig: { diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts index 2146cbf..04560ee 100644 --- a/docs/.vitepress/theme/index.ts +++ b/docs/.vitepress/theme/index.ts @@ -1,7 +1,7 @@ -// https://vitepress.dev/guide/custom-theme import { h } from 'vue' import type { Theme } from 'vitepress' import DefaultTheme from 'vitepress/theme' +import Components from '@fmhy/components' import './style.css' import 'uno.css' @@ -13,6 +13,6 @@ export default { }) }, enhanceApp({ app, router, siteData }) { - // ... + app.use(Components) } } satisfies Theme diff --git a/docs/components.md b/docs/components.md new file mode 100644 index 0000000..fc36ab8 --- /dev/null +++ b/docs/components.md @@ -0,0 +1,6 @@ +# Components + +## `GradientCard` + + diff --git a/docs/index.md b/docs/index.md index 6312af5..5ed86d6 100644 --- a/docs/index.md +++ b/docs/index.md @@ -11,6 +11,6 @@ hero: text: Colors link: /colors - theme: alt - text: API Examples - link: /api-examples + text: Components + link: /components --- diff --git a/docs/markdown-examples.md b/docs/markdown-examples.md deleted file mode 100644 index 6d56882..0000000 --- a/docs/markdown-examples.md +++ /dev/null @@ -1,7 +0,0 @@ -
- -
Meow
180°
Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.
- -
Make sure you save your custom color scale.
- -
diff --git a/docs/package.json b/docs/package.json index 3e89cf8..7c3aca3 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,19 +1,20 @@ { - "name": "@fmhy-monorepo/docs", - "version": "1.0.0", - "private": true, - "type": "module", - "scripts": { - "build": "vitepress build", - "dev": "vitepress dev", - "format": "prettier --write --cache .", - "preview": "vitepress preview" - }, - "dependencies": { - "@fmhy/colors": "workspace:^", - "sass": "^1.71.1", - "unocss": "^0.58.5", - "vitepress": "1.0.0-rc.45", - "vue": "^3.4.21" - } + "name": "@fmhy-monorepo/docs", + "version": "1.0.0", + "private": true, + "type": "module", + "scripts": { + "build": "vitepress build", + "dev": "vitepress dev", + "format": "prettier --write --cache *.{md,vue,ts}", + "preview": "vitepress preview" + }, + "dependencies": { + "@fmhy/colors": "workspace:^", + "@fmhy/components": "workspace:^", + "sass": "^1.71.1", + "unocss": "^0.58.5", + "vitepress": "1.0.0-rc.45", + "vue": "^3.4.21" + } }