mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-05-07 05:34:40 +00:00
fix landingpage icons
This commit is contained in:
parent
fab0cdd04e
commit
1eae44dd14
@ -14,7 +14,7 @@ const FrameworkLink: React.FC<FrameworkLinkProps> = ({ template }) => (
|
|||||||
className="items-center justify-center"
|
className="items-center justify-center"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={`inline-block ${template.icon} w-8 h-8 text-4xl transition-theme opacity-25 hover:opacity-100 hover:text-purple-500 dark:text-white dark:opacity-50 dark:hover:opacity-100 dark:hover:text-purple-400 transition-all`}
|
className={`inline-flex items-center justify-center ${template.icon} w-8 h-8 text-4xl transition-theme opacity-25 hover:opacity-100 hover:text-purple-500 dark:text-white dark:opacity-50 dark:hover:opacity-100 dark:hover:text-purple-400 transition-all`}
|
||||||
title={template.label}
|
title={template.label}
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
|
@ -2,7 +2,6 @@ import { globSync } from 'fast-glob';
|
|||||||
import fs from 'node:fs/promises';
|
import fs from 'node:fs/promises';
|
||||||
import { basename, join } from 'node:path';
|
import { basename, join } from 'node:path';
|
||||||
import { defineConfig, presetIcons, presetUno, transformerDirectives } from 'unocss';
|
import { defineConfig, presetIcons, presetUno, transformerDirectives } from 'unocss';
|
||||||
import type { IconifyJSON } from '@iconify/types';
|
|
||||||
|
|
||||||
// Debug: Log the current working directory and icon paths
|
// Debug: Log the current working directory and icon paths
|
||||||
console.log('CWD:', process.cwd());
|
console.log('CWD:', process.cwd());
|
||||||
@ -16,12 +15,11 @@ const customIconCollection = {
|
|||||||
[collectionName]: iconPaths.reduce(
|
[collectionName]: iconPaths.reduce(
|
||||||
(acc, iconPath) => {
|
(acc, iconPath) => {
|
||||||
const [iconName] = basename(iconPath).split('.');
|
const [iconName] = basename(iconPath).split('.');
|
||||||
console.log(`Loading icon: ${iconName} from ${iconPath}`); // Debug log
|
console.log(`Loading icon: ${iconName} from ${iconPath}`);
|
||||||
|
|
||||||
acc[iconName] = async () => {
|
acc[iconName] = async () => {
|
||||||
try {
|
try {
|
||||||
const content = await fs.readFile(iconPath, 'utf8');
|
const content = await fs.readFile(iconPath, 'utf8');
|
||||||
// Simplified SVG processing
|
|
||||||
return content
|
return content
|
||||||
.replace(/fill="[^"]*"/g, 'fill="currentColor"')
|
.replace(/fill="[^"]*"/g, 'fill="currentColor"')
|
||||||
.replace(/fill='[^']*'/g, "fill='currentColor'")
|
.replace(/fill='[^']*'/g, "fill='currentColor'")
|
||||||
@ -120,7 +118,7 @@ const COLOR_PRIMITIVES = {
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
safelist: [
|
safelist: [
|
||||||
// Explicitly safelist all icon combinations with both formats
|
// Explicitly safelist all icon combinations
|
||||||
...Object.keys(customIconCollection[collectionName] || {}).map((x) => `i-${collectionName}-${x}`),
|
...Object.keys(customIconCollection[collectionName] || {}).map((x) => `i-${collectionName}-${x}`),
|
||||||
...Object.keys(customIconCollection[collectionName] || {}).map((x) => `i-${collectionName}-${x.toLowerCase()}`),
|
...Object.keys(customIconCollection[collectionName] || {}).map((x) => `i-${collectionName}-${x.toLowerCase()}`),
|
||||||
],
|
],
|
||||||
@ -265,11 +263,7 @@ export default defineConfig({
|
|||||||
presetIcons({
|
presetIcons({
|
||||||
warn: true,
|
warn: true,
|
||||||
collections: {
|
collections: {
|
||||||
bolt: customIconCollection.bolt,
|
[collectionName]: customIconCollection[collectionName],
|
||||||
ph: async () => {
|
|
||||||
const icons = await import('@iconify-json/ph/icons.json');
|
|
||||||
return icons.default as IconifyJSON;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
extraProperties: {
|
extraProperties: {
|
||||||
display: 'inline-block',
|
display: 'inline-block',
|
||||||
@ -278,7 +272,8 @@ export default defineConfig({
|
|||||||
height: '24px',
|
height: '24px',
|
||||||
},
|
},
|
||||||
scale: 1,
|
scale: 1,
|
||||||
cdn: 'https://esm.sh/',
|
unit: 'px',
|
||||||
|
cdn: '',
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user