mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-15 14:08:49 +00:00
Override menu icon
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -39,7 +39,7 @@ const getIconCodes = (): CodeExampleType => {
|
||||
|
||||
const App = () => {
|
||||
return (
|
||||
<PascalCase strokeWidth={2} size={32} color="#000"/>
|
||||
<PascalCase />
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { menu } from '../../../data/iconNodes'
|
||||
import createLucideIcon from 'lucide-vue-next/src/createLucideIcon'
|
||||
|
||||
const Menu = createLucideIcon('menu', menu)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Menu />
|
||||
</template>
|
||||
@@ -1,164 +0,0 @@
|
||||
import { startCase, camelCase } from 'lodash-es'
|
||||
import { computed } from 'vue'
|
||||
|
||||
type CodeExampleType = Record<string, {
|
||||
title: string,
|
||||
codes: {
|
||||
language?: string,
|
||||
code: string,
|
||||
metastring?: string,
|
||||
}[],
|
||||
}>
|
||||
|
||||
const getIconCodes = (name: string): CodeExampleType => {
|
||||
const pascalCase = startCase(camelCase(name)).replace(/\s/g, '')
|
||||
|
||||
return {
|
||||
html: {
|
||||
title: 'HTML',
|
||||
codes: [
|
||||
{
|
||||
language: 'markup',
|
||||
code: `<i icon-name="${name}"></i>
|
||||
`,
|
||||
},
|
||||
],
|
||||
},
|
||||
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: `<template>
|
||||
<${pascalCase} />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ${pascalCase} } from 'lucide-vue-next';
|
||||
</script>
|
||||
`,
|
||||
metastring: '{2,6}',
|
||||
},
|
||||
],
|
||||
},
|
||||
svelte: {
|
||||
title: 'Svelte',
|
||||
codes: [
|
||||
{
|
||||
language: 'markup',
|
||||
code: `<script>
|
||||
import { ${pascalCase} } from 'lucide-svelte';
|
||||
</script>
|
||||
|
||||
<${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
|
||||
<lucide-icon name="${name}"></lucide-icon>
|
||||
`,
|
||||
},
|
||||
],
|
||||
},
|
||||
font: {
|
||||
title: 'Icon Font',
|
||||
codes: [
|
||||
{
|
||||
language: 'css',
|
||||
code: `<style>
|
||||
@import ('~lucide-static/font/Lucide.css')
|
||||
</style>
|
||||
|
||||
<div class="icon-${name}"></div>
|
||||
`,
|
||||
},
|
||||
],
|
||||
},
|
||||
flutter: {
|
||||
title: 'Flutter',
|
||||
codes: [
|
||||
{
|
||||
language: 'javascript',
|
||||
code: `Icon(LucideIcons.${name});
|
||||
`,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default function useIconCodeExamples(name: string) {
|
||||
return computed(() => getIconCodes(name))
|
||||
}
|
||||
@@ -92,6 +92,10 @@
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.VPNavBarHamburger .container > span {
|
||||
border-radius: 2px;
|
||||
}
|
||||
/*
|
||||
html:has(* .outline-link:target) {
|
||||
scroll-behavior: smooth;
|
||||
|
||||
@@ -40,16 +40,17 @@ const codeExample = computed(() => data.codeExamples?.map(
|
||||
:class="$style.preview"
|
||||
/>
|
||||
</div>
|
||||
<IconInfo :icon="$params"/>
|
||||
<div>
|
||||
<IconInfo :icon="$params"/>
|
||||
<CodeGroup :groups="tabs" groupName="icon-code-example">
|
||||
<div
|
||||
class="blocks"
|
||||
v-html="codeExample"
|
||||
/>
|
||||
</CodeGroup>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<CodeGroup :groups="tabs" groupName="icon-code-example">
|
||||
<div
|
||||
class="blocks"
|
||||
v-html="codeExample"
|
||||
/>
|
||||
</CodeGroup>
|
||||
|
||||
<style module>
|
||||
.preview {
|
||||
margin-bottom: 24px;
|
||||
|
||||
Reference in New Issue
Block a user