Skip to content

Commit

Permalink
docs: components page
Browse files Browse the repository at this point in the history
  • Loading branch information
taskylizard committed Mar 30, 2024
1 parent cee05db commit bd4d633
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 30 deletions.
17 changes: 15 additions & 2 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
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',
description: '🎋',
cleanUrls: true,
vite: {
plugins: [
UnoCSS({ presets: [presetUno(), presetWind(), presetTypography()] })
// @ts-expect-error
UnoCSS({
theme: { colors: colors },
safelist,
presets: [presetUno(), presetWind()]
})
]
},
themeConfig: {
Expand Down
4 changes: 2 additions & 2 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -13,6 +13,6 @@ export default {
})
},
enhanceApp({ app, router, siteData }) {
// ...
app.use(Components)
}
} satisfies Theme
6 changes: 6 additions & 0 deletions docs/components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Components

## `GradientCard`

<GradientCard theme="cerise" title="title" description="Lorem ipsum dolor sit amet, qui minim labore
adipisicing minim sint cillum sint consectetur cupidatat." tag="tag or link" />
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ hero:
text: Colors
link: /colors
- theme: alt
text: API Examples
link: /api-examples
text: Components
link: /components
---
7 changes: 0 additions & 7 deletions docs/markdown-examples.md

This file was deleted.

35 changes: 18 additions & 17 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}

0 comments on commit bd4d633

Please sign in to comment.