diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index b85c4d725..69e58d1ec 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -1,3 +1,4 @@ +import { fileURLToPath, URL } from 'node:url' import path from 'path'; import { defineConfig } from 'vitepress' import sidebar from './sidebar'; @@ -8,6 +9,18 @@ export default defineConfig({ title: "Lucide", description: "Beautiful & consistent icon toolkit made by the community.", outDir: '.vercel/output/static', + vite: { + resolve: { + alias: [ + { + find: /^.*\/VPIconAlignLeft\.vue$/, + replacement: fileURLToPath( + new URL('./theme/components/overrides/VPIconAlignLeft.vue', import.meta.url) + ) + } + ] + } + }, themeConfig: { // https://vitepress.dev/reference/default-theme-config logo: { diff --git a/docs/.vitepress/lib/createCodeExamples.ts b/docs/.vitepress/lib/createCodeExamples.ts index 626ff5055..2de4a5b23 100644 --- a/docs/.vitepress/lib/createCodeExamples.ts +++ b/docs/.vitepress/lib/createCodeExamples.ts @@ -39,7 +39,7 @@ const getIconCodes = (): CodeExampleType => { const App = () => { return ( - + ); }; diff --git a/docs/.vitepress/theme/components/overrides/VPIconAlignLeft.vue b/docs/.vitepress/theme/components/overrides/VPIconAlignLeft.vue new file mode 100644 index 000000000..7bd95b3d2 --- /dev/null +++ b/docs/.vitepress/theme/components/overrides/VPIconAlignLeft.vue @@ -0,0 +1,10 @@ + + + diff --git a/docs/.vitepress/theme/composables/useIconCodeExample.ts b/docs/.vitepress/theme/composables/useIconCodeExample.ts deleted file mode 100644 index e4e427a5d..000000000 --- a/docs/.vitepress/theme/composables/useIconCodeExample.ts +++ /dev/null @@ -1,164 +0,0 @@ -import { startCase, camelCase } from 'lodash-es' -import { computed } from 'vue' - -type CodeExampleType = Record - -const getIconCodes = (name: string): CodeExampleType => { - const pascalCase = startCase(camelCase(name)).replace(/\s/g, '') - - return { - html: { - title: 'HTML', - codes: [ - { - language: 'markup', - code: ` -`, - }, - ], - }, - react: { - title: 'React', - codes: [ - { - language: 'tsx', - code: `import { ${pascalCase} } from 'lucide-react'; - -const App = () => { - return ( - <${pascalCase}/> - ); -}; - -export default App; -`, - metastring: '{1,4}', - }, - ], - }, - vue: { - title: 'Vue 3', - codes: [ - { - language: 'markup', - code: ` - - -`, - metastring: '{2,6}', - }, - ], - }, - svelte: { - title: 'Svelte', - codes: [ - { - language: 'markup', - code: ` - -<${pascalCase}/> -`, - metastring: '{2,5}', - }, - ], - }, - preact:{ - title: 'Preact', - codes: [ - { - language: 'tsx', - code: `import { ${pascalCase} } from 'lucide-preact'; - -const App = () => { - return ( - <${pascalCase}/> - ); -}; - -export default App; -`, - metastring: '{1,4}', - }, - ], - }, - solid:{ - title: 'Solid', - codes: [ - { - language: 'tsx', - code: `import { ${pascalCase} } from 'lucide-solid'; - -const App = () => { - return ( - <${pascalCase}/> - ); -}; - -export default App; -`, - metastring: '{1,4}', - }, - ], - }, - angular: { - title: 'Angular', - codes: [ - { - language: 'tsx', - code: `// app.module.ts -import { LucideAngularModule, ${pascalCase} } from 'lucide-angular';\r -@NgModule({ - imports: [ - LucideAngularModule.pick({ ${pascalCase} }) - ], -}) - -// app.component.html - -`, - }, - ], - }, - font: { - title: 'Icon Font', - codes: [ - { - language: 'css', - code: ` - -
-`, - }, - ], - }, - flutter: { - title: 'Flutter', - codes: [ - { - language: 'javascript', - code: `Icon(LucideIcons.${name}); -`, - }, - ], - }, - }; -} - -export default function useIconCodeExamples(name: string) { - return computed(() => getIconCodes(name)) -} diff --git a/docs/.vitepress/theme/style.css b/docs/.vitepress/theme/style.css index d88ee074b..6c8b3b287 100644 --- a/docs/.vitepress/theme/style.css +++ b/docs/.vitepress/theme/style.css @@ -92,6 +92,10 @@ display: block; } } + +.VPNavBarHamburger .container > span { + border-radius: 2px; +} /* html:has(* .outline-link:target) { scroll-behavior: smooth; diff --git a/docs/icons/[name].md b/docs/icons/[name].md index d1247be9d..4b20dc330 100644 --- a/docs/icons/[name].md +++ b/docs/icons/[name].md @@ -40,16 +40,17 @@ const codeExample = computed(() => data.codeExamples?.map( :class="$style.preview" /> - +
+ + +
+ +
- -
- -