File size: 2,846 Bytes
6927c07 621b880 6927c07 |
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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
import { globSync } from 'fast-glob';
import fs from 'node:fs/promises';
import { basename } from 'node:path';
import { defineConfig, presetIcons, presetUno, transformerDirectives } from 'unocss';
const iconPaths = globSync('./icons/*.svg');
const collectionName = 'blitz';
const customIconCollection = iconPaths.reduce(
(acc, iconPath) => {
const [iconName] = basename(iconPath).split('.');
acc[collectionName] ??= {};
acc[collectionName][iconName] = async () => fs.readFile(iconPath, 'utf8');
return acc;
},
{} as Record<string, Record<string, () => Promise<string>>>,
);
const COLOR_PRIMITIVES = {
accent: {
DEFAULT: '#1389FD',
50: '#EEF9FF',
100: '#D8F1FF',
200: '#B9E7FF',
300: '#89DBFF',
400: '#52C5FF',
500: '#2AA7FF',
600: '#1389FD',
700: '#0C70E9',
800: '#115ABC',
900: '#144D94',
950: '#11305A',
},
gray: {
0: '#FFFFFF',
50: '#F6F8F9',
100: '#EEF0F1',
200: '#E4E6E9',
300: '#D2D5D9',
400: '#AAAFB6',
500: '#7C8085',
600: '#565A64',
700: '#414349',
800: '#31343B',
900: '#2B2D35',
950: '#232429',
1000: '#000000',
},
positive: {
50: '#EDFCF6',
100: '#CEFDEB',
200: '#A1F9DC',
300: '#64F1CB',
400: '#24E0B3',
500: '#02C79F',
600: '#00A282',
700: '#00826B',
800: '#006656',
900: '#005449',
950: '#223533',
},
negative: {
50: '#FEF2F3',
100: '#FDE6E7',
200: '#FBD0D4',
300: '#F7AAB1',
400: '#F06A78',
500: '#E84B60',
600: '#D42A48',
700: '#B21E3C',
800: '#951C38',
900: '#801B36',
950: '#45212A',
},
info: {
50: '#EFF9FF',
100: '#E5F6FF',
200: '#B6E9FF',
300: '#75DAFF',
400: '#2CC8FF',
500: '#00AEF2',
600: '#008ED4',
700: '#0071AB',
800: '#005F8D',
900: '#064F74',
950: '#17374A',
},
warning: {
50: '#FEFAEC',
100: '#FCF4D9',
200: '#F9E08E',
300: '#F6CA53',
400: '#ED9413',
500: '#D2700D',
600: '#AE4E0F',
700: '#AE4E0F',
800: '#8E3D12',
900: '#753212',
950: '#402C22',
},
};
export default defineConfig({
theme: {
colors: {
...COLOR_PRIMITIVES,
bolt: {
elements: {
app: {
backgroundColor: 'var(--bolt-elements-app-backgroundColor)',
borderColor: 'var(--bolt-elements-app-borderColor)',
textColor: 'var(--bolt-elements-app-textColor)',
linkColor: 'var(--bolt-elements-app-linkColor)',
},
},
},
},
},
transformers: [transformerDirectives()],
presets: [
presetUno({
dark: {
light: '[data-theme="light"]',
dark: '[data-theme="dark"]',
},
}),
presetIcons({
warn: true,
collections: {
...customIconCollection,
},
}),
],
});
|