@lincy/base-config
v1.3.3
Published
Opinionated collection of common JavaScript / TypeScript utils by LCY
Downloads
184
Readme
@lincy/base-config
Usage
pnpm install @lincy/base-config
用于一般 web 的配置
uno.config.ts
import { adminConfig } from '@lincy/base-config'
export default adminConfig()
启用的 presets
- presetUno 相关文档: https://unocss.dev/presets/uno
- presetAttributify 相关文档: https://unocss.dev/presets/attributify
- presetIcons 相关文档: https://unocss.dev/presets/icons
启用的 transformers
- transformerDirectives 相关文档: https://unocss.dev/transformers/directives
- transformerVariantGroup 相关文档: https://unocss.dev/transformers/variant-group
- transformerCompileClass 相关文档: https://unocss.dev/transformers/compile-class
用于 datav 的配置
uno.config.ts
import { datavConfig } from '@lincy/base-config'
const baseConfig = datavConfig({ baseFontSize: 100 })
export default {
...baseConfig,
safelist: [
...(baseConfig.safelist || []),
...Array.from({ length: 10 }, (_, i) => `i-fad-digital${i}`),
],
}
启用的 presets
- presetUno 相关文档: https://unocss.dev/presets/uno
- presetAttributify 相关文档: https://unocss.dev/presets/attributify
- presetIcons 相关文档: https://unocss.dev/presets/icons
- pxToRemPreset
将
px
转成rem
启用的 transformers
- transformerDirectives 相关文档: https://unocss.dev/transformers/directives
- transformerVariantGroup 相关文档: https://unocss.dev/transformers/variant-group
- transformerCompileClass 相关文档: https://unocss.dev/transformers/compile-class
用于 H5 的配置
uno.config.ts
import { h5Config } from '@lincy/base-config'
export default h5Config({
baseFontSize: 37.5,
unti: 'rem',
})
启用的 presets
- presetUno 相关文档: https://unocss.dev/presets/uno
- presetAttributify 相关文档: https://unocss.dev/presets/attributify
- presetIcons 相关文档: https://unocss.dev/presets/icons
- pxToRemPreset
将
px
转成rem
启用的 transformers
- transformerAttributifyJsx 相关文档: https://unocss.dev/transformers/attributify-jsx
- transformerDirectives 相关文档: https://unocss.dev/transformers/directives
- transformerVariantGroup 相关文档: https://unocss.dev/transformers/variant-group
- transformerCompileClass 相关文档: https://unocss.dev/transformers/compile-class
用于 UniApp 的配置
uno.config.ts
import { uniappConfig } from '@lincy/base-config'
export default uniappConfig({
baseFontSize: 1,
unti: 'rpx',
})
启用的 presets
微信小程序
- presetApplet 相关文档: https://github.com/unocss-applet/unocss-applet
- presetIcons 相关文档: https://unocss.dev/presets/icons
- pxToRemPreset
将
px
转成rem
其他
- presetUno 相关文档: https://unocss.dev/presets/uno
- presetAttributify 相关文档: https://unocss.dev/presets/attributify
- presetIcons 相关文档: https://unocss.dev/presets/icons
- pxToRemPreset
将
px
转成rem
启用的 transformers
微信小程序
- transformerAttributify 相关文档: https://github.com/unocss-applet/unocss-applet/tree/main/packages/transformer-attributify
- transformerApplet 相关文档: https://github.com/unocss-applet/unocss-applet/tree/main/packages/preset-applet
- transformerDirectives 相关文档: https://unocss.dev/transformers/directives
- transformerVariantGroup 相关文档: https://unocss.dev/transformers/variant-group
- transformerCompileClass 相关文档: https://unocss.dev/transformers/compile-class
其他
- transformerDirectives 相关文档: https://unocss.dev/transformers/directives
- transformerVariantGroup 相关文档: https://unocss.dev/transformers/variant-group
- transformerCompileClass 相关文档: https://unocss.dev/transformers/compile-class
License
MIT