[READ-ONLY] a fast, modern browser for the npm registry
at main 170 lines 8.3 kB view raw
1import { 2 defineConfig, 3 presetIcons, 4 presetWind4, 5 transformerDirectives, 6 transformerVariantGroup, 7} from 'unocss' 8import type { Theme } from '@unocss/preset-wind4/theme' 9import { presetRtl } from './uno-preset-rtl' 10import { presetA11y } from './uno-preset-a11y' 11 12const customIcons = { 13 'agent-skills': 14 '<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16 0.5L29.4234 8.25V23.75L16 31.5L2.57661 23.75V8.25L16 0.5Z" fill="currentColor"/><path d="M16 6L24.6603 11V21L16 26L7.33975 21V11L16 6Z" fill="none" stroke="currentColor" stroke-width="3"/></svg>', 15 'tangled': 16 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25"><path fill="currentColor" d="M16.346 24.11c-.785-.007-1.384-.235-2.034-.632-.932-.49-1.643-1.314-2.152-2.222-.808 1.003-1.888 1.611-3.097 1.955-.515.15-1.416.301-2.911-.24-2.154-.724-3.723-2.965-3.545-5.25-.033-.946.313-1.875.802-2.674-1.305-.7-2.37-1.876-2.777-3.318-.248-.79-.237-1.64-.146-2.452.327-1.916 1.764-3.582 3.615-4.182.738-1.683 2.35-2.938 4.176-3.193a5.54 5.54 0 0 1 3.528.7C13.351.89 16.043.383 18.1 1.436c1.568.75 2.69 2.312 2.962 4.015 1.492.598 2.749 1.817 3.242 3.365.33.958.34 2.013.127 2.997-.382 1.536-1.465 2.842-2.868 3.557.003.273.901 2.243.751 3.73-.033 1.858-1.211 3.62-2.846 4.475-.954.557-2.085.546-3.12.535m-4.47-5.35c1.322-.148 2.19-1.3 2.862-2.339.319-.473.562-1.002.803-1.506.314.287.58.828 1.075.957.522.163 1.133.03 1.453-.443.611-1.14.31-2.517-.046-3.699-.22-.679-.507-1.375-1.054-1.856.116-.823-.372-1.66-1.065-2.09-.592.47-1.491.468-2.061-.037-1.093 1.115-2.095 1.078-3.063.195-.217-.199-.632 1.212-2.088.413-.837.7-1.485 1.375-2.06 2.346-.559 1.046-1.143 1.976-1.194 3.113-.024.664.495 1.36 1.198 1.306.703.063 1.182-.63 1.714-.917.08.928.169 1.924.482 2.829.36 1.171 1.627 1.916 2.825 1.745zm.687-3.498c-.644-.394-.334-1.25-.36-1.871.064-.75.115-1.538.453-2.221.356-.487 1.226-.3 1.265.326-.026.628-.314 1.254-.28 1.905-.075.544.054 1.155-.186 1.653-.198.275-.6.355-.892.208m-2.81-.358c-.605-.329-.413-1.156-.508-1.73.08-.666.014-1.51.571-1.978.545-.38 1.287.271 1.03.869-.276.755-.096 1.58-.09 2.346a.712.712 0 0 1-1.002.493"/></svg>', 17 'vlt': 18 '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.9991 5.03666C7.9991 5.46387 7.93211 5.87545 7.80808 6.26145C7.45933 7.34674 7.1975 8.58253 7.7669 9.57009L10.389 14.1177C10.7072 14.6697 11.3617 14.9108 11.9989 14.9108V14.9108V14.9108C12.6352 14.9108 13.2886 14.6699 13.6064 14.1187L16.2301 9.5682C16.7993 8.58097 16.5379 7.34565 16.1895 6.26064C16.0656 5.87488 15.9987 5.46358 15.9987 5.03666C15.9987 2.82777 17.7894 1.03711 19.9983 1.03711C22.2071 1.03711 23.9978 2.82777 23.9978 5.03666C23.9978 7.24555 22.2071 9.03621 19.9983 9.03621V9.03621C19.3609 9.03621 18.7062 9.27733 18.3878 9.82951L15.7661 14.3766C15.1967 15.3642 15.4586 16.6001 15.8074 17.6854C15.9314 18.0715 15.9984 18.4831 15.9984 18.9104C15.9984 21.1193 14.2078 22.9099 11.9989 22.9099C9.79001 22.9099 7.99935 21.1193 7.99935 18.9104C7.99935 18.4834 8.06626 18.072 8.19016 17.6862C8.53863 16.6012 8.80017 15.3657 8.23092 14.3785L5.60752 9.8285C5.28961 9.27712 4.63601 9.03621 3.99955 9.03621V9.03621C1.79066 9.03621 0 7.24555 0 5.03666C0 2.82777 1.79066 1.03711 3.99955 1.03711C6.20844 1.03711 7.9991 2.82777 7.9991 5.03666Z" fill="currentColor"></path></svg>', 19 'a11y': 20 '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="6" r="1"/><path d="m9 18 3-5 3 5"/><path d="m8 10 8 0"/><path d="M12 10v4"/></svg>', 21} 22 23export default defineConfig({ 24 presets: [ 25 presetWind4(), 26 presetIcons({ 27 extraProperties: { 28 'display': 'inline-block', 29 'forced-color-adjust': 'preserve-parent-color', 30 }, 31 warn: true, 32 scale: 1.2, 33 collections: { 34 custom: customIcons, 35 }, 36 }), 37 // keep this preset last 38 ...(process.env.CI ? [] : [presetRtl(), presetA11y()]), 39 ].filter(Boolean), 40 transformers: [transformerDirectives(), transformerVariantGroup()], 41 theme: { 42 spacing: { DEFAULT: '4px' }, 43 font: { 44 mono: "'Geist Mono', monospace", 45 sans: "'Geist', system-ui, -apple-system, sans-serif", 46 }, 47 text: { 48 '2xs': { fontSize: '0.6875rem' }, // 11px 49 '3xs': { fontSize: '0.625rem' }, // 10px 50 '4xs': { fontSize: '0.5625rem' }, // 9px 51 '5xs': { fontSize: '0.5rem' }, // 8px 52 }, 53 colors: { 54 // Minimal black & white palette with subtle grays 55 bg: { 56 DEFAULT: 'var(--bg)', 57 subtle: 'var(--bg-subtle)', 58 muted: 'var(--bg-muted)', 59 elevated: 'var(--bg-elevated)', 60 }, 61 fg: { 62 DEFAULT: 'var(--fg)', 63 muted: 'var(--fg-muted)', 64 subtle: 'var(--fg-subtle)', 65 }, 66 border: { 67 DEFAULT: 'var(--border)', 68 subtle: 'var(--border-subtle)', 69 hover: 'var(--border-hover)', 70 }, 71 accent: { 72 DEFAULT: 'var(--accent)', 73 fallback: 'var(--accent-muted)', 74 }, 75 // Syntax highlighting colors (inspired by GitHub Dark) 76 syntax: { 77 fn: 'var(--syntax-fn)', 78 str: 'var(--syntax-str)', 79 kw: 'var(--syntax-kw)', 80 comment: 'var(--syntax-comment)', 81 }, 82 badge: { 83 orange: 'var(--badge-orange)', 84 yellow: 'var(--badge-yellow)', 85 green: 'var(--badge-green)', 86 cyan: 'var(--badge-cyan)', 87 blue: 'var(--badge-blue)', 88 indigo: 'var(--badge-indigo)', 89 purple: 'var(--badge-purple)', 90 pink: 'var(--badge-pink)', 91 }, 92 // Playground provider brand colors 93 provider: { 94 stackblitz: '#1389FD', 95 codesandbox: '#FFCC00', 96 codepen: '#47CF73', 97 replit: '#F26207', 98 gitpod: '#FFAE33', 99 vue: '#4FC08D', 100 nuxt: '#00DC82', 101 vite: '#646CFF', 102 jsfiddle: '#0084FF', 103 }, 104 }, 105 animation: { 106 keyframes: { 107 'skeleton-pulse': '{0%, 100% { opacity: 0.4 } 50% { opacity: 0.7 }}', 108 'fade-in': '{from { opacity: 0 } to { opacity: 1 }}', 109 'slide-up': 110 '{from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: translateY(0) }}', 111 'scale-in': 112 '{from { opacity: 0; transform: scale(0.95) } to { opacity: 1; transform: scale(1) }}', 113 }, 114 durations: { 115 'skeleton-pulse': '2s', 116 'fade-in': '0.3s', 117 'slide-up': '0.4s', 118 'scale-in': '0.2s', 119 }, 120 timingFns: { 121 'skeleton-pulse': 'ease-in-out', 122 'fade-in': 'ease-out', 123 'slide-up': 'cubic-bezier(0.22, 1, 0.36, 1)', 124 'scale-in': 'cubic-bezier(0.22, 1, 0.36, 1)', 125 }, 126 counts: { 127 'skeleton-pulse': 'infinite', 128 }, 129 }, 130 } satisfies Theme, 131 shortcuts: [ 132 // Layout 133 ['container', 'max-w-6xl mx-auto px-4 sm:px-6'], 134 ['container-sm', 'max-w-5xl mx-auto px-4 sm:px-6'], 135 136 // Focus states - subtle but accessible 137 ['focus-ring', 'outline-none focus-visible:(ring-2 ring-fg/50 ring-offset-2)'], 138 139 ['link-subtle', 'text-fg-muted hover:text-fg transition-colors duration-200 focus-ring'], 140 141 // badges 142 ['badge-orange', 'bg-badge-orange/10 text-badge-orange'], 143 ['badge-yellow', 'bg-badge-yellow/10 text-badge-yellow'], 144 ['badge-green', 'bg-badge-green/10 text-badge-green'], 145 ['badge-cyan', 'bg-badge-cyan/10 text-badge-cyan'], 146 ['badge-blue', 'bg-badge-blue/10 text-badge-blue'], 147 ['badge-indigo', 'bg-badge-indigo/10 text-badge-indigo'], 148 ['badge-purple', 'bg-badge-purple/10 text-badge-purple'], 149 ['badge-pink', 'bg-badge-pink/10 text-badge-pink'], 150 ['badge-subtle', 'bg-bg-subtle text-fg-subtle'], 151 ], 152 rules: [ 153 // Custom scale for active states 154 ['scale-98', { transform: 'scale(0.98)' }], 155 156 // Subtle text gradient for headings 157 [ 158 'text-gradient', 159 { 160 'background': 'linear-gradient(to right, #fafafa, #a1a1a1)', 161 '-webkit-background-clip': 'text', 162 '-webkit-text-fill-color': 'transparent', 163 'background-clip': 'text', 164 }, 165 ], 166 167 // Ensures elements start in initial state during delay 168 ['animate-fill-both', { 'animation-fill-mode': 'both' }], 169 ], 170})