113 lines
2.2 KiB
TypeScript
113 lines
2.2 KiB
TypeScript
import { defineConfig } from 'unocss';
|
|
import { presetWeapp } from 'unocss-preset-weapp';
|
|
import { extractorAttributify, transformerClass } from 'unocss-preset-weapp/transformer';
|
|
|
|
const { presetWeappAttributify, transformerAttributify } = extractorAttributify();
|
|
|
|
export default defineConfig({
|
|
content: {
|
|
filesystem: ['src/**/*.{vue,js,ts,jsx,tsx}'],
|
|
},
|
|
presets: [
|
|
presetWeapp({
|
|
whRpx: true,
|
|
}),
|
|
presetWeappAttributify(),
|
|
],
|
|
shortcuts: [
|
|
{
|
|
'flex-col-center': 'flex flex-col justify-center items-center',
|
|
'flex-row-center': 'flex flex-row justify-center items-center',
|
|
'flex-col': 'flex flex-col',
|
|
'flex-row': 'flex flex-row',
|
|
},
|
|
],
|
|
theme: {
|
|
colors: {
|
|
// blue: {
|
|
// DEFAULT: '#0094ff',
|
|
// },
|
|
// red: {
|
|
// DEFAULT: '#f63a36',
|
|
// },
|
|
// yellow: {
|
|
// DEFAULT: '#F2A817',
|
|
// },
|
|
},
|
|
},
|
|
rules: [
|
|
[
|
|
'bg-color-theme',
|
|
{
|
|
'background-color': '#D29E52',
|
|
},
|
|
],
|
|
[
|
|
'bg-color-theme-dark',
|
|
{
|
|
'background-color': '#B37B2E',
|
|
},
|
|
],
|
|
[
|
|
'border-color-theme',
|
|
{
|
|
'border-color': '#F9C26F',
|
|
},
|
|
],
|
|
[
|
|
'border-color-theme-dark',
|
|
{
|
|
'border-color': '#D29E52',
|
|
},
|
|
],
|
|
[
|
|
'text-color-theme',
|
|
{
|
|
color: '#F9C26F',
|
|
},
|
|
],
|
|
[
|
|
'text-color-theme-dark',
|
|
{
|
|
color: '#D29E52',
|
|
},
|
|
],
|
|
[
|
|
'bg-color',
|
|
{
|
|
'background-color': '#333',
|
|
},
|
|
],
|
|
[
|
|
'bg-color-dark',
|
|
{
|
|
'background-color': 'rgba(0, 0, 0, 0.3)',
|
|
},
|
|
],
|
|
[
|
|
'bg-color-light',
|
|
{
|
|
'background-color': '#444',
|
|
},
|
|
],
|
|
[
|
|
'card',
|
|
{
|
|
'background-color': 'rgba(0, 0, 0, 0.3)',
|
|
'box-shadow': '0rpx 8rpx 26rpx -4rpx rgba(210,210,210,0.5)',
|
|
'border-radius': '16rpx',
|
|
},
|
|
],
|
|
[
|
|
'card-thin',
|
|
{
|
|
'background-color': 'rgba(0, 0, 0, 0.3)',
|
|
'box-shadow': 'rgba(0, 0, 0, 0.05) 0px 0px 0px 1px',
|
|
'border-radius': '16rpx',
|
|
},
|
|
],
|
|
],
|
|
|
|
transformers: [transformerAttributify(), transformerClass()],
|
|
});
|