Skip to content

Commit

Permalink
feat: pref ts define
Browse files Browse the repository at this point in the history
  • Loading branch information
zyyv committed Dec 26, 2023
1 parent 90e5a37 commit bf67a6d
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 21 deletions.
78 changes: 77 additions & 1 deletion packages/core/client.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,81 @@
/* Generated by 'unplugin-unocss-config' */
import type { Theme } from '@unocss/preset-mini'
import type { Arrayable, CSSObject } from '@unocss/core'

interface ThemeAnimation {
keyframes?: Record<string, string>
durations?: Record<string, string>
timingFns?: Record<string, string>
properties?: Record<string, object>
counts?: Record<string, string | number>
}

interface Colors {
[key: string]: Colors & {
DEFAULT?: string
} | string
}

interface Theme {
width?: Record<string, string>
height?: Record<string, string>
maxWidth?: Record<string, string>
maxHeight?: Record<string, string>
minWidth?: Record<string, string>
minHeight?: Record<string, string>
inlineSize?: Record<string, string>
blockSize?: Record<string, string>
maxInlineSize?: Record<string, string>
maxBlockSize?: Record<string, string>
minInlineSize?: Record<string, string>
minBlockSize?: Record<string, string>
borderRadius?: Record<string, string>
breakpoints?: Record<string, string>
verticalBreakpoints?: Record<string, string>
colors?: Colors
borderColor?: Colors
backgroundColor?: Colors
textColor?: Colors
shadowColor?: Colors
accentColor?: Colors
fontFamily?: Record<string, string>
fontSize?: Record<string, string | [string, string | CSSObject] | [string, string, string]>
fontWeight?: Record<string, string>
lineHeight?: Record<string, string>
letterSpacing?: Record<string, string>
wordSpacing?: Record<string, string>
boxShadow?: Record<string, string | string[]>
textIndent?: Record<string, string>
textShadow?: Record<string, string | string[]>
textStrokeWidth?: Record<string, string>
ringWidth?: Record<string, string>
lineWidth?: Record<string, string>
spacing?: Record<string, string>
duration?: Record<string, string>
aria?: Record<string, string>
data?: Record<string, string>
zIndex?: Record<string, string>
blur?: Record<string, string>
dropShadow?: Record<string, string | string[]>
easing?: Record<string, string>
media?: Record<string, string>
supports?: Record<string, string>
containers?: Record<string, string>
animation?: ThemeAnimation
gridAutoColumn?: Record<string, string>
gridAutoRow?: Record<string, string>
gridColumn?: Record<string, string>
gridRow?: Record<string, string>
gridTemplateColumn?: Record<string, string>
gridTemplateRow?: Record<string, string>
container?: {
center?: boolean
padding?: string | Record<string, string>
maxWidth?: Record<string, string>
}
/** Used to generate CSS variables placeholder in preflight */
preflightRoot?: Arrayable<string>
preflightBase?: Record<string, string | number>
}

declare const __UNO__: Pick<ReturnType<typeof import('@unocss/core').createGenerator<Theme>>, 'config' | 'userConfig' | 'version' | 'blocked'>

Expand Down
7 changes: 2 additions & 5 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./clent": {
"./client": {
"types": "./client.d.ts"
},
"./vite": {
Expand Down Expand Up @@ -82,11 +82,8 @@
}
},
"dependencies": {
"unplugin": "^1.5.1"
},
"devDependencies": {
"@unocss/config": "^0.58.0",
"@unocss/core": "^0.58.0",
"@unocss/preset-mini": "^0.58.0"
"unplugin": "^1.5.1"
}
}
2 changes: 1 addition & 1 deletion playground/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from 'vite'
import Inspect from 'vite-plugin-inspect'
import vue from '@vitejs/plugin-vue'
import UnoCSS from '@unocss/vite'
import UnoCSS from 'unocss/vite'
import Unplugin from 'unplugin-unocss-config/vite'

export default defineConfig({
Expand Down
20 changes: 6 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bf67a6d

Please sign in to comment.