forked from viarotel-org/vite-uniapp-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unocss.config.js
36 lines (32 loc) · 1.03 KB
/
unocss.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { transformerDirectives } from 'unocss'
import presetWeapp from 'unocss-preset-weapp'
import { transformerClass } from 'unocss-preset-weapp/transformer'
import lineClamps from './src/utils/lineClamps/index.js'
const primary = {
DEFAULT: '#2b9939',
}
// const isApplet = process.env?.UNI_PLATFORM?.startsWith('mp-')
const weappConfig = presetWeapp({
whRpx: false,
})
// console.log(weappConfig)
export default {
presets: [weappConfig],
theme: {
colors: {
gray: weappConfig?.theme?.colors?.neutral,
primary,
},
},
rules: [...lineClamps],
transformers: [transformerDirectives(), transformerClass()],
shortcuts: {
'container-fixed':
'w-full sm:w-screen-lg 2xl:w-screen-xl sm:mx-auto px-4 sm:px-0',
'position-center':
'absolute top-1/2 left-1/2 transform -translate-y-1/2 -translate-x-1/2',
'position-center-x': 'absolute left-1/2 transform -translate-x-1/2',
'position-center-y': 'absolute top-1/2 transform -translate-y-1/2',
'fix-inset-0': 'top-0 bottom-0 left-0 right-0',
},
}