mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-22 17:29:20 +01:00
Compare commits
138 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3648e02992 | ||
|
|
64504da1cd | ||
|
|
e166ba4e80 | ||
|
|
1123214b13 | ||
|
|
4140ba5612 | ||
|
|
019f38281c | ||
|
|
633595d1c1 | ||
|
|
df58c3ff2f | ||
|
|
e7abba5273 | ||
|
|
2693da38d3 | ||
|
|
ab59a1ec36 | ||
|
|
315c020279 | ||
|
|
494f7953c8 | ||
|
|
a5ea3a5368 | ||
|
|
6486f76c55 | ||
|
|
e32db96f1f | ||
|
|
73f70c885a | ||
|
|
14c7ea8e13 | ||
|
|
9fc7653dc1 | ||
|
|
2b007e7962 | ||
|
|
bb1e470f3a | ||
|
|
4a1e6bbfa5 | ||
|
|
e5ee997566 | ||
|
|
27c0a136cd | ||
|
|
84b3c46b65 | ||
|
|
1a09e7fb39 | ||
|
|
75e9724072 | ||
|
|
fbaccc7d9f | ||
|
|
c24bc4d7ef | ||
|
|
5c8c8f4362 | ||
|
|
ffd2a62941 | ||
|
|
e77959e1a6 | ||
|
|
149ee36e61 | ||
|
|
88bf60b5d7 | ||
|
|
1e5df716a4 | ||
|
|
fc0ea760e5 | ||
|
|
c85275899a | ||
|
|
288edde1ea | ||
|
|
207ff6c487 | ||
|
|
a1a9a4d839 | ||
|
|
c5804ad9a5 | ||
|
|
c72fb4a28b | ||
|
|
da5ad547b5 | ||
|
|
66cfe527b3 | ||
|
|
d1866225ba | ||
|
|
372735999f | ||
|
|
f3a33346dd | ||
|
|
3373acf596 | ||
|
|
73d5bfc318 | ||
|
|
ddbc074aa3 | ||
|
|
8f4d6b1651 | ||
|
|
d8b08f8fda | ||
|
|
fddacb6260 | ||
|
|
3d0c8691c9 | ||
|
|
47998b05aa | ||
|
|
9a9e051343 | ||
|
|
6c6c8448fa | ||
|
|
49445aad3a | ||
|
|
70656eb4f0 | ||
|
|
930f862547 | ||
|
|
931b7f5376 | ||
|
|
81e44bdc40 | ||
|
|
e6e90944b9 | ||
|
|
f6fd369bfe | ||
|
|
bbf183fe48 | ||
|
|
4f5642b872 | ||
|
|
1dce6a141a | ||
|
|
dbfce919fc | ||
|
|
52adb78df8 | ||
|
|
c5cfbed28c | ||
|
|
1e4fd13852 | ||
|
|
0a0fd1cf6c | ||
|
|
487d03fc4d | ||
|
|
950160ad5a | ||
|
|
b6f5898aee | ||
|
|
a9c1dca801 | ||
|
|
c05c7e333f | ||
|
|
dff42fe326 | ||
|
|
c1f642e20f | ||
|
|
cf9565b69c | ||
|
|
4cc4468d2f | ||
|
|
fd9ab8f17a | ||
|
|
c9101f0f39 | ||
|
|
614ef1a1d5 | ||
|
|
1a441812ac | ||
|
|
4a33e90c65 | ||
|
|
062a64a078 | ||
|
|
95a1ea7255 | ||
|
|
a0a5bc8fc2 | ||
|
|
698eded89b | ||
|
|
a70b713572 | ||
|
|
34530ad805 | ||
|
|
f73aed151a | ||
|
|
2bd7748562 | ||
|
|
da8a6c5a1b | ||
|
|
5736028dfa | ||
|
|
45d2063340 | ||
|
|
f71d3ffd1d | ||
|
|
b8c3a5fa0b | ||
|
|
a4076db69b | ||
|
|
55cb681461 | ||
|
|
09d9bb747d | ||
|
|
42f9cdceca | ||
|
|
c652723b32 | ||
|
|
a44328d8be | ||
|
|
376568239f | ||
|
|
92d05b5fca | ||
|
|
27b5b7eaad | ||
|
|
4de1355e54 | ||
|
|
c8d94bf3e1 | ||
|
|
a128d1c3c1 | ||
|
|
e145cb05e2 | ||
|
|
759ff562fd | ||
|
|
ae2899a09e | ||
|
|
8b7ea73aa3 | ||
|
|
1bdeae5364 | ||
|
|
0e307087f6 | ||
|
|
a46114b3e7 | ||
|
|
fcafe0e7b7 | ||
|
|
5312982b8f | ||
|
|
3a13fab009 | ||
|
|
30a69ee670 | ||
|
|
5f442122ab | ||
|
|
e78d910a83 | ||
|
|
ccc8dc2b34 | ||
|
|
96bcca0e08 | ||
|
|
d95b14a70b | ||
|
|
a852a43ef4 | ||
|
|
4953a95e36 | ||
|
|
cad1b95b69 | ||
|
|
92f3fb0f90 | ||
|
|
6e8895d075 | ||
|
|
a1b2ce5b7b | ||
|
|
4a54e87e84 | ||
|
|
d8bdbff9c6 | ||
|
|
70cffa8dd2 | ||
|
|
8cff59627b | ||
|
|
b684a0083b |
@@ -4,3 +4,7 @@ coverage
|
|||||||
lib
|
lib
|
||||||
tests
|
tests
|
||||||
node_modules
|
node_modules
|
||||||
|
.eslintrc.js
|
||||||
|
docs/images
|
||||||
|
docs/guide/basics/examples
|
||||||
|
packages/lucide-react/dynamicIconImports.js
|
||||||
|
|||||||
41
.eslintrc.js
41
.eslintrc.js
@@ -1,10 +1,13 @@
|
|||||||
|
const DEFAULT_ATTRS = require('./scripts/render/default-attrs.json');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
root: true,
|
||||||
env: {
|
env: {
|
||||||
browser: true,
|
browser: true,
|
||||||
node: true,
|
node: true,
|
||||||
},
|
},
|
||||||
extends: ['airbnb-base', 'prettier'],
|
extends: ['airbnb-base', 'prettier'],
|
||||||
plugins: ['import', 'prettier'],
|
plugins: ['import', 'prettier', '@html-eslint'],
|
||||||
rules: {
|
rules: {
|
||||||
'no-console': 'off',
|
'no-console': 'off',
|
||||||
'no-param-reassign': 'off',
|
'no-param-reassign': 'off',
|
||||||
@@ -15,6 +18,7 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
singleQuote: true,
|
singleQuote: true,
|
||||||
trailingComma: 'all',
|
trailingComma: 'all',
|
||||||
|
printWidth: 100
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'import/no-extraneous-dependencies': [
|
'import/no-extraneous-dependencies': [
|
||||||
@@ -37,4 +41,39 @@ module.exports = {
|
|||||||
ecmaVersion: 'latest',
|
ecmaVersion: 'latest',
|
||||||
sourceType: 'module',
|
sourceType: 'module',
|
||||||
},
|
},
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['./icons/*.svg'],
|
||||||
|
parser: '@html-eslint/parser',
|
||||||
|
rules: {
|
||||||
|
'prettier/prettier': 'off',
|
||||||
|
'@html-eslint/require-doctype': 'off',
|
||||||
|
'@html-eslint/no-duplicate-attrs': 'error',
|
||||||
|
'@html-eslint/no-inline-styles': 'error',
|
||||||
|
'@html-eslint/require-attrs': [
|
||||||
|
'error',
|
||||||
|
...Object.entries(DEFAULT_ATTRS)
|
||||||
|
.map(([attr, value]) => ({ tag: 'svg', attr, value: String(value) }))
|
||||||
|
],
|
||||||
|
'@html-eslint/indent': ['error', 2],
|
||||||
|
"@html-eslint/no-multiple-empty-lines": ["error", { "max": 0 }],
|
||||||
|
'@html-eslint/no-extra-spacing-attrs': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
enforceBeforeSelfClose: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'@html-eslint/require-closing-tags': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
selfClosing: 'always',
|
||||||
|
allowSelfClosingCustom: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'@html-eslint/element-newline': 'error',
|
||||||
|
'@html-eslint/no-trailing-spaces': 'error',
|
||||||
|
'@html-eslint/quotes': 'error',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
49
.github/ISSUE_TEMPLATE/01_icon_request.yml
vendored
Normal file
49
.github/ISSUE_TEMPLATE/01_icon_request.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
name: Icon request
|
||||||
|
description: Suggest a new icon for this project
|
||||||
|
labels: ['🙌 icon request']
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Before submitting an icon request check if it has already been requested. If there is an open request, please add a 👍.
|
||||||
|
|
||||||
|
**Important note**: No new brand logos are allowed, see https://github.com/lucide-icons/lucide/issues/670.
|
||||||
|
Existing brand icons will also be phased out. For brand icons, consider using https://simpleicons.org, which offers purpose-built SVGs that are also on a 24×24px grid.
|
||||||
|
- type: input
|
||||||
|
id: name
|
||||||
|
attributes:
|
||||||
|
label: Icon name
|
||||||
|
description: What should this icon depict? For multiple icons, provide a comma-separated list.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: use-cases
|
||||||
|
attributes:
|
||||||
|
label: Use cases
|
||||||
|
description: Why do you need this icon? Include at least two real-life use cases per requested icon, avoiding generic descriptions like "it's a car icon".
|
||||||
|
placeholder: e.g. I need a star icon to use in my rating system.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: design-ideas
|
||||||
|
attributes:
|
||||||
|
label: Design ideas
|
||||||
|
description: What should this icon look like? Provide simple, minimalistic icon examples from other sets or your own drafts to help us visualize your request.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: checkboxes
|
||||||
|
id: checklist
|
||||||
|
attributes:
|
||||||
|
label: Checklist
|
||||||
|
description: Please review the following checklist before submitting your request.
|
||||||
|
options:
|
||||||
|
- label: I have searched if someone has submitted a similar issue before and there weren't any. (Please make sure to also search closed issues, as this issue might already have been resolved.)
|
||||||
|
required: true
|
||||||
|
- label: I have searched existing icons to make sure it does not already exist and I didn't find any.
|
||||||
|
required: true
|
||||||
|
- label: I am not requesting a brand logo and the art is not protected by copyright.
|
||||||
|
required: true
|
||||||
|
- label: I am not requesting an icon that includes religious, political imagery or hate symbols.
|
||||||
|
required: true
|
||||||
|
- label: I have provided appropriate use cases for the icon(s) requested.
|
||||||
|
required: true
|
||||||
90
.github/ISSUE_TEMPLATE/02_bug_report.yml
vendored
Normal file
90
.github/ISSUE_TEMPLATE/02_bug_report.yml
vendored
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
name: Bug report
|
||||||
|
description: Create a report to help us improve
|
||||||
|
labels: ['🐛 bug']
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Before reporting an issue, please search to see if someone has filed a similar issue before. If there is already an open issue, please add a 👍 and/or leave a comment with additional information.
|
||||||
|
- type: checkboxes
|
||||||
|
id: packages
|
||||||
|
attributes:
|
||||||
|
label: Package
|
||||||
|
description: Which Lucide packages are affected? You may select more than one.
|
||||||
|
options:
|
||||||
|
- label: lucide
|
||||||
|
- label: lucide-angular
|
||||||
|
- label: lucide-flutter
|
||||||
|
- label: lucide-preact
|
||||||
|
- label: lucide-react
|
||||||
|
- label: lucide-react-native
|
||||||
|
- label: lucide-solid
|
||||||
|
- label: lucide-svelte
|
||||||
|
- label: lucide-vue
|
||||||
|
- label: lucide-vue-next
|
||||||
|
- label: Figma plugin
|
||||||
|
- label: source/main
|
||||||
|
- label: other/not relevant
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
id: version
|
||||||
|
attributes:
|
||||||
|
label: Version
|
||||||
|
description: What version of Lucide are you running?
|
||||||
|
placeholder: e.g. 0.289.1
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: checkboxes
|
||||||
|
id: browsers
|
||||||
|
attributes:
|
||||||
|
label: Browser
|
||||||
|
description: In which browser(s) are you experiencing the issue? You may select more than one.
|
||||||
|
options:
|
||||||
|
- label: Chrome/Chromium
|
||||||
|
- label: Firefox
|
||||||
|
- label: Safari
|
||||||
|
- label: Edge
|
||||||
|
- label: iOS Safari
|
||||||
|
- label: Opera
|
||||||
|
- label: Other/not relevant
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: checkboxes
|
||||||
|
id: operating-systems
|
||||||
|
attributes:
|
||||||
|
label: Operating system
|
||||||
|
description: In which operating systems a you experiencing the issue? You may select more than one.
|
||||||
|
options:
|
||||||
|
- label: Windows
|
||||||
|
- label: Linux
|
||||||
|
- label: macOS
|
||||||
|
- label: Other/not relevant
|
||||||
|
- type: textarea
|
||||||
|
id: description
|
||||||
|
attributes:
|
||||||
|
label: Description
|
||||||
|
description: Try to describe in detail the problem you're running into and provide additional context about your working environment if necessary.
|
||||||
|
placeholder: e.g. When I do X, Y happens instead of Z
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: steps-to-reproduce
|
||||||
|
attributes:
|
||||||
|
label: Steps to reproduce
|
||||||
|
description: Please provide a detailed guide on how this issue can be reproduced or a live example with a working reproduction on Codesandbox, JSFiddle or similar.
|
||||||
|
placeholder: |
|
||||||
|
1. Import `check` icon
|
||||||
|
2. Add to a React component/view
|
||||||
|
3. Run the react app
|
||||||
|
4. Notice that the `check` isn't rendering correctly which seems a encoding problem
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: checkboxes
|
||||||
|
id: checklist
|
||||||
|
attributes:
|
||||||
|
label: Checklist
|
||||||
|
description: Please review the following checklist before submitting your issue.
|
||||||
|
options:
|
||||||
|
- label: I have searched if someone has submitted a similar issue before and there weren't any. (Please make sure to also search closed issues, as this issue might already have been resolved.)
|
||||||
|
required: true
|
||||||
62
.github/ISSUE_TEMPLATE/03_bug_report_site.yml
vendored
Normal file
62
.github/ISSUE_TEMPLATE/03_bug_report_site.yml
vendored
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
name: lucide.dev bug report
|
||||||
|
description: Help us improve the Lucide site
|
||||||
|
labels: ['🐛 bug', '🌍 site']
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Before reporting an issue, please search to see if someone has filed a similar issue before. If there is already an open issue, please add a 👍 and/or leave a comment with additional information.
|
||||||
|
- type: checkboxes
|
||||||
|
id: browsers
|
||||||
|
attributes:
|
||||||
|
label: Browser
|
||||||
|
description: In which browser(s) are you experiencing the issue? You may select more than one.
|
||||||
|
options:
|
||||||
|
- label: Chrome/Chromium
|
||||||
|
- label: Firefox
|
||||||
|
- label: Safari
|
||||||
|
- label: Edge
|
||||||
|
- label: iOS Safari
|
||||||
|
- label: Opera
|
||||||
|
- label: Other/not relevant
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: checkboxes
|
||||||
|
id: operating-systems
|
||||||
|
attributes:
|
||||||
|
label: Operating system
|
||||||
|
description: In which operating systems are you experiencing the issue? You may select more than one.
|
||||||
|
options:
|
||||||
|
- label: Windows
|
||||||
|
- label: Linux
|
||||||
|
- label: macOS
|
||||||
|
- label: Other/not relevant
|
||||||
|
- type: textarea
|
||||||
|
id: description
|
||||||
|
attributes:
|
||||||
|
label: Description
|
||||||
|
description: Try to describe in detail the problem you're running into and provide additional context about your working environment if necessary.
|
||||||
|
placeholder: e.g. When I do X, Y happens instead of Z
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: stepsToReproduce
|
||||||
|
attributes:
|
||||||
|
label: Steps to reproduce
|
||||||
|
description: Please provide a detailed guide on how this issue can be reproduced.
|
||||||
|
placeholder: |
|
||||||
|
1. I click on an icon
|
||||||
|
2. I click on `Copy SVG` in the drawer
|
||||||
|
3. I paste from the clipboard
|
||||||
|
4. A base64 encoded data URI is inserted.
|
||||||
|
...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: checkboxes
|
||||||
|
id: checklist
|
||||||
|
attributes:
|
||||||
|
label: Checklist
|
||||||
|
description: Please review the following checklist before submitting your issue.
|
||||||
|
options:
|
||||||
|
- label: I have searched if someone has submitted a similar issue before and there weren't any. (Please make sure to also search closed issues, as this issue might already have been resolved.)
|
||||||
|
required: true
|
||||||
53
.github/ISSUE_TEMPLATE/04_feature_request.yml
vendored
Normal file
53
.github/ISSUE_TEMPLATE/04_feature_request.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
name: Feature request
|
||||||
|
description: Share with us your ideas on how Lucide could be improved upon.
|
||||||
|
labels: ['💡 idea']
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Before submitting a new feature request, please search to see if someone has filed a similar request before. If there is already an open issue, please add a 👍 and/or leave a comment with additional information.
|
||||||
|
- type: checkboxes
|
||||||
|
id: packages
|
||||||
|
attributes:
|
||||||
|
label: Package
|
||||||
|
description: Which Lucide project do you wish this feature were added to? You may select more than one.
|
||||||
|
options:
|
||||||
|
- label: lucide
|
||||||
|
- label: lucide-angular
|
||||||
|
- label: lucide-flutter
|
||||||
|
- label: lucide-preact
|
||||||
|
- label: lucide-react
|
||||||
|
- label: lucide-react-native
|
||||||
|
- label: lucide-solid
|
||||||
|
- label: lucide-svelte
|
||||||
|
- label: lucide-vue
|
||||||
|
- label: lucide-vue-next
|
||||||
|
- label: Figma plugin
|
||||||
|
- label: all JS packages
|
||||||
|
- label: site
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: description
|
||||||
|
attributes:
|
||||||
|
label: Description
|
||||||
|
description: Try to describe in detail the feature you wish existed.
|
||||||
|
placeholder: e.g. I want to be able to set extra CSS classes on icon components.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: use-cases
|
||||||
|
attributes:
|
||||||
|
label: Use cases
|
||||||
|
description: Why do you need this feature? Provide real-life use cases as to why this feature will be useful for others.
|
||||||
|
placeholder: e.g. I could use the extra classes to add animation or global custom styling to some icons.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: checkboxes
|
||||||
|
id: checklist
|
||||||
|
attributes:
|
||||||
|
label: Checklist
|
||||||
|
description: Please check the following items before submitting your issue.
|
||||||
|
options:
|
||||||
|
- label: I have searched the existing issues to make sure this bug has not already been reported.
|
||||||
|
required: true
|
||||||
68
.github/ISSUE_TEMPLATE/bug_report.md
vendored
68
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,68 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report
|
|
||||||
about: Create a report to help us improve
|
|
||||||
labels: "🐛 bug"
|
|
||||||
---
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Before reporting an issue, please search to see if someone has filed a similar issue before. If there is already an open issue, please add a 👍 and/or leave a comment with additional information.
|
|
||||||
-->
|
|
||||||
|
|
||||||
## Prerequisites
|
|
||||||
|
|
||||||
* Version:
|
|
||||||
* Are you running from source/main:
|
|
||||||
* Are you using a released build:
|
|
||||||
* Operating system:
|
|
||||||
* Bits:
|
|
||||||
|
|
||||||
## Step to reproduce
|
|
||||||
|
|
||||||
*(Type here)*
|
|
||||||
|
|
||||||
### Actual behavior
|
|
||||||
|
|
||||||
## Any message or error
|
|
||||||
|
|
||||||
*(Type here)*
|
|
||||||
|
|
||||||
## Resources
|
|
||||||
|
|
||||||
* Links
|
|
||||||
* Screenshots
|
|
||||||
|
|
||||||
|
|
||||||
Here is what a great bug report would look like:
|
|
||||||
|
|
||||||
```
|
|
||||||
## Prerequisites
|
|
||||||
|
|
||||||
Version: Release v3.1.0
|
|
||||||
Running from: Import using webpack
|
|
||||||
Operating system: Mac OSX
|
|
||||||
Bits: 64 bits
|
|
||||||
|
|
||||||
## Step to reproduce
|
|
||||||
|
|
||||||
- Import `check` icon
|
|
||||||
- Add to a React component/view
|
|
||||||
- Run the react app
|
|
||||||
- Notice that the `check` isn't rendering correctly which seems a encoding problem
|
|
||||||
|
|
||||||
### Actual behavior:
|
|
||||||
|
|
||||||
- Import `check` icon
|
|
||||||
- Add to a React component/view
|
|
||||||
- Run the react app
|
|
||||||
- Check is displayed with correct encoding (e.g UTF-8)
|
|
||||||
|
|
||||||
## Any message or error
|
|
||||||
|
|
||||||
No console output
|
|
||||||
...
|
|
||||||
|
|
||||||
## Resources
|
|
||||||
|
|
||||||
No resources
|
|
||||||
...
|
|
||||||
```
|
|
||||||
18
.github/ISSUE_TEMPLATE/icon_request.md
vendored
18
.github/ISSUE_TEMPLATE/icon_request.md
vendored
@@ -1,18 +0,0 @@
|
|||||||
---
|
|
||||||
name: Icon request
|
|
||||||
about: Suggest an new icon for this project
|
|
||||||
labels: "🙌 icon request"
|
|
||||||
---
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Before creating an icon request, please search to see if someone has requested the icon already. If there is an open request, please add a 👍.
|
|
||||||
A note about brand logos and related material : We follow the decision from Feather Icons (https://github.com/feathericons/feather/issues/763) to deprecate icons relating to brands.
|
|
||||||
You will find some in the set, but we won't add any new ones. https://simpleicons.org has 24x24 SVG icons for this purpose.
|
|
||||||
|
|
||||||
-->
|
|
||||||
|
|
||||||
## Icon Request
|
|
||||||
|
|
||||||
* Icon name:
|
|
||||||
* Use case:
|
|
||||||
* _Screenshots_ of similar icons:
|
|
||||||
15
.github/PULL_REQUEST_TEMPLATE/new-icon.md
vendored
15
.github/PULL_REQUEST_TEMPLATE/new-icon.md
vendored
@@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
name: New icon
|
|
||||||
about: Add a new icon to the library
|
|
||||||
labels: "🎨 <icon"
|
|
||||||
---
|
|
||||||
|
|
||||||
<!-- Thanks for submitting an icon! Please make sure you read the icon design guide
|
|
||||||
at https://github.com/lucide-icons/lucide/blob/main/docs/icon-design-guide.md beforehand,
|
|
||||||
and please fill everything below. -->
|
|
||||||
|
|
||||||
- **Name of the icon** : <!-- `icon` -->
|
|
||||||
- **Tags (alternative names for this icon)** (add them in as a separate json file using the same icon name) :
|
|
||||||
- **What is the purpose of this icon?** : <!-- Shows that one can click it to... / Is used to denote or label... -->
|
|
||||||
- **100% scale preview** : <!-- upload an image -->
|
|
||||||
- **Have you considered alternative possibilities** for its naming or design? :
|
|
||||||
55
.github/pull_request_template.md
vendored
Normal file
55
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<!-- Thank you for contributing! -->
|
||||||
|
|
||||||
|
<!-- Insert `closes #issueNumber` here if merging this PR will resolve an existing issue -->
|
||||||
|
|
||||||
|
## What is the purpose of this pull request?
|
||||||
|
<!-- Please choose one of the following, and put an "x" next to it. -->
|
||||||
|
- [ ] New Icon
|
||||||
|
- [ ] Bug fix
|
||||||
|
- [ ] New Feature
|
||||||
|
- [ ] Documentation update
|
||||||
|
- [ ] Other:
|
||||||
|
|
||||||
|
### Description
|
||||||
|
<!-- Please insert your description here and provide info about the "what" this PR is contribution -->
|
||||||
|
|
||||||
|
### Icon use case <!-- ONLY for new icons, remove this part if not icon PR -->
|
||||||
|
<!-- What is the purpose of this icon? For each icon added, please insert at least two real life use cases (the more the better). Text like "it's a car icon" is not accepted. -->
|
||||||
|
|
||||||
|
### Alternative icon designs <!-- ONLY for new icons, remove this part if not icon PR -->
|
||||||
|
<!-- If you have any alternative icon designs, please attach them here. -->
|
||||||
|
|
||||||
|
## Icon Design Checklist <!-- ONLY for new icons, remove this part if not icon PR -->
|
||||||
|
|
||||||
|
### Concept <!-- ONLY for new icons -->
|
||||||
|
<!-- All of these requirements must be fulfilled. -->
|
||||||
|
- [ ] I have provided valid use cases for each icon.
|
||||||
|
- [ ] I have not added any a brand or logo icon.
|
||||||
|
- [ ] I have not used any hate symbols.
|
||||||
|
- [ ] I have not included any religious or political imagery.
|
||||||
|
|
||||||
|
### Author, credits & license<!-- ONLY for new icons. -->
|
||||||
|
<!-- Please choose one of the following, and put an "x" next to it. -->
|
||||||
|
- [ ] The icons are solely my own creation.
|
||||||
|
- [ ] The icons were originally created in #<issueNumber> by @<githubUser>
|
||||||
|
- [ ] I've based them on the following Lucide icons: <!-- provide the list of icons -->
|
||||||
|
- [ ] I've based them on the following design: <!-- provide source URL and license permitting use -->
|
||||||
|
|
||||||
|
### Naming <!-- ONLY for new icons -->
|
||||||
|
<!-- All of these requirements must be fulfilled. -->
|
||||||
|
- [ ] I've read and followed the [naming conventions](https://lucide.dev/guide/design/icon-design-guide#naming-conventions)
|
||||||
|
- [ ] I've named icons by what they are rather than their use case.
|
||||||
|
- [ ] I've provided meta JSON files in `icons/[iconName].json`.
|
||||||
|
|
||||||
|
### Design <!-- ONLY for new icons -->
|
||||||
|
<!-- All of these requirements must be fulfilled. -->
|
||||||
|
- [ ] I've read and followed the [icon design guidelines](https://lucide.dev/guide/design/icon-design-guide)
|
||||||
|
- [ ] I've made sure that the icons look sharp on low DPI displays.
|
||||||
|
- [ ] I've made sure that the icons look consistent with the icon set in size, optical volume and density.
|
||||||
|
- [ ] I've made sure that the icons are visually centered.
|
||||||
|
- [ ] I've correctly optimized all icons to two points of precision.
|
||||||
|
|
||||||
|
## Before Submitting <!-- For every PR! -->
|
||||||
|
<!-- All of these requirements must be fulfilled. -->
|
||||||
|
- [ ] I've read the [Contribution Guidelines](https://github.com/lucide-icons/lucide/blob/main/CONTRIBUTING.md).
|
||||||
|
- [ ] I've checked if there was an existing PR that solves the same issue.
|
||||||
31
.github/workflows/ci.yml
vendored
31
.github/workflows/ci.yml
vendored
@@ -16,32 +16,16 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
version: 8
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
- uses: pnpm/action-setup@v2.0.1
|
|
||||||
name: Install pnpm
|
|
||||||
id: pnpm-install
|
|
||||||
with:
|
with:
|
||||||
version: 7
|
node-version: 18
|
||||||
run_install: false
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Fetch tags
|
- name: Fetch tags
|
||||||
run: git fetch --all --tags
|
run: git fetch --all --tags
|
||||||
@@ -50,9 +34,6 @@ jobs:
|
|||||||
id: latest-tag
|
id: latest-tag
|
||||||
run: echo "LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT
|
run: echo "LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Check if we can patch
|
- name: Check if we can patch
|
||||||
run: .github/workflows/version-up.sh --minor
|
run: .github/workflows/version-up.sh --minor
|
||||||
|
|
||||||
|
|||||||
25
.github/workflows/linting.yml
vendored
Normal file
25
.github/workflows/linting.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
name: Linting
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- icons/**
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
linting:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
with:
|
||||||
|
version: 8
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Run Linter
|
||||||
|
run: pnpm lint
|
||||||
29
.github/workflows/lucide-angular.yml
vendored
29
.github/workflows/lucide-angular.yml
vendored
@@ -4,6 +4,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/lucide-angular/**
|
- packages/lucide-angular/**
|
||||||
|
- tools/build-icons/**
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -11,32 +12,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
version: 8
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
- uses: pnpm/action-setup@v2.0.1
|
|
||||||
name: Install pnpm
|
|
||||||
id: pnpm-install
|
|
||||||
with:
|
with:
|
||||||
version: 7
|
node-version: 18
|
||||||
run_install: false
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm --filter lucide-angular build
|
run: pnpm --filter lucide-angular build
|
||||||
|
|||||||
37
.github/workflows/lucide-font.yml
vendored
37
.github/workflows/lucide-font.yml
vendored
@@ -4,49 +4,30 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- icons/**
|
- icons/**
|
||||||
|
- tools/build-font/**
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lucide-font:
|
lucide-font:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: ericfennis/lucide-font:latest
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3.4.1
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
version: 8
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
- uses: pnpm/action-setup@v2.0.1
|
|
||||||
name: Install pnpm
|
|
||||||
id: pnpm-install
|
|
||||||
with:
|
with:
|
||||||
version: 7
|
node-version: 18
|
||||||
run_install: false
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --filter outline-svg
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Outline svg Icons
|
- name: Outline svg Icons
|
||||||
run: pnpm build:outline-icons
|
run: pnpm build:outline-icons
|
||||||
|
|
||||||
- name: Create directory
|
- name: Create font in ./lucide-font
|
||||||
run: mkdir lucide-font
|
run: pnpm build:font
|
||||||
|
|
||||||
- name: Build font
|
|
||||||
run: fontcustom compile "./outlined" -h -n "lucide" -o ./lucide-font -F
|
|
||||||
|
|
||||||
- name: "Upload to Artifacts"
|
- name: "Upload to Artifacts"
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
|
|||||||
30
.github/workflows/lucide-preact.yml
vendored
30
.github/workflows/lucide-preact.yml
vendored
@@ -4,6 +4,8 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/lucide-preact/**
|
- packages/lucide-preact/**
|
||||||
|
- tools/build-icons/**
|
||||||
|
- tools/rollup-plugins/**
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -11,32 +13,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
version: 8
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
- uses: pnpm/action-setup@v2.0.1
|
|
||||||
name: Install pnpm
|
|
||||||
id: pnpm-install
|
|
||||||
with:
|
with:
|
||||||
version: 7
|
node-version: 18
|
||||||
run_install: false
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm --filter lucide-preact build
|
run: pnpm --filter lucide-preact build
|
||||||
|
|||||||
30
.github/workflows/lucide-react-native.yml
vendored
30
.github/workflows/lucide-react-native.yml
vendored
@@ -4,6 +4,8 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/lucide-react-native/**
|
- packages/lucide-react-native/**
|
||||||
|
- tools/build-icons/**
|
||||||
|
- tools/rollup-plugins/**
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -11,32 +13,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
version: 8
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
- uses: pnpm/action-setup@v2.0.1
|
|
||||||
name: Install pnpm
|
|
||||||
id: pnpm-install
|
|
||||||
with:
|
with:
|
||||||
version: 7
|
node-version: 18
|
||||||
run_install: false
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm --filter lucide-react-native build
|
run: pnpm --filter lucide-react-native build
|
||||||
|
|||||||
31
.github/workflows/lucide-react.yml
vendored
31
.github/workflows/lucide-react.yml
vendored
@@ -4,6 +4,9 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/lucide-react/**
|
- packages/lucide-react/**
|
||||||
|
- tools/build-icons/**
|
||||||
|
- tools/rollup-plugins/**
|
||||||
|
- scripts/generateNextJSAliases.mjs
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -11,32 +14,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
version: 8
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
- uses: pnpm/action-setup@v2.0.1
|
|
||||||
name: Install pnpm
|
|
||||||
id: pnpm-install
|
|
||||||
with:
|
with:
|
||||||
version: 7
|
node-version: 18
|
||||||
run_install: false
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm --filter lucide-react build
|
run: pnpm --filter lucide-react build
|
||||||
|
|||||||
30
.github/workflows/lucide-solid.yml
vendored
30
.github/workflows/lucide-solid.yml
vendored
@@ -4,6 +4,8 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/lucide-solid/**
|
- packages/lucide-solid/**
|
||||||
|
- tools/build-icons/**
|
||||||
|
- tools/rollup-plugins/**
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -11,32 +13,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
version: 8
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
- uses: pnpm/action-setup@v2.0.1
|
|
||||||
name: Install pnpm
|
|
||||||
id: pnpm-install
|
|
||||||
with:
|
with:
|
||||||
version: 7
|
node-version: 18
|
||||||
run_install: false
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm --filter lucide-solid build
|
run: pnpm --filter lucide-solid build
|
||||||
|
|||||||
29
.github/workflows/lucide-static.yml
vendored
29
.github/workflows/lucide-static.yml
vendored
@@ -4,6 +4,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/lucide-static/**
|
- packages/lucide-static/**
|
||||||
|
- tools/build-icons/**
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -11,32 +12,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
version: 8
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
- uses: pnpm/action-setup@v2.0.1
|
|
||||||
name: Install pnpm
|
|
||||||
id: pnpm-install
|
|
||||||
with:
|
with:
|
||||||
version: 7
|
node-version: 18
|
||||||
run_install: false
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm --filter lucide-static build
|
run: pnpm --filter lucide-static build
|
||||||
|
|||||||
30
.github/workflows/lucide-svelte.yml
vendored
30
.github/workflows/lucide-svelte.yml
vendored
@@ -4,6 +4,8 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/lucide-svelte/**
|
- packages/lucide-svelte/**
|
||||||
|
- tools/build-icons/**
|
||||||
|
- tools/rollup-plugins/**
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -11,32 +13,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
version: 8
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
- uses: pnpm/action-setup@v2.0.1
|
|
||||||
name: Install pnpm
|
|
||||||
id: pnpm-install
|
|
||||||
with:
|
with:
|
||||||
version: 7
|
node-version: 18
|
||||||
run_install: false
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm --filter lucide-svelte build
|
run: pnpm --filter lucide-svelte build
|
||||||
|
|||||||
30
.github/workflows/lucide-vue-next.yml
vendored
30
.github/workflows/lucide-vue-next.yml
vendored
@@ -4,6 +4,8 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/lucide-vue-next/**
|
- packages/lucide-vue-next/**
|
||||||
|
- tools/build-icons/**
|
||||||
|
- tools/rollup-plugins/**
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -11,32 +13,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
version: 8
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
- uses: pnpm/action-setup@v2.0.1
|
|
||||||
name: Install pnpm
|
|
||||||
id: pnpm-install
|
|
||||||
with:
|
with:
|
||||||
version: 7
|
node-version: 18
|
||||||
run_install: false
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm --filter lucide-vue-next build
|
run: pnpm --filter lucide-vue-next build
|
||||||
|
|||||||
30
.github/workflows/lucide-vue.yml
vendored
30
.github/workflows/lucide-vue.yml
vendored
@@ -4,6 +4,8 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/lucide-vue/**
|
- packages/lucide-vue/**
|
||||||
|
- tools/build-icons/**
|
||||||
|
- tools/rollup-plugins/**
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -11,32 +13,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
version: 8
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
- uses: pnpm/action-setup@v2.0.1
|
|
||||||
name: Install pnpm
|
|
||||||
id: pnpm-install
|
|
||||||
with:
|
with:
|
||||||
version: 7
|
node-version: 18
|
||||||
run_install: false
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm --filter lucide-vue build
|
run: pnpm --filter lucide-vue build
|
||||||
|
|||||||
30
.github/workflows/lucide.yml
vendored
30
.github/workflows/lucide.yml
vendored
@@ -4,6 +4,8 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- packages/lucide/**
|
- packages/lucide/**
|
||||||
|
- tools/build-icons/**
|
||||||
|
- tools/rollup-plugins/**
|
||||||
- pnpm-lock.yaml
|
- pnpm-lock.yaml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -11,32 +13,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
version: 8
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
- uses: pnpm/action-setup@v2.0.1
|
|
||||||
name: Install pnpm
|
|
||||||
id: pnpm-install
|
|
||||||
with:
|
with:
|
||||||
version: 7
|
node-version: 18
|
||||||
run_install: false
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm --filter lucide build
|
run: pnpm --filter lucide build
|
||||||
|
|||||||
135
.github/workflows/pull-request.yml
vendored
135
.github/workflows/pull-request.yml
vendored
@@ -4,14 +4,65 @@ on:
|
|||||||
pull_request_target:
|
pull_request_target:
|
||||||
paths:
|
paths:
|
||||||
- 'icons/*.svg'
|
- 'icons/*.svg'
|
||||||
|
branches:
|
||||||
permissions:
|
- main
|
||||||
pull-requests: write
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
add-changed-icons-comment:
|
lint-contributors:
|
||||||
|
if: github.repository == 'lucide-icons/lucide'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
||||||
|
- name: Get changed files
|
||||||
|
id: changed-files
|
||||||
|
uses: tj-actions/changed-files@v35
|
||||||
|
with:
|
||||||
|
files: icons/*
|
||||||
|
- uses: actions/setup-node@v3.8.1
|
||||||
|
- name: Install simple-git (safer and faster than installing all deps)
|
||||||
|
run: npm install simple-git
|
||||||
|
- name: Generate annotations
|
||||||
|
run: node ./scripts/updateContributors.mjs
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
FETCH_DEPTH: ${{ github.event.pull_request.commits }}
|
||||||
|
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
|
||||||
|
- name: Generate annotations
|
||||||
|
env:
|
||||||
|
ANNOTATION_SEVERITY: notice
|
||||||
|
ANNOTATION_TITLE: Contributors have changed!
|
||||||
|
ANNOTATION_DESCRIPTION: Don't add people who have only performed automatic optimizations.
|
||||||
|
run: |
|
||||||
|
git diff --unified=0 -- icons/*.json | # diff icon metadata (unified=0 gives the correct chunk line number)
|
||||||
|
perl -ne '/^(\+|- |@)/ && print' | # get chunks (lines that start with "+++", "@@", "+ ", "- ")
|
||||||
|
perl -pe 's/\n/%0A/' | # url encode line breaks (\n -> %0A)
|
||||||
|
perl -pe 's/%0A(\+\+\+ b\/)/\n\1/g' | # split chunks(one chunk per line)
|
||||||
|
perl -pe "s/\+\+\+ b\/([^@]*)%0A@@ -(\d+)[^\s]* \+(\d+)[^@]*@@(.*)/::$ANNOTATION_SEVERITY file=\1,line=\2,endLine=\3,title=$ANNOTATION_TITLE::$ANNOTATION_DESCRIPTION%0A\4/"
|
||||||
|
# Example for the previous substitution
|
||||||
|
# input: +++ b/icons/accessibility.json%0A@@ -2,0 +3 @@%0A+ "contributors": ["hi"],%0A@@ -13 +14 @@%0A+}%0A
|
||||||
|
# output: ::$ANNOTATION_SEVERITY file=icons/accessibility.json,line=2,endLine=3,title=$ANNOTATION_TITLE::$ANNOTATION_DESCRIPTION%0A%0A+ "contributors": ["hi"],%0A@@ -13 +14 @@%0A+}%0A
|
||||||
|
# - name: Fail if contributors have changed
|
||||||
|
# run: git diff --exit-code -- icons/*.json
|
||||||
|
|
||||||
|
generate-changed-icons-comment-data:
|
||||||
|
if: github.repository == 'lucide-icons/lucide'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
outputs:
|
||||||
|
generate-1px-stroke-width: ${{ steps.generate-1px-stroke-width.outputs.body }}
|
||||||
|
generate-2px-stroke-width: ${{ steps.generate-2px-stroke-width.outputs.body }}
|
||||||
|
generate-3px-stroke-width: ${{ steps.generate-3px-stroke-width.outputs.body }}
|
||||||
|
generate-24px-dpi-preview: ${{ steps.generate-24px-dpi-preview.outputs.body }}
|
||||||
|
generate-cohesion-check-random: ${{ steps.generate-cohesion-check-random.outputs.body }}
|
||||||
|
generate-cohesion-check-squares: ${{ steps.generate-cohesion-check-squares.outputs.body }}
|
||||||
|
generate-x-rays: ${{ steps.generate-x-rays.outputs.body }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
@@ -22,8 +73,26 @@ jobs:
|
|||||||
uses: tj-actions/changed-files@v35
|
uses: tj-actions/changed-files@v35
|
||||||
with:
|
with:
|
||||||
files: icons/*.svg
|
files: icons/*.svg
|
||||||
|
- name: Generate 24px dpi preview
|
||||||
|
id: generate-24px-dpi-preview
|
||||||
|
env:
|
||||||
|
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
|
||||||
|
run: |
|
||||||
|
delimiter="$(openssl rand -hex 8)"
|
||||||
|
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
||||||
|
while IFS= read -r file; do
|
||||||
|
cat "$file" | # get file content
|
||||||
|
tr '\n' ' ' | # remove line breaks
|
||||||
|
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element
|
||||||
|
base64 -w 0 | # encode svg
|
||||||
|
sed "s|.*|<img title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/dpi/24/&.svg\"/> |"
|
||||||
|
done <<< "$CHANGED_FILES" | tr '\n' ' ' >> $GITHUB_OUTPUT
|
||||||
|
echo >> $GITHUB_OUTPUT
|
||||||
|
echo "$delimiter" >> $GITHUB_OUTPUT
|
||||||
- name: Generate cohesion check random
|
- name: Generate cohesion check random
|
||||||
id: generate-cohesion-check-random
|
id: generate-cohesion-check-random
|
||||||
|
env:
|
||||||
|
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
|
||||||
run: |
|
run: |
|
||||||
delimiter="$(openssl rand -hex 8)"
|
delimiter="$(openssl rand -hex 8)"
|
||||||
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
||||||
@@ -33,11 +102,13 @@ jobs:
|
|||||||
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element
|
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element
|
||||||
base64 -w 0 | # encode svg
|
base64 -w 0 | # encode svg
|
||||||
sed "s|.*|<img title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/stroke-width/2/&.svg\"/> |"
|
sed "s|.*|<img title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/stroke-width/2/&.svg\"/> |"
|
||||||
done | tr '\n' ' ' >> $GITHUB_OUTPUT
|
done <<< "$CHANGED_FILES" | tr '\n' ' ' >> $GITHUB_OUTPUT
|
||||||
echo >> $GITHUB_OUTPUT
|
echo >> $GITHUB_OUTPUT
|
||||||
echo "$delimiter" >> $GITHUB_OUTPUT
|
echo "$delimiter" >> $GITHUB_OUTPUT
|
||||||
- name: Generate cohesion check squares
|
- name: Generate cohesion check squares
|
||||||
id: generate-cohesion-check-squares
|
id: generate-cohesion-check-squares
|
||||||
|
env:
|
||||||
|
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
|
||||||
run: |
|
run: |
|
||||||
delimiter="$(openssl rand -hex 8)"
|
delimiter="$(openssl rand -hex 8)"
|
||||||
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
||||||
@@ -47,35 +118,39 @@ jobs:
|
|||||||
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element
|
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element
|
||||||
base64 -w 0 | # encode svg
|
base64 -w 0 | # encode svg
|
||||||
sed "s|.*|<img title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/stroke-width/2/&.svg\"/> |"
|
sed "s|.*|<img title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/stroke-width/2/&.svg\"/> |"
|
||||||
done | tr '\n' ' ' >> $GITHUB_OUTPUT
|
done <<< "$CHANGED_FILES" | tr '\n' ' ' >> $GITHUB_OUTPUT
|
||||||
echo >> $GITHUB_OUTPUT
|
echo >> $GITHUB_OUTPUT
|
||||||
echo "$delimiter" >> $GITHUB_OUTPUT
|
echo "$delimiter" >> $GITHUB_OUTPUT
|
||||||
- name: Generate 1px stroke-width
|
- name: Generate 1px stroke-width
|
||||||
id: generate-1px-stroke-width
|
id: generate-1px-stroke-width
|
||||||
|
env:
|
||||||
|
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
|
||||||
run: |
|
run: |
|
||||||
delimiter="$(openssl rand -hex 8)"
|
delimiter="$(openssl rand -hex 8)"
|
||||||
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
||||||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
while IFS= read -r file; do
|
||||||
cat "$file" | # get file content
|
cat "$file" | # get file content
|
||||||
tr '\n' ' ' | # remove line breaks
|
tr '\n' ' ' | # remove line breaks
|
||||||
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element
|
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element
|
||||||
base64 -w 0 | # encode svg
|
base64 -w 0 | # encode svg
|
||||||
sed "s|.*|<img title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/stroke-width/1/&.svg\"/> |"
|
sed "s|.*|<img title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/stroke-width/1/&.svg\"/> |"
|
||||||
done | tr '\n' ' ' >> $GITHUB_OUTPUT
|
done <<< "$CHANGED_FILES" | tr '\n' ' ' >> $GITHUB_OUTPUT
|
||||||
echo >> $GITHUB_OUTPUT
|
echo >> $GITHUB_OUTPUT
|
||||||
echo "$delimiter" >> $GITHUB_OUTPUT
|
echo "$delimiter" >> $GITHUB_OUTPUT
|
||||||
- name: Generate 2px stroke-width
|
- name: Generate 2px stroke-width
|
||||||
id: generate-2px-stroke-width
|
id: generate-2px-stroke-width
|
||||||
|
env:
|
||||||
|
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
|
||||||
run: |
|
run: |
|
||||||
delimiter="$(openssl rand -hex 8)"
|
delimiter="$(openssl rand -hex 8)"
|
||||||
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
||||||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
while IFS= read -r file; do
|
||||||
cat "$file" | # get file content
|
cat "$file" | # get file content
|
||||||
tr '\n' ' ' | # remove line breaks
|
tr '\n' ' ' | # remove line breaks
|
||||||
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element
|
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element
|
||||||
base64 -w 0 | # encode svg
|
base64 -w 0 | # encode svg
|
||||||
sed "s|.*|<img title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/stroke-width/2/&.svg\"/> |"
|
sed "s|.*|<img title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/stroke-width/2/&.svg\"/> |"
|
||||||
done | tr '\n' ' ' >> $GITHUB_OUTPUT
|
done <<< "$CHANGED_FILES" | tr '\n' ' ' >> $GITHUB_OUTPUT
|
||||||
echo >> $GITHUB_OUTPUT
|
echo >> $GITHUB_OUTPUT
|
||||||
echo "$delimiter" >> $GITHUB_OUTPUT
|
echo "$delimiter" >> $GITHUB_OUTPUT
|
||||||
- name: Generate 3px stroke-width
|
- name: Generate 3px stroke-width
|
||||||
@@ -83,29 +158,39 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
delimiter="$(openssl rand -hex 8)"
|
delimiter="$(openssl rand -hex 8)"
|
||||||
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
||||||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
while IFS= read -r file; do
|
||||||
cat "$file" | # get file content
|
cat "$file" | # get file content
|
||||||
tr '\n' ' ' | # remove line breaks
|
tr '\n' ' ' | # remove line breaks
|
||||||
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element
|
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element
|
||||||
base64 -w 0 | # encode svg
|
base64 -w 0 | # encode svg
|
||||||
sed "s|.*|<img title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/stroke-width/3/&.svg\"/> |"
|
sed "s|.*|<img title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/stroke-width/3/&.svg\"/> |"
|
||||||
done | tr '\n' ' ' >> $GITHUB_OUTPUT
|
done <<< "$CHANGED_FILES" | tr '\n' ' ' >> $GITHUB_OUTPUT
|
||||||
echo >> $GITHUB_OUTPUT
|
echo >> $GITHUB_OUTPUT
|
||||||
echo "$delimiter" >> $GITHUB_OUTPUT
|
echo "$delimiter" >> $GITHUB_OUTPUT
|
||||||
- name: Generate X-rays
|
- name: Generate X-rays
|
||||||
id: generate-x-rays
|
id: generate-x-rays
|
||||||
|
env:
|
||||||
|
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
|
||||||
run: |
|
run: |
|
||||||
delimiter="$(openssl rand -hex 8)"
|
delimiter="$(openssl rand -hex 8)"
|
||||||
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
||||||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
while IFS= read -r file; do
|
||||||
cat "$file" | # get file content
|
cat "$file" | # get file content
|
||||||
tr '\n' ' ' | # remove line breaks
|
tr '\n' ' ' | # remove line breaks
|
||||||
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element
|
sed -e 's/<svg[^>]*>/<svg>/g' | # remove attributes from svg element
|
||||||
base64 -w 0 | # encode svg
|
base64 -w 0 | # encode svg
|
||||||
sed "s|.*|<img width=\"400\" title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/$(basename ${file//\.svg/})/&.svg\"/> |"
|
sed "s|.*|<img width=\"400\" title=\"$file\" alt=\"$file\" src=\"https://lucide.dev/api/gh-icon/$(basename ${file//\.svg/})/&.svg\"/> |"
|
||||||
done | tr '\n' ' ' >> $GITHUB_OUTPUT
|
done <<< "$CHANGED_FILES" | tr '\n' ' ' >> $GITHUB_OUTPUT
|
||||||
echo >> $GITHUB_OUTPUT
|
echo >> $GITHUB_OUTPUT
|
||||||
echo "$delimiter" >> $GITHUB_OUTPUT
|
echo "$delimiter" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
add-changed-icons-comment:
|
||||||
|
if: github.repository == 'lucide-icons/lucide'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
needs: [generate-changed-icons-comment-data]
|
||||||
|
steps:
|
||||||
- name: Find Comment
|
- name: Find Comment
|
||||||
uses: peter-evans/find-comment@v2
|
uses: peter-evans/find-comment@v2
|
||||||
id: fc
|
id: fc
|
||||||
@@ -120,21 +205,25 @@ jobs:
|
|||||||
issue-number: ${{ github.event.pull_request.number }}
|
issue-number: ${{ github.event.pull_request.number }}
|
||||||
body: |
|
body: |
|
||||||
### Added or changed icons
|
### Added or changed icons
|
||||||
${{ steps.generate-2px-stroke-width.outputs.body }}<br/>
|
${{ needs.generate-changed-icons-comment-data.outputs.generate-2px-stroke-width }}<br/>
|
||||||
<details>
|
<details>
|
||||||
<summary>Preview cohesion</summary>
|
<summary>Preview cohesion</summary>
|
||||||
${{ steps.generate-cohesion-check-squares.outputs.body }}<br/>
|
${{ needs.generate-changed-icons-comment-data.outputs.generate-cohesion-check-squares }}<br/>
|
||||||
${{ steps.generate-2px-stroke-width.outputs.body }}<br/>
|
${{ needs.generate-changed-icons-comment-data.outputs.generate-2px-stroke-width }}<br/>
|
||||||
${{ steps.generate-cohesion-check-random.outputs.body }}<br/>
|
${{ needs.generate-changed-icons-comment-data.outputs.generate-cohesion-check-random }}<br/>
|
||||||
</details>
|
</details>
|
||||||
<details>
|
<details>
|
||||||
<summary>Preview stroke widths</summary>
|
<summary>Preview stroke widths</summary>
|
||||||
${{ steps.generate-1px-stroke-width.outputs.body }}<br/>
|
${{ needs.generate-changed-icons-comment-data.outputs.generate-1px-stroke-width }}<br/>
|
||||||
${{ steps.generate-2px-stroke-width.outputs.body }}<br/>
|
${{ needs.generate-changed-icons-comment-data.outputs.generate-2px-stroke-width }}<br/>
|
||||||
${{ steps.generate-3px-stroke-width.outputs.body }}<br/>
|
${{ needs.generate-changed-icons-comment-data.outputs.generate-3px-stroke-width }}<br/>
|
||||||
|
</details>
|
||||||
|
<details>
|
||||||
|
<summary>DPI Preview (24px)</summary>
|
||||||
|
${{ needs.generate-changed-icons-comment-data.outputs.generate-24px-dpi-preview }}
|
||||||
</details>
|
</details>
|
||||||
<details>
|
<details>
|
||||||
<summary>Icon X-rays</summary>
|
<summary>Icon X-rays</summary>
|
||||||
${{ steps.generate-x-rays.outputs.body }}
|
${{ needs.generate-changed-icons-comment-data.outputs.generate-x-rays }}
|
||||||
</details>
|
</details>
|
||||||
edit-mode: replace
|
edit-mode: replace
|
||||||
|
|||||||
88
.github/workflows/release.yml
vendored
88
.github/workflows/release.yml
vendored
@@ -39,6 +39,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: pre-release
|
needs: pre-release
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
package: [
|
package: [
|
||||||
'lucide',
|
'lucide',
|
||||||
@@ -53,29 +54,13 @@ jobs:
|
|||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
with:
|
||||||
|
version: 8
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
|
cache: 'pnpm'
|
||||||
- uses: pnpm/action-setup@v2.0.1
|
|
||||||
name: Install pnpm
|
|
||||||
id: pnpm-install
|
|
||||||
with:
|
|
||||||
version: 7
|
|
||||||
run_install: false
|
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
@@ -102,30 +87,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/download-artifact@v2
|
- uses: actions/download-artifact@v2
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
with:
|
||||||
|
version: 8
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 18
|
||||||
|
cache: 'pnpm'
|
||||||
- uses: pnpm/action-setup@v2.0.1
|
|
||||||
name: Install pnpm
|
|
||||||
id: pnpm-install
|
|
||||||
with:
|
|
||||||
version: 7
|
|
||||||
run_install: false
|
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
@@ -149,44 +117,24 @@ jobs:
|
|||||||
if: github.repository == 'lucide-icons/lucide'
|
if: github.repository == 'lucide-icons/lucide'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: pre-release
|
needs: pre-release
|
||||||
container: ericfennis/lucide-font:latest
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3.4.1
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
version: 8
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
- uses: pnpm/action-setup@v2.0.1
|
|
||||||
name: Install pnpm
|
|
||||||
id: pnpm-install
|
|
||||||
with:
|
with:
|
||||||
version: 7
|
node-version: 18
|
||||||
run_install: false
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
id: pnpm-cache
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --filter outline-svg
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Outline svg Icons
|
- name: Outline svg Icons
|
||||||
run: pnpm build:outline-icons
|
run: pnpm build:outline-icons
|
||||||
|
|
||||||
- name: Create directory
|
- name: Create font in ./lucide-font
|
||||||
run: mkdir lucide-font
|
run: pnpm build:font
|
||||||
|
|
||||||
- name: Build font
|
|
||||||
run: fontcustom compile "./outlined" -h -n "lucide" -o ./lucide-font -F
|
|
||||||
|
|
||||||
- name: "Upload to Artifacts"
|
- name: "Upload to Artifacts"
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
|
|||||||
8
.vscode/settings.json
vendored
8
.vscode/settings.json
vendored
@@ -3,5 +3,11 @@
|
|||||||
"devs",
|
"devs",
|
||||||
"preact",
|
"preact",
|
||||||
"Preact"
|
"Preact"
|
||||||
]
|
],
|
||||||
|
"eslint.enable": true,
|
||||||
|
"eslint.validate": [
|
||||||
|
"javascript",
|
||||||
|
"svg"
|
||||||
|
],
|
||||||
|
"svg.preview.background": "transparent"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ Here you can find instructions on how to implement the guidelines with different
|
|||||||
|
|
||||||
#### [Adobe Illustrator Guide](https://lucide.dev/docs/illustrator-guide)
|
#### [Adobe Illustrator Guide](https://lucide.dev/docs/illustrator-guide)
|
||||||
|
|
||||||
You can also [download an Adobe Illustrator template](https://lucide.dev/templates/illustrator-template.ai).
|
You can also [download an Adobe Illustrator template](https://github.com/lucide-icons/lucide/blob/main/docs/public/templates/illustrator_template.ai).
|
||||||
|
|
||||||
#### [Inkscape Guide](https://lucide.dev/docs/inkscape-guide)
|
#### [Inkscape Guide](https://lucide.dev/docs/inkscape-guide)
|
||||||
|
|
||||||
|
|||||||
20
README.md
20
README.md
@@ -11,14 +11,14 @@
|
|||||||
|
|
||||||
Community-run fork of [Feather Icons](https://github.com/feathericons/feather), open for anyone to contribute icons.
|
Community-run fork of [Feather Icons](https://github.com/feathericons/feather), open for anyone to contribute icons.
|
||||||
|
|
||||||
It began after growing disaffection with the [Feather Icons](https://github.com/feathericons/feather) project moderation. With over 300+ open issues and over 100+ open PRs, the Feather Icons project has been abandoned. This unfortunately means that hundreds of developers and designers wasted their time contributing to Feather Icons with no chance of PRs being accepted.
|
It began after growing dissatisfaction with the [Feather Icons](https://github.com/feathericons/feather) project moderation. With over 300+ open issues and over 100+ open PRs, the Feather Icons project has been abandoned. This unfortunately means that hundreds of developers and designers wasted their time contributing to Feather Icons with no chance of PRs being accepted.
|
||||||
|
|
||||||
Lucide is trying to expand the icon set as much as possible while staying faithful to the original simplistic design language. We do this as a community of devs and designers and hope that you'll join us!
|
Lucide is trying to expand the icon set as much as possible while staying faithful to the original simplistic design language. We do this as a community of devs and designers and hope that you'll join us!
|
||||||
|
|
||||||
### Why choose Lucide over Feather Icons
|
### Why choose Lucide over Feather Icons
|
||||||
|
|
||||||
- More icons to work with: Lucide already has hundreds of icons more than Feather does.
|
- More icons to work with: Lucide already has hundreds of icons more than Feather does.
|
||||||
- Official librairies and integrations with popular frameworks and design tools.
|
- Official libraries and integrations with popular frameworks and design tools.
|
||||||
- Well maintained code base.
|
- Well maintained code base.
|
||||||
- Active community, regularly growing and improving the set.
|
- Active community, regularly growing and improving the set.
|
||||||
|
|
||||||
@@ -35,7 +35,6 @@ Lucide is trying to expand the icon set as much as possible while staying faithf
|
|||||||
- [Static (svg sprite, font, icons ..)](#static-svg-sprite-font-icons-)
|
- [Static (svg sprite, font, icons ..)](#static-svg-sprite-font-icons-)
|
||||||
- [Figma](#figma)
|
- [Figma](#figma)
|
||||||
- [Laravel](#laravel)
|
- [Laravel](#laravel)
|
||||||
- [Flutter](#flutter)
|
|
||||||
- [Svelte](#svelte)
|
- [Svelte](#svelte)
|
||||||
- [Solid](#solid)
|
- [Solid](#solid)
|
||||||
- [Hyva](#hyva)
|
- [Hyva](#hyva)
|
||||||
@@ -200,16 +199,6 @@ composer require mallardduck/blade-lucide-icons
|
|||||||
|
|
||||||
For more details, see the [documentation](https://github.com/mallardduck/blade-lucide-icons/blob/main/README.md).
|
For more details, see the [documentation](https://github.com/mallardduck/blade-lucide-icons/blob/main/README.md).
|
||||||
|
|
||||||
### Flutter
|
|
||||||
|
|
||||||
Implementation of Lucide icon library for Flutter applications.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
flutter pub add lucide_icons
|
|
||||||
```
|
|
||||||
|
|
||||||
For more details, see the [pub.dev](https://pub.dev/packages/lucide_icons).
|
|
||||||
|
|
||||||
### Svelte
|
### Svelte
|
||||||
|
|
||||||
Implementation of the lucide icon library for Svelte applications.
|
Implementation of the lucide icon library for Svelte applications.
|
||||||
@@ -285,6 +274,9 @@ Thank you to all the people who contributed to Lucide!
|
|||||||
|
|
||||||
## Sponsors
|
## Sponsors
|
||||||
|
|
||||||
|
|
||||||
<a href="https://vercel.com?utm_source=lucide&utm_campaign=oss">
|
<a href="https://vercel.com?utm_source=lucide&utm_campaign=oss">
|
||||||
<img src="/docs/public/vercel.svg" alt="Powered by Vercel" width="200" />
|
<img src="docs/public/vercel.svg" alt="Powered by Vercel" width="200" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
<a href="https://www.digitalocean.com/?refcode=b0877a2caebd&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge"><img src="docs/public/digitalocean.svg" width="200" alt="DigitalOcean Referral Badge" /></a>
|
||||||
|
|||||||
@@ -12,8 +12,10 @@
|
|||||||
},
|
},
|
||||||
"title": "Lucide Icons category schema",
|
"title": "Lucide Icons category schema",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": ["$schema", "icon", "title"],
|
||||||
"properties": {
|
"properties": {
|
||||||
"title": {
|
"$schema": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"description": {
|
"description": {
|
||||||
@@ -22,13 +24,12 @@
|
|||||||
"icon": {
|
"icon": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"title": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"weight": {
|
"weight": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
|
||||||
"title",
|
|
||||||
"icon"
|
|
||||||
],
|
|
||||||
"description": "A JSON Schema for categories defined by Lucide Icons."
|
"description": "A JSON Schema for categories defined by Lucide Icons."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,41 +1,53 @@
|
|||||||
import { eventHandler, setResponseHeader, defaultContentType } from 'h3'
|
import { eventHandler, setResponseHeader, defaultContentType } from 'h3';
|
||||||
import { renderToString, renderToStaticMarkup } from 'react-dom/server'
|
import { renderToString, renderToStaticMarkup } from 'react-dom/server';
|
||||||
import { createElement } from 'react'
|
import { createElement } from 'react';
|
||||||
import SvgPreview from '../../lib/SvgPreview/index.tsx';
|
import SvgPreview from '../../lib/SvgPreview/index.tsx';
|
||||||
import iconNodes from '../../data/iconNodes'
|
import iconNodes from '../../data/iconNodes';
|
||||||
import createLucideIcon from 'lucide-react/src/createLucideIcon'
|
import createLucideIcon from 'lucide-react/src/createLucideIcon';
|
||||||
import Backdrop from '../../lib/SvgPreview/Backdrop.tsx';
|
import Backdrop from '../../lib/SvgPreview/Backdrop.tsx';
|
||||||
|
|
||||||
export default eventHandler((event) => {
|
export default eventHandler((event) => {
|
||||||
const { params } = event.context
|
const { params } = event.context;
|
||||||
|
|
||||||
const [name, svgData] = params.data.split('/');
|
const pathData = params.data.split('/');
|
||||||
const data = svgData.slice(0, -4);
|
const data = pathData.at(-1).slice(0, -4);
|
||||||
|
const [name] = pathData;
|
||||||
|
|
||||||
const src = Buffer.from(data, 'base64').toString('utf8');
|
const src = Buffer.from(data, 'base64').toString('utf8');
|
||||||
|
|
||||||
const children = []
|
const children = [];
|
||||||
|
|
||||||
if (name in iconNodes) {
|
// Finds the longest matching icon to be use as the backdrop.
|
||||||
const iconNode = iconNodes[name]
|
// For `square-dashed-bottom-code` it suggests `square-dashed-bottom-code`.
|
||||||
|
// For `square-dashed-bottom-i-dont-exist` it suggests `square-dashed-bottom`.
|
||||||
|
const backdropName = name
|
||||||
|
.split('-')
|
||||||
|
.map((_, idx, arr) => arr.slice(0, idx + 1).join('-'))
|
||||||
|
.reverse()
|
||||||
|
.find((groupName) => groupName in iconNodes);
|
||||||
|
if (backdropName) {
|
||||||
|
const iconNode = iconNodes[backdropName];
|
||||||
|
|
||||||
const LucideIcon = createLucideIcon(name, iconNode)
|
const LucideIcon = createLucideIcon(backdropName, iconNode);
|
||||||
const svg = renderToStaticMarkup(createElement(LucideIcon))
|
const svg = renderToStaticMarkup(createElement(LucideIcon));
|
||||||
const backdropString = svg.replace(/<svg[^>]*>|<\/svg>/g, '');
|
const backdropString = svg.replace(/<svg[^>]*>|<\/svg>/g, '');
|
||||||
|
|
||||||
children.push(createElement(Backdrop, { backdropString, src }))
|
children.push(
|
||||||
|
createElement(Backdrop, {
|
||||||
|
backdropString,
|
||||||
|
src,
|
||||||
|
color: name in iconNodes ? 'red' : '#777',
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const svg = Buffer.from(
|
const svg = Buffer.from(
|
||||||
// We can't use jsx here, is not supported here by nitro.
|
// We can't use jsx here, is not supported here by nitro.
|
||||||
renderToString(createElement(SvgPreview, {src, showGrid: true}, children)).replace(
|
renderToString(createElement(SvgPreview, { src, showGrid: true }, children))
|
||||||
/>/,
|
|
||||||
'><style>@media screen and (prefers-color-scheme: dark) { svg { stroke: #fff } }</style>'
|
|
||||||
)
|
|
||||||
).toString('utf8');
|
).toString('utf8');
|
||||||
|
|
||||||
defaultContentType(event, 'image/svg+xml')
|
defaultContentType(event, 'image/svg+xml');
|
||||||
setResponseHeader(event, 'Cache-Control', 'public,max-age=31536000')
|
setResponseHeader(event, 'Cache-Control', 'public,max-age=31536000');
|
||||||
|
|
||||||
return svg
|
return svg;
|
||||||
})
|
});
|
||||||
|
|||||||
73
docs/.vitepress/api/gh-icon/dpi/[...data].get.ts
Normal file
73
docs/.vitepress/api/gh-icon/dpi/[...data].get.ts
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
import { eventHandler, setResponseHeader, defaultContentType } from 'h3';
|
||||||
|
import { Resvg, initWasm } from '@resvg/resvg-wasm';
|
||||||
|
import wasm from './loadWasm';
|
||||||
|
|
||||||
|
var initializedResvg = initWasm(wasm);
|
||||||
|
|
||||||
|
export default eventHandler(async (event) => {
|
||||||
|
const { params = {} } = event.context;
|
||||||
|
await initializedResvg;
|
||||||
|
|
||||||
|
const imageSize = 96;
|
||||||
|
const [iconSizeString, svgData] = params.data.split('/');
|
||||||
|
const iconSize = parseInt(iconSizeString, 10);
|
||||||
|
const data = svgData.slice(0, -4);
|
||||||
|
|
||||||
|
const src = Buffer.from(data, 'base64').toString('utf8');
|
||||||
|
const svg = (src.includes('<svg') ? src : `<svg>${src}</svg>`)
|
||||||
|
.replace(/(\r\n|\n|\r)/gm, '')
|
||||||
|
.replace(
|
||||||
|
/<svg[^>]*/,
|
||||||
|
`<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="${iconSize}"
|
||||||
|
height="${iconSize}"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="#fff"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
`
|
||||||
|
);
|
||||||
|
|
||||||
|
const resvg = new Resvg(svg, { background: '#000' });
|
||||||
|
const pngData = resvg.render();
|
||||||
|
const pngBuffer = Buffer.from(pngData.asPng());
|
||||||
|
|
||||||
|
defaultContentType(event, 'image/svg+xml');
|
||||||
|
setResponseHeader(event, 'Cache-Control', 'public,max-age=31536000');
|
||||||
|
|
||||||
|
return `
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="${imageSize}" height="${imageSize}" viewBox="0 0 ${imageSize} ${imageSize}">
|
||||||
|
<style>
|
||||||
|
@media screen and (prefers-color-scheme: light) {
|
||||||
|
#fallback-background { fill: transparent; }
|
||||||
|
}
|
||||||
|
@media screen and (prefers-color-scheme: dark) {
|
||||||
|
#fallback-background { fill: transparent; }
|
||||||
|
rect { fill: #fff; }
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<mask id="mask">
|
||||||
|
<image
|
||||||
|
width="${imageSize}"
|
||||||
|
height="${imageSize}"
|
||||||
|
href="data:image/png;base64,${pngBuffer.toString('base64')}"
|
||||||
|
image-rendering="pixelated"
|
||||||
|
/>
|
||||||
|
</mask>
|
||||||
|
<rect
|
||||||
|
id="fallback-background"
|
||||||
|
width="${imageSize}"
|
||||||
|
height="${imageSize}" ry="${imageSize / 24}"
|
||||||
|
fill="#fff"
|
||||||
|
/>
|
||||||
|
<rect
|
||||||
|
width="${imageSize}"
|
||||||
|
height="${imageSize}"
|
||||||
|
fill="#000"
|
||||||
|
mask="url(#mask)"
|
||||||
|
/>
|
||||||
|
</svg>`;
|
||||||
|
});
|
||||||
15
docs/.vitepress/api/gh-icon/dpi/loadWasm.ts
Normal file
15
docs/.vitepress/api/gh-icon/dpi/loadWasm.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import fs from 'fs';
|
||||||
|
import module from 'node:module';
|
||||||
|
/* WASM_IMPORT */
|
||||||
|
|
||||||
|
let wasm;
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV === 'development') {
|
||||||
|
const require = module.createRequire(import.meta.url);
|
||||||
|
|
||||||
|
wasm = fs.readFileSync(require.resolve('@resvg/resvg-wasm/index_bg.wasm'));
|
||||||
|
} else {
|
||||||
|
wasm = resvg_wasm;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default wasm;
|
||||||
@@ -22,9 +22,18 @@ export default eventHandler((event) => {
|
|||||||
|
|
||||||
const svg = Buffer.from(
|
const svg = Buffer.from(
|
||||||
// We can't use jsx here, is not supported here by nitro.
|
// We can't use jsx here, is not supported here by nitro.
|
||||||
renderToString(createElement(Icon, { strokeWidth })).replace(
|
renderToString(createElement(Icon, { strokeWidth }))
|
||||||
|
.replace(/fill\="none"/, 'fill="#fff"')
|
||||||
|
.replace(
|
||||||
/>/,
|
/>/,
|
||||||
'><style>@media screen and (prefers-color-scheme: dark) { svg { stroke: #fff } }</style>'
|
`><style>
|
||||||
|
@media screen and (prefers-color-scheme: light) {
|
||||||
|
svg { fill: transparent !important; }
|
||||||
|
}
|
||||||
|
@media screen and (prefers-color-scheme: dark) {
|
||||||
|
svg { stroke: #fff; fill: transparent !important; }
|
||||||
|
}
|
||||||
|
</style>`
|
||||||
)
|
)
|
||||||
).toString('utf8');
|
).toString('utf8');
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,6 @@
|
|||||||
import { fileURLToPath, URL } from 'node:url'
|
import { fileURLToPath, URL } from 'node:url'
|
||||||
import path from 'path';
|
|
||||||
import { defineConfig } from 'vitepress'
|
import { defineConfig } from 'vitepress'
|
||||||
import { createWriteStream } from 'node:fs'
|
|
||||||
import { resolve } from 'node:path'
|
|
||||||
import { SitemapStream } from 'sitemap'
|
|
||||||
import sidebar from './sidebar';
|
import sidebar from './sidebar';
|
||||||
import fs from 'fs';
|
|
||||||
|
|
||||||
const links = []
|
|
||||||
|
|
||||||
|
|
||||||
const title = "Lucide";
|
const title = "Lucide";
|
||||||
const socialTitle = "Lucide Icons";
|
const socialTitle = "Lucide Icons";
|
||||||
@@ -20,6 +12,7 @@ export default defineConfig({
|
|||||||
description,
|
description,
|
||||||
cleanUrls: true,
|
cleanUrls: true,
|
||||||
outDir: '.vercel/output/static',
|
outDir: '.vercel/output/static',
|
||||||
|
srcExclude: ['**/README.md'],
|
||||||
vite: {
|
vite: {
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: [
|
alias: [
|
||||||
@@ -111,6 +104,7 @@ export default defineConfig({
|
|||||||
{ text: 'Icons', link: '/icons/' },
|
{ text: 'Icons', link: '/icons/' },
|
||||||
{ text: 'Guide', link: '/guide/' },
|
{ text: 'Guide', link: '/guide/' },
|
||||||
{ text: 'Packages', link: '/packages' },
|
{ text: 'Packages', link: '/packages' },
|
||||||
|
{ text: 'Showcase', link: '/showcase' },
|
||||||
{ text: 'License', link: '/license' },
|
{ text: 'License', link: '/license' },
|
||||||
],
|
],
|
||||||
sidebar,
|
sidebar,
|
||||||
@@ -125,33 +119,12 @@ export default defineConfig({
|
|||||||
editLink: {
|
editLink: {
|
||||||
pattern: 'https://github.com/lucide-icons/lucide/edit/main/docs/:path'
|
pattern: 'https://github.com/lucide-icons/lucide/edit/main/docs/:path'
|
||||||
},
|
},
|
||||||
},
|
carbonAds: {
|
||||||
transformHtml: (_, id, { pageData }) => {
|
code: 'CWYIC53U',
|
||||||
if (/[\\/]404\.html$/.test(id)) {
|
placement: 'lucidedev'
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pageData.relativePath.startsWith('icons/')) {
|
|
||||||
links.push({
|
|
||||||
url: pageData.relativePath.replace(/((^|\/)index)?\.md$/, '$2'),
|
|
||||||
lastmod: pageData?.params?.changedRelease?.date
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
links.push({
|
|
||||||
url: pageData.relativePath.replace(/((^|\/)index)?\.md$/, '$2'),
|
|
||||||
lastmod: pageData.lastUpdated
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
buildEnd: async ({ outDir }) => {
|
sitemap: {
|
||||||
const sitemap = new SitemapStream({
|
|
||||||
hostname: 'https://lucide.dev/'
|
hostname: 'https://lucide.dev/'
|
||||||
})
|
}
|
||||||
const writeStream = createWriteStream(resolve(outDir, 'sitemap.xml'))
|
|
||||||
sitemap.pipe(writeStream)
|
|
||||||
links.forEach((link) => sitemap.write(link))
|
|
||||||
sitemap.end()
|
|
||||||
await new Promise((r) => writeStream.on('finish', r))
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|||||||
50
docs/.vitepress/data/companiesData.json
Normal file
50
docs/.vitepress/data/companiesData.json
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "Vercel",
|
||||||
|
"url": "https://vercel.com",
|
||||||
|
"image": {
|
||||||
|
"light": "/company-logos/vercel-light.svg",
|
||||||
|
"dark": "/company-logos/vercel-dark.svg"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Supabase",
|
||||||
|
"url": "https://supabase.com",
|
||||||
|
"image": {
|
||||||
|
"light": "/company-logos/supabase-light.svg",
|
||||||
|
"dark": "/company-logos/supabase-dark.svg"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Obsidian",
|
||||||
|
"url": "https://obsidian.md",
|
||||||
|
"image": {
|
||||||
|
"light": "/company-logos/obsidian-light.svg",
|
||||||
|
"dark": "/company-logos/obsidian-dark.svg"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Open Collective",
|
||||||
|
"url": "https://opencollective.com",
|
||||||
|
"image": {
|
||||||
|
"light": "/company-logos/open-collective-light.svg",
|
||||||
|
"dark": "/company-logos/open-collective-dark.svg"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Super",
|
||||||
|
"url": "https://super.so",
|
||||||
|
"image": {
|
||||||
|
"light": "/company-logos/super-light.svg",
|
||||||
|
"dark": "/company-logos/super-dark.svg"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Noodle",
|
||||||
|
"url": "https://noodle.run/",
|
||||||
|
"image": {
|
||||||
|
"light": "/company-logos/noodle-light.svg",
|
||||||
|
"dark": "/company-logos/noodle-dark.svg"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
18
docs/.vitepress/data/componentLibrariesData.json
Normal file
18
docs/.vitepress/data/componentLibrariesData.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "Shadcn/ui",
|
||||||
|
"url": "https://ui.shadcn.com/",
|
||||||
|
"image": {
|
||||||
|
"light": "/library-logos/shadcn-ui-light.svg",
|
||||||
|
"dark": "/library-logos/shadcn-ui-dark.svg"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tamagui",
|
||||||
|
"url": "https://tamagui.dev/",
|
||||||
|
"image": {
|
||||||
|
"light": "/library-logos/tamagui.svg",
|
||||||
|
"dark": "/library-logos/tamagui.svg"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
interface BackdropProps {
|
interface BackdropProps {
|
||||||
src: string
|
src: string;
|
||||||
backdropString: string
|
color?: string;
|
||||||
|
backdropString: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Backdrop = ({ src, backdropString }: BackdropProps): JSX.Element => {
|
const Backdrop = ({ src, color = 'red', backdropString }: BackdropProps): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<defs xmlns="http://www.w3.org/2000/svg">
|
<defs xmlns="http://www.w3.org/2000/svg">
|
||||||
@@ -16,8 +17,8 @@ const Backdrop = ({ src, backdropString }: BackdropProps): JSX.Element => {
|
|||||||
patternUnits="userSpaceOnUse"
|
patternUnits="userSpaceOnUse"
|
||||||
patternTransform="rotate(45 50 50)"
|
patternTransform="rotate(45 50 50)"
|
||||||
>
|
>
|
||||||
<line stroke="red" strokeWidth={0.1} y2={1} />
|
<line stroke={color} strokeWidth={0.1} y2={1} />
|
||||||
<line stroke="red" strokeWidth={0.1} y2={1} />
|
<line stroke={color} strokeWidth={0.1} y2={1} />
|
||||||
</pattern>
|
</pattern>
|
||||||
</defs>
|
</defs>
|
||||||
<mask id="svg-preview-backdrop-mask-outline" maskUnits="userSpaceOnUse">
|
<mask id="svg-preview-backdrop-mask-outline" maskUnits="userSpaceOnUse">
|
||||||
@@ -29,20 +30,8 @@ const Backdrop = ({ src, backdropString }: BackdropProps): JSX.Element => {
|
|||||||
<g dangerouslySetInnerHTML={{ __html: src }} strokeWidth={2.05} />
|
<g dangerouslySetInnerHTML={{ __html: src }} strokeWidth={2.05} />
|
||||||
<g strokeWidth={1.75} dangerouslySetInnerHTML={{ __html: backdropString }} />
|
<g strokeWidth={1.75} dangerouslySetInnerHTML={{ __html: backdropString }} />
|
||||||
</mask>
|
</mask>
|
||||||
<g
|
<g strokeWidth={2.25} stroke="url(#pattern)" mask={'url(#svg-preview-backdrop-mask-outline)'}>
|
||||||
strokeWidth={2.25}
|
<rect x="0" y="0" width="24" height="24" fill="url(#pattern)" opacity={0.5} stroke="none" />
|
||||||
stroke="url(#pattern)"
|
|
||||||
mask={'url(#svg-preview-backdrop-mask-outline)'}
|
|
||||||
>
|
|
||||||
<rect
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
width="24"
|
|
||||||
height="24"
|
|
||||||
fill="url(#pattern)"
|
|
||||||
opacity={0.5}
|
|
||||||
stroke="none"
|
|
||||||
/>
|
|
||||||
</g>
|
</g>
|
||||||
<rect
|
<rect
|
||||||
x="0"
|
x="0"
|
||||||
@@ -58,14 +47,13 @@ const Backdrop = ({ src, backdropString }: BackdropProps): JSX.Element => {
|
|||||||
y="0"
|
y="0"
|
||||||
width="24"
|
width="24"
|
||||||
height="24"
|
height="24"
|
||||||
fill="red"
|
fill={color}
|
||||||
opacity={0.5}
|
opacity={0.5}
|
||||||
stroke="none"
|
stroke="none"
|
||||||
mask={'url(#svg-preview-backdrop-mask-fill)'}
|
mask={'url(#svg-preview-backdrop-mask-fill)'}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
export default Backdrop;
|
export default Backdrop;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { getPaths, assert } from './utils';
|
|||||||
|
|
||||||
const Grid = ({
|
const Grid = ({
|
||||||
radius,
|
radius,
|
||||||
fill,
|
fill = '#fff',
|
||||||
...props
|
...props
|
||||||
}: {
|
}: {
|
||||||
strokeWidth: number;
|
strokeWidth: number;
|
||||||
@@ -12,6 +12,7 @@ const Grid = ({
|
|||||||
} & PathProps<'stroke', 'strokeWidth'>) => (
|
} & PathProps<'stroke', 'strokeWidth'>) => (
|
||||||
<g className="svg-preview-grid-group" strokeLinecap="butt" {...props}>
|
<g className="svg-preview-grid-group" strokeLinecap="butt" {...props}>
|
||||||
<rect
|
<rect
|
||||||
|
className="svg-preview-grid-rect"
|
||||||
width={24 - props.strokeWidth}
|
width={24 - props.strokeWidth}
|
||||||
height={24 - props.strokeWidth}
|
height={24 - props.strokeWidth}
|
||||||
x={props.strokeWidth / 2}
|
x={props.strokeWidth / 2}
|
||||||
@@ -198,6 +199,28 @@ const Radii = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const Handles = ({
|
||||||
|
paths,
|
||||||
|
...props
|
||||||
|
}: { paths: Path[] } & PathProps<
|
||||||
|
'strokeWidth' | 'stroke' | 'strokeDasharray' | 'strokeOpacity',
|
||||||
|
any
|
||||||
|
>) => {
|
||||||
|
console.log(paths);
|
||||||
|
return (
|
||||||
|
<g className="svg-preview-handles-group" {...props}>
|
||||||
|
{paths.map(({ c, prev, next, cp1, cp2 }) => (
|
||||||
|
<>
|
||||||
|
{cp1 && <path d={`M${prev.x} ${prev.y} ${cp1.x} ${cp1.y}`} />}
|
||||||
|
{cp1 && <circle cy={cp1.y} cx={cp1.x} r={0.25} />}
|
||||||
|
{cp2 && <path d={`M${next.x} ${next.y} ${cp2.x} ${cp2.y}`} />}
|
||||||
|
{cp2 && <circle cy={cp2.y} cx={cp2.x} r={0.25} />}
|
||||||
|
</>
|
||||||
|
))}
|
||||||
|
</g>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const SvgPreview = React.forwardRef<
|
const SvgPreview = React.forwardRef<
|
||||||
SVGSVGElement,
|
SVGSVGElement,
|
||||||
{
|
{
|
||||||
@@ -207,7 +230,12 @@ const SvgPreview = React.forwardRef<
|
|||||||
>(({ src, children, showGrid = false, ...props }, ref) => {
|
>(({ src, children, showGrid = false, ...props }, ref) => {
|
||||||
const paths = typeof src === 'string' ? getPaths(src) : src;
|
const paths = typeof src === 'string' ? getPaths(src) : src;
|
||||||
|
|
||||||
const darkModeCss = `@media screen and (prefers-color-scheme: dark) {
|
const darkModeCss = `@media screen and (prefers-color-scheme: light) {
|
||||||
|
.svg-preview-grid-rect { fill: none }
|
||||||
|
}
|
||||||
|
@media screen and (prefers-color-scheme: dark) {
|
||||||
|
.svg-preview-grid-rect { fill: none }
|
||||||
|
.svg
|
||||||
.svg-preview-grid-group,
|
.svg-preview-grid-group,
|
||||||
.svg-preview-radii-group,
|
.svg-preview-radii-group,
|
||||||
.svg-preview-shadow-mask-group,
|
.svg-preview-shadow-mask-group,
|
||||||
@@ -232,6 +260,7 @@ const SvgPreview = React.forwardRef<
|
|||||||
<style>{darkModeCss}</style>
|
<style>{darkModeCss}</style>
|
||||||
{showGrid && <Grid strokeWidth={0.1} stroke="#777" strokeOpacity={0.3} radius={1} />}
|
{showGrid && <Grid strokeWidth={0.1} stroke="#777" strokeOpacity={0.3} radius={1} />}
|
||||||
<Shadow paths={paths} strokeWidth={4} stroke="#777" radius={1} strokeOpacity={0.15} />
|
<Shadow paths={paths} strokeWidth={4} stroke="#777" radius={1} strokeOpacity={0.15} />
|
||||||
|
<Handles paths={paths} strokeWidth={0.12} stroke="#777" strokeOpacity={0.6} />
|
||||||
<ColoredPath
|
<ColoredPath
|
||||||
paths={paths}
|
paths={paths}
|
||||||
colors={[
|
colors={[
|
||||||
@@ -257,6 +286,7 @@ const SvgPreview = React.forwardRef<
|
|||||||
strokeOpacity={0.3}
|
strokeOpacity={0.3}
|
||||||
/>
|
/>
|
||||||
<ControlPath radius={1} paths={paths} pointSize={1} stroke="#fff" strokeWidth={0.125} />
|
<ControlPath radius={1} paths={paths} pointSize={1} stroke="#fff" strokeWidth={0.125} />
|
||||||
|
<Handles paths={paths} strokeWidth={0.12} stroke="#FFF" strokeOpacity={0.3} />
|
||||||
{children}
|
{children}
|
||||||
</svg>
|
</svg>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ export type Path = {
|
|||||||
prev: Point;
|
prev: Point;
|
||||||
next: Point;
|
next: Point;
|
||||||
isStart: boolean;
|
isStart: boolean;
|
||||||
circle: { x: number; y: number; r: number };
|
circle?: { x: number; y: number; r: number };
|
||||||
|
cp1?: Point;
|
||||||
|
cp2?: Point;
|
||||||
c: ReturnType<typeof getCommands>[number];
|
c: ReturnType<typeof getCommands>[number];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export const getPaths = (src: string) => {
|
|||||||
c: typeof commands[number],
|
c: typeof commands[number],
|
||||||
next: Point,
|
next: Point,
|
||||||
d?: string,
|
d?: string,
|
||||||
circle?: Path['circle']
|
extras?: { circle?: Path['circle']; cp1?: Path['cp1']; cp2?: Path['cp2'] }
|
||||||
) => {
|
) => {
|
||||||
assert(prev);
|
assert(prev);
|
||||||
paths.push({
|
paths.push({
|
||||||
@@ -71,7 +71,7 @@ export const getPaths = (src: string) => {
|
|||||||
d: d || `M ${prev.x} ${prev.y} L ${next.x} ${next.y}`,
|
d: d || `M ${prev.x} ${prev.y} L ${next.x} ${next.y}`,
|
||||||
prev,
|
prev,
|
||||||
next,
|
next,
|
||||||
circle,
|
...extras,
|
||||||
isStart: start === prev,
|
isStart: start === prev,
|
||||||
});
|
});
|
||||||
prev = next;
|
prev = next;
|
||||||
@@ -110,7 +110,10 @@ export const getPaths = (src: string) => {
|
|||||||
}
|
}
|
||||||
case SVGPathData.CURVE_TO: {
|
case SVGPathData.CURVE_TO: {
|
||||||
assert(prev);
|
assert(prev);
|
||||||
addPath(c, c, `M ${prev.x} ${prev.y} ${encodeSVGPath(c)}`);
|
addPath(c, c, `M ${prev.x} ${prev.y} ${encodeSVGPath(c)}`, {
|
||||||
|
cp1: { x: c.x1, y: c.y1 },
|
||||||
|
cp2: { x: c.x2, y: c.y2 },
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SVGPathData.SMOOTH_CURVE_TO: {
|
case SVGPathData.SMOOTH_CURVE_TO: {
|
||||||
@@ -146,13 +149,20 @@ export const getPaths = (src: string) => {
|
|||||||
y1: prev.y - reflectedCp1.y,
|
y1: prev.y - reflectedCp1.y,
|
||||||
x2: c.x2,
|
x2: c.x2,
|
||||||
y2: c.y2,
|
y2: c.y2,
|
||||||
})}`
|
})}`,
|
||||||
|
{
|
||||||
|
cp1: reflectedCp1,
|
||||||
|
cp2: { x: c.x2, y: c.y2 },
|
||||||
|
}
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SVGPathData.QUAD_TO: {
|
case SVGPathData.QUAD_TO: {
|
||||||
assert(prev);
|
assert(prev);
|
||||||
addPath(c, c, `M ${prev.x} ${prev.y} ${encodeSVGPath(c)}`);
|
addPath(c, c, `M ${prev.x} ${prev.y} ${encodeSVGPath(c)}`, {
|
||||||
|
cp1: { x: c.x1, y: c.y1 },
|
||||||
|
cp2: { x: c.x1, y: c.y1 },
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SVGPathData.SMOOTH_QUAD_TO: {
|
case SVGPathData.SMOOTH_QUAD_TO: {
|
||||||
@@ -197,7 +207,11 @@ export const getPaths = (src: string) => {
|
|||||||
y: c.y,
|
y: c.y,
|
||||||
x1: prevCP.x,
|
x1: prevCP.x,
|
||||||
y1: prevCP.y,
|
y1: prevCP.y,
|
||||||
})}`
|
})}`,
|
||||||
|
{
|
||||||
|
cp1: { x: prevCP.x, y: prevCP.y },
|
||||||
|
cp2: { x: prevCP.x, y: prevCP.y },
|
||||||
|
}
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -218,7 +232,7 @@ export const getPaths = (src: string) => {
|
|||||||
c,
|
c,
|
||||||
c,
|
c,
|
||||||
`M ${prev.x} ${prev.y} A${c.rX} ${c.rY} ${c.xRot} ${c.lArcFlag} ${c.sweepFlag} ${c.x} ${c.y}`,
|
`M ${prev.x} ${prev.y} A${c.rX} ${c.rY} ${c.xRot} ${c.lArcFlag} ${c.sweepFlag} ${c.x} ${c.y}`,
|
||||||
c.rX === c.rY ? { ...center, r: c.rX } : undefined
|
{ circle: c.rX === c.rY ? { ...center, r: c.rX } : undefined }
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,40 +1,28 @@
|
|||||||
import {
|
import {
|
||||||
BUNDLED_LANGUAGES,
|
bundledLanguages,
|
||||||
type IThemeRegistration
|
type ThemeRegistration
|
||||||
} from 'shiki'
|
} from 'shikiji'
|
||||||
import {
|
import {
|
||||||
getHighlighter,
|
getHighlighter,
|
||||||
} from 'shiki-processor'
|
} from 'shikiji'
|
||||||
|
|
||||||
|
|
||||||
type CodeExampleType = {
|
type CodeExampleType = {
|
||||||
title: string,
|
title: string,
|
||||||
lang: string,
|
language: string,
|
||||||
codes: {
|
|
||||||
language?: string,
|
|
||||||
code: string,
|
code: string,
|
||||||
metastring?: string,
|
|
||||||
}[],
|
|
||||||
}[]
|
}[]
|
||||||
|
|
||||||
const getIconCodes = (): CodeExampleType => {
|
const getIconCodes = (): CodeExampleType => {
|
||||||
return [
|
return [
|
||||||
{
|
|
||||||
lang: 'html',
|
|
||||||
title: 'HTML',
|
|
||||||
codes: [
|
|
||||||
{
|
{
|
||||||
language: 'html',
|
language: 'html',
|
||||||
code: `<i data-lucide-name="Name"></i>
|
title: 'HTML',
|
||||||
`,
|
code: `<i data-lucide="Name"></i>`
|
||||||
},
|
},
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
lang: 'tsx',
|
|
||||||
title: 'React',
|
|
||||||
codes: [
|
|
||||||
{
|
{
|
||||||
language: 'tsx',
|
language: 'tsx',
|
||||||
|
title: 'React',
|
||||||
code: `import { PascalCase } from 'lucide-react';
|
code: `import { PascalCase } from 'lucide-react';
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
@@ -45,16 +33,10 @@ const App = () => {
|
|||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
`,
|
`,
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
lang: 'vue',
|
|
||||||
title: 'Vue 3',
|
|
||||||
codes: [
|
|
||||||
{
|
{
|
||||||
language: 'vue',
|
language: 'vue',
|
||||||
|
title: 'Vue',
|
||||||
code: `<script setup>
|
code: `<script setup>
|
||||||
import { PascalCase } from 'lucide-vue-next';
|
import { PascalCase } from 'lucide-vue-next';
|
||||||
</script>
|
</script>
|
||||||
@@ -63,32 +45,20 @@ export default App;
|
|||||||
<PascalCase />
|
<PascalCase />
|
||||||
</template>
|
</template>
|
||||||
`,
|
`,
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
lang: 'svelte',
|
|
||||||
title: 'Svelte',
|
|
||||||
codes: [
|
|
||||||
{
|
{
|
||||||
language: 'svelte',
|
language: 'svelte',
|
||||||
|
title: 'Svelte',
|
||||||
code: `<script>
|
code: `<script>
|
||||||
import { PascalCase } from 'lucide-svelte';
|
import { PascalCase } from 'lucide-svelte';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<PascalCase />
|
<PascalCase />
|
||||||
`,
|
`,
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
lang: 'preact',
|
|
||||||
title: 'Preact',
|
|
||||||
codes: [
|
|
||||||
{
|
{
|
||||||
language: 'tsx',
|
language: 'tsx',
|
||||||
|
title: 'Preact',
|
||||||
code: `import { PascalCase } from 'lucide-preact';
|
code: `import { PascalCase } from 'lucide-preact';
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
@@ -99,16 +69,10 @@ const App = () => {
|
|||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
`,
|
`,
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
lang: 'solid',
|
|
||||||
title: 'Solid',
|
|
||||||
codes: [
|
|
||||||
{
|
{
|
||||||
language: 'tsx',
|
language: 'tsx',
|
||||||
|
title: 'Solid',
|
||||||
code: `import { PascalCase } from 'lucide-solid';
|
code: `import { PascalCase } from 'lucide-solid';
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
@@ -119,16 +83,10 @@ const App = () => {
|
|||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
`,
|
`,
|
||||||
|
|
||||||
},
|
},
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
lang: 'angular',
|
|
||||||
title: 'Angular',
|
|
||||||
codes: [
|
|
||||||
{
|
{
|
||||||
language: 'tsx',
|
language: 'tsx',
|
||||||
|
title: 'Angular',
|
||||||
code: `// app.module.ts
|
code: `// app.module.ts
|
||||||
import { LucideAngularModule, PascalCase } from 'lucide-angular';
|
import { LucideAngularModule, PascalCase } from 'lucide-angular';
|
||||||
|
|
||||||
@@ -142,53 +100,37 @@ import { LucideAngularModule, PascalCase } from 'lucide-angular';
|
|||||||
<lucide-icon name="Name"></lucide-icon>
|
<lucide-icon name="Name"></lucide-icon>
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
lang: 'html',
|
|
||||||
title: 'Icon Font',
|
|
||||||
codes: [
|
|
||||||
{
|
{
|
||||||
language: 'html',
|
language: 'html',
|
||||||
|
title: 'Icon Font',
|
||||||
code: `<style>
|
code: `<style>
|
||||||
@import ('~lucide-static/font/Lucide.css');
|
@import ('~lucide-static/font/Lucide.css');
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="icon-Name"></div>
|
<div class="icon-Name"></div>
|
||||||
`,
|
`,
|
||||||
},
|
}
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
lang: 'dart',
|
|
||||||
title: 'Flutter',
|
|
||||||
codes: [
|
|
||||||
{
|
|
||||||
language: 'dart',
|
|
||||||
code: `Icon(LucideIcons.Name);
|
|
||||||
`,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ThemeOptions =
|
export type ThemeOptions =
|
||||||
| IThemeRegistration
|
| ThemeRegistration
|
||||||
| { light: IThemeRegistration; dark: IThemeRegistration }
|
| { light: ThemeRegistration; dark: ThemeRegistration }
|
||||||
|
|
||||||
const highLightCode = async (code: string, lang: string, active?: boolean) => {
|
const highLightCode = async (code: string, lang: string, active?: boolean) => {
|
||||||
const highlighter = await getHighlighter({
|
const highlighter = await getHighlighter({
|
||||||
themes: ['material-theme-palenight'],
|
themes: ['github-light', 'github-dark'],
|
||||||
langs: [...BUNDLED_LANGUAGES],
|
langs: Object.keys(bundledLanguages)
|
||||||
processors: []
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const highlightedCode = highlighter.codeToHtml(code, {
|
const highlightedCode = highlighter.codeToHtml(code, {
|
||||||
lang,
|
lang,
|
||||||
// lineOptions,
|
themes: {
|
||||||
theme: 'material-theme-palenight'
|
light: 'github-light',
|
||||||
}).replace('background-color: #292D3E', '')
|
dark: 'github-dark'
|
||||||
|
},
|
||||||
|
defaultColor: false
|
||||||
|
}).replace('shiki-themes', 'shiki-themes vp-code')
|
||||||
|
|
||||||
return `<div class="language-${lang} ${active ? 'active' : ''}">
|
return `<div class="language-${lang} ${active ? 'active' : ''}">
|
||||||
<button title="Copy Code" class="copy"></button>
|
<button title="Copy Code" class="copy"></button>
|
||||||
@@ -201,16 +143,15 @@ const highLightCode = async (code: string, lang: string, active?: boolean) => {
|
|||||||
export default async function createCodeExamples() {
|
export default async function createCodeExamples() {
|
||||||
const codes = getIconCodes();
|
const codes = getIconCodes();
|
||||||
|
|
||||||
const codeExamplePromises = codes.map(async (codeTemplate, index) => {
|
const codeExamplePromises = codes.map(async ({ title, language, code }, index) => {
|
||||||
const { title, lang, codes } = codeTemplate;
|
|
||||||
const isFirst = index === 0;
|
const isFirst = index === 0;
|
||||||
|
|
||||||
const code = await highLightCode(codes[0].code, codes[0].language || lang, isFirst);
|
const codeString = await highLightCode(code, language, isFirst);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title,
|
title,
|
||||||
language: codes[0].language || lang,
|
language: language,
|
||||||
code,
|
code: codeString,
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -10,26 +10,49 @@ const sidebar: UserConfig<DefaultTheme.Config>['themeConfig']['sidebar'] = {
|
|||||||
{ text: 'Comparison', link: '/guide/comparison' }
|
{ text: 'Comparison', link: '/guide/comparison' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
text: 'Basics',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
text: 'Color',
|
||||||
|
link: '/guide/basics/color'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Sizing',
|
||||||
|
link: '/guide/basics/sizing'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Stroke width',
|
||||||
|
link: '/guide/basics/stroke-width'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
// TODO: Add this section
|
||||||
// {
|
// {
|
||||||
// text: 'Using Icons',
|
// text: 'Advanced',
|
||||||
// items: [
|
// items: [
|
||||||
// {
|
// {
|
||||||
// text: 'How to use icons',
|
|
||||||
// link: 'how-to-use-icons'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// text: 'Styling icons',
|
|
||||||
// link: 'styling-icons'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// text: 'Accessibility',
|
// text: 'Accessibility',
|
||||||
// link: 'accessibility'
|
// link: '/guide/advanced/accessibility'
|
||||||
// },
|
// },
|
||||||
// {
|
// {
|
||||||
// text: 'What should I use',
|
// text: 'Global styling',
|
||||||
// link: 'what-should-i-use'
|
|
||||||
// },
|
// },
|
||||||
|
// {
|
||||||
|
// text: 'Animations',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// text: 'Filled icons',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// text: 'Combining icons',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// text: 'Dynamic imports'
|
||||||
|
// },
|
||||||
|
// // {
|
||||||
|
// // text: 'Auto importing'
|
||||||
|
// // },
|
||||||
// ]
|
// ]
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
@@ -103,15 +126,9 @@ const sidebar: UserConfig<DefaultTheme.Config>['themeConfig']['sidebar'] = {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
// This should be here to keep the sidebar shown on the icons page
|
||||||
'icons': [
|
'icons': [
|
||||||
{ text: '', link: '/' },
|
{ text: '', link: '/' },
|
||||||
// { text: 'Categorized', link: '/icons/categorized' },
|
|
||||||
// {
|
|
||||||
// text: 'Categories',
|
|
||||||
// items: [
|
|
||||||
// ...(getAllCategoryFiles().map((category) => ({ text: category, link: `/icons/category/${category}` })))
|
|
||||||
// ]
|
|
||||||
// }
|
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,5 +7,6 @@
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.container {
|
.container {
|
||||||
padding: 32px;
|
padding: 32px;
|
||||||
|
padding-top: 33px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ const component = computed(() => props.href ? 'a' : 'div')
|
|||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background-color: var(--vp-c-bg-alt);
|
background-color: var(--vp-c-bg-alt);
|
||||||
color: var(--vp-c-text-1);
|
color: var(--vp-c-text-1);
|
||||||
|
text-decoration: none;
|
||||||
/* width: 56px;
|
/* width: 56px;
|
||||||
height: 56px; */
|
height: 56px; */
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
|||||||
56
docs/.vitepress/theme/components/base/Card.vue
Normal file
56
docs/.vitepress/theme/components/base/Card.vue
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { computed } from 'vue';
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
href?: string;
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const isExternal = computed(() => {
|
||||||
|
return props.href?.startsWith('http') ?? false
|
||||||
|
})
|
||||||
|
|
||||||
|
const component = computed(() => {
|
||||||
|
return props.href ? 'a' : 'div'
|
||||||
|
})
|
||||||
|
|
||||||
|
const rel = computed(() => {
|
||||||
|
return isExternal.value ? 'noreferrer noopener' : undefined
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<component
|
||||||
|
:is="component"
|
||||||
|
:href="href"
|
||||||
|
:rel="rel"
|
||||||
|
class="card"
|
||||||
|
>
|
||||||
|
<slot />
|
||||||
|
</component>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.card {
|
||||||
|
border: 1px solid var(--vp-c-bg-soft);
|
||||||
|
border-radius: 12px;
|
||||||
|
background-color: var(--vp-c-bg-soft);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 24px;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card[href] {
|
||||||
|
display: block;
|
||||||
|
border: 1px solid var(--vp-c-bg-soft);
|
||||||
|
border-radius: 12px;
|
||||||
|
height: 100%;
|
||||||
|
background-color: var(--vp-c-bg-soft);
|
||||||
|
transition: border-color .25s,background-color .25s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card[href]:hover {
|
||||||
|
border-color: var(--vp-c-brand-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
36
docs/.vitepress/theme/components/base/CardGrid.vue
Normal file
36
docs/.vitepress/theme/components/base/CardGrid.vue
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<template>
|
||||||
|
<div class="grid">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.grid {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: stretch;
|
||||||
|
justify-content: center;
|
||||||
|
align-content: space-evenly;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin: -8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid > * {
|
||||||
|
flex-basis: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 960px) {
|
||||||
|
.grid > * {
|
||||||
|
flex-basis: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1280px) {
|
||||||
|
.grid > * {
|
||||||
|
flex-basis: 33.33%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -54,7 +54,7 @@ const value = computed({
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
.color-picker {
|
.color-picker {
|
||||||
background: var(--color-picker-bg, var(--vp-c-bg-soft));
|
background: var(--color-picker-bg, var(--vp-c-bg-alt));
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
color: var(--vp-c-text-2);
|
color: var(--vp-c-text-2);
|
||||||
padding: 4px 8px;
|
padding: 4px 8px;
|
||||||
@@ -71,10 +71,10 @@ const value = computed({
|
|||||||
.color-input-text {
|
.color-input-text {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 0 8px;
|
padding: 0 0 0 8px;
|
||||||
border: none;
|
border: none;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: var(--vp-c-text-2);
|
color: var(--vp-c-text-1);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
|||||||
63
docs/.vitepress/theme/components/base/GridSection.vue
Normal file
63
docs/.vitepress/theme/components/base/GridSection.vue
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { computed } from 'vue';
|
||||||
|
import CardGrid from './CardGrid.vue';
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
title: string,
|
||||||
|
headingLevel: 1 | 2 | 3 | 4 | 5 | 6,
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const headingElement = computed(() => `h${props.headingLevel}`)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section>
|
||||||
|
<component :is="headingElement" class="name">{{ title }}</component>
|
||||||
|
<CardGrid>
|
||||||
|
<slot />
|
||||||
|
</CardGrid>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.name {
|
||||||
|
font-size: 32px;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
section {
|
||||||
|
margin-bottom: 96px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: stretch;
|
||||||
|
justify-content: center;
|
||||||
|
align-content: space-evenly;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin: -8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid > * {
|
||||||
|
flex-basis: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 960px) {
|
||||||
|
.grid > * {
|
||||||
|
flex-basis: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1280px) {
|
||||||
|
.grid > * {
|
||||||
|
flex-basis: 33.33%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -49,7 +49,7 @@ const percentage = computed<string>(() => `${((Number(props.modelValue) - props.
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
line-height: 10px;
|
line-height: 10px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
--bar-color: var(--slider-bar-color, var(--vp-c-bg-soft));
|
--bar-color: var(--slider-bar-color, var(--vp-input-switch-bg-color));
|
||||||
}
|
}
|
||||||
|
|
||||||
.slider:hover input{
|
.slider:hover input{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { data } from './HomeHeroBefore.data'
|
|||||||
:href="`https://github.com/lucide-icons/lucide/releases/tag/${data.version}`"
|
:href="`https://github.com/lucide-icons/lucide/releases/tag/${data.version}`"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer noopener"
|
rel="noreferrer noopener"
|
||||||
>{{ data.version }}</Badge>
|
>v{{ data.version }}</Badge>
|
||||||
</HomeContainer>
|
</HomeContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,10 @@ watch(absoluteStrokeWidth, (enabled) => {
|
|||||||
Lucide has a lot of customization options to match the icons with your UI.
|
Lucide has a lot of customization options to match the icons with your UI.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="customizer">
|
<div
|
||||||
|
class="customizer"
|
||||||
|
style="--color-picker-bg: var(--vp-input-switch-bg-color)"
|
||||||
|
>
|
||||||
<InputField
|
<InputField
|
||||||
id="icon-color"
|
id="icon-color"
|
||||||
label="Color"
|
label="Color"
|
||||||
|
|||||||
@@ -1,48 +1,50 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted } from 'vue'
|
import { onMounted } from 'vue';
|
||||||
import { useCategoryView } from '../../composables/useCategoryView'
|
import { useCategoryView } from '../../composables/useCategoryView';
|
||||||
|
|
||||||
interface Header {
|
interface Header {
|
||||||
level: number
|
level: number;
|
||||||
title: string
|
title: string;
|
||||||
slug: string
|
slug: string;
|
||||||
iconCount: number
|
iconCount: number;
|
||||||
link: string
|
link: string;
|
||||||
children: Header[]
|
children: Header[];
|
||||||
}
|
}
|
||||||
|
|
||||||
type MenuItem = Omit<Header, 'slug' | 'children'> & {
|
type MenuItem = Omit<Header, 'slug' | 'children'> & {
|
||||||
children?: MenuItem[]
|
children?: MenuItem[];
|
||||||
}
|
};
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
headers: MenuItem[]
|
headers: MenuItem[];
|
||||||
root?: boolean
|
root?: boolean;
|
||||||
}>()
|
}>();
|
||||||
|
|
||||||
const { selectedCategory } = useCategoryView()
|
const { selectedCategory } = useCategoryView();
|
||||||
|
|
||||||
function onClick(event: Event) {
|
function onClick(event: Event) {
|
||||||
const target = (event.target as HTMLElement).nodeName === 'span' ? (event.target as HTMLElement).parentNode : event.target as HTMLElement
|
const target =
|
||||||
const id = '#' + (target as HTMLAnchorElement).href!.split('#')[1]
|
(event.target as HTMLElement).nodeName === 'span'
|
||||||
const decodedId = decodeURIComponent(id)
|
? (event.target as HTMLElement).parentNode
|
||||||
|
: (event.target as HTMLElement);
|
||||||
|
const href = (target as HTMLAnchorElement)?.href;
|
||||||
|
|
||||||
selectedCategory.value = decodedId.replace('#', '')
|
if (href) {
|
||||||
|
const id = '#' + href.split('#')[1];
|
||||||
|
const decodedId = decodeURIComponent(id);
|
||||||
|
|
||||||
const heading = document.querySelector<HTMLAnchorElement>(decodedId)
|
selectedCategory.value = decodedId.replace('#', '');
|
||||||
heading?.focus()
|
|
||||||
|
const heading = document.querySelector<HTMLAnchorElement>(decodedId);
|
||||||
|
heading?.focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<ul :class="root ? 'root' : 'nested'">
|
<ul :class="root ? 'root' : 'nested'">
|
||||||
<li v-for="{ children, link, title, iconCount } in headers">
|
<li v-for="{ children, link, title, iconCount } in headers">
|
||||||
<a
|
<a class="outline-link" :href="link" @click="onClick" :title="title">
|
||||||
class="outline-link"
|
|
||||||
:href="link"
|
|
||||||
@click="onClick"
|
|
||||||
:title="title"
|
|
||||||
>
|
|
||||||
<span>
|
<span>
|
||||||
{{ title }}
|
{{ title }}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { useRouter } from 'vitepress';
|
|||||||
import IconInfo from './IconInfo.vue';
|
import IconInfo from './IconInfo.vue';
|
||||||
import Badge from '../base/Badge.vue';
|
import Badge from '../base/Badge.vue';
|
||||||
import { computedAsync } from '@vueuse/core';
|
import { computedAsync } from '@vueuse/core';
|
||||||
|
import { satisfies } from 'semver';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
iconName: string
|
iconName: string
|
||||||
@@ -25,6 +26,12 @@ const icon = computedAsync<IconEntity | null>(async () => {
|
|||||||
const emit = defineEmits(['close'])
|
const emit = defineEmits(['close'])
|
||||||
const isOpen = computed(() => !!icon.value)
|
const isOpen = computed(() => !!icon.value)
|
||||||
|
|
||||||
|
function releaseTagLink(version) {
|
||||||
|
const shouldAddV = satisfies(version, `<0.266.0`)
|
||||||
|
|
||||||
|
return `https://github.com/lucide-icons/lucide/releases/tag/${shouldAddV ? 'v' : ''}${version}`
|
||||||
|
}
|
||||||
|
|
||||||
function onClose() {
|
function onClose() {
|
||||||
emit('close')
|
emit('close')
|
||||||
}
|
}
|
||||||
@@ -43,7 +50,7 @@ const Expand = createLucideIcon('Expand', expand)
|
|||||||
<Badge
|
<Badge
|
||||||
v-if="icon.createdRelease"
|
v-if="icon.createdRelease"
|
||||||
class="version"
|
class="version"
|
||||||
:href="`https://github.com/lucide-icons/lucide/releases/tag/v${icon.createdRelease.version}`"
|
:href="releaseTagLink(icon.createdRelease.version)"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer noopener"
|
rel="noreferrer noopener"
|
||||||
>v{{ icon.createdRelease.version }}</Badge>
|
>v{{ icon.createdRelease.version }}</Badge>
|
||||||
|
|||||||
@@ -1,66 +1,69 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, defineAsyncComponent } from 'vue'
|
import { ref, computed, defineAsyncComponent } from 'vue';
|
||||||
import type { IconEntity, Category } from '../../types'
|
import type { IconEntity, Category } from '../../types';
|
||||||
import useSearch from '../../composables/useSearch'
|
import useSearch from '../../composables/useSearch';
|
||||||
import InputSearch from '../base/InputSearch.vue'
|
import InputSearch from '../base/InputSearch.vue';
|
||||||
import useSearchInput from '../../composables/useSearchInput'
|
import useSearchInput from '../../composables/useSearchInput';
|
||||||
import StickyBar from './StickyBar.vue'
|
import StickyBar from './StickyBar.vue';
|
||||||
import IconsCategory from './IconsCategory.vue'
|
import IconsCategory from './IconsCategory.vue';
|
||||||
import { useFetch } from '@vueuse/core'
|
import { useFetch } from '@vueuse/core';
|
||||||
import useFetchTags from '../../composables/useFetchTags'
|
import useFetchTags from '../../composables/useFetchTags';
|
||||||
import useFetchCategories from '../../composables/useFetchCategories'
|
import useFetchCategories from '../../composables/useFetchCategories';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
icons: IconEntity[]
|
icons: IconEntity[];
|
||||||
categories: Category[]
|
categories: Category[];
|
||||||
iconCategories: Record<string, string[]>
|
iconCategories: Record<string, string[]>;
|
||||||
}>()
|
}>();
|
||||||
|
|
||||||
const activeIconName = ref(null)
|
const activeIconName = ref(null);
|
||||||
const { searchInput, searchQuery, searchQueryThrottled } = useSearchInput()
|
const { searchInput, searchQuery, searchQueryDebounced } = useSearchInput();
|
||||||
|
|
||||||
const isSearching = computed(() => !!searchQuery.value)
|
const isSearching = computed(() => !!searchQuery.value);
|
||||||
|
|
||||||
function setActiveIconName(name: string) {
|
function setActiveIconName(name: string) {
|
||||||
activeIconName.value = name
|
activeIconName.value = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { execute: fetchTags, data: tags } = useFetchTags()
|
const { execute: fetchTags, data: tags } = useFetchTags();
|
||||||
const { execute: fetchCategories, data: categoriesMap } = useFetchCategories()
|
const { execute: fetchCategories, data: categoriesMap } = useFetchCategories();
|
||||||
|
|
||||||
const mappedIcons = computed(() => {
|
const mappedIcons = computed(() => {
|
||||||
if(tags.value == null) {
|
if (tags.value == null) {
|
||||||
return props.icons
|
return props.icons;
|
||||||
}
|
}
|
||||||
return props.icons.map((icon) => {
|
return props.icons.map((icon) => {
|
||||||
const iconTags = tags.value[icon.name]
|
const iconTags = tags.value[icon.name];
|
||||||
const iconCategories = categoriesMap.value?.[icon.name] ?? []
|
const iconCategories = categoriesMap.value?.[icon.name] ?? [];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...icon,
|
...icon,
|
||||||
tags: iconTags,
|
tags: iconTags,
|
||||||
categories: iconCategories,
|
categories: iconCategories,
|
||||||
}
|
};
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
|
|
||||||
const searchResults = useSearch(searchQuery, mappedIcons, [
|
const searchResults = useSearch(searchQuery, mappedIcons, [
|
||||||
{ name: 'name', weight: 2 },
|
{ name: 'name', weight: 2 },
|
||||||
{ name: 'tags', weight: 1 },
|
{ name: 'tags', weight: 1 },
|
||||||
])
|
]);
|
||||||
|
|
||||||
const categories = computed(() => {
|
const categories = computed(() => {
|
||||||
if( !props.categories?.length || !props.icons?.length ) return []
|
if (!props.categories?.length || !props.icons?.length) return [];
|
||||||
|
|
||||||
return props.categories.map(({ name, title }) => {
|
return props.categories
|
||||||
|
.map(({ name, title }) => {
|
||||||
const categoryIcons = props.icons.filter((icon) => {
|
const categoryIcons = props.icons.filter((icon) => {
|
||||||
const iconCategories = props.iconCategories[icon.name]
|
const iconCategories = props.iconCategories[icon.name];
|
||||||
|
|
||||||
return iconCategories?.includes(name)
|
return iconCategories?.includes(name);
|
||||||
})
|
});
|
||||||
|
|
||||||
const searchedCategoryIcons = isSearching
|
const searchedCategoryIcons = isSearching
|
||||||
? categoryIcons.filter(icon => searchResults.value.some((item) => item?.name === icon?.name))
|
? categoryIcons.filter((icon) =>
|
||||||
|
searchResults.value.some((item) => item?.name === icon?.name)
|
||||||
|
)
|
||||||
: categoryIcons;
|
: categoryIcons;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -69,25 +72,21 @@ const categories = computed(() => {
|
|||||||
icons: searchedCategoryIcons,
|
icons: searchedCategoryIcons,
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.filter(({ icons }) => icons.length)
|
.filter(({ icons }) => icons.length);
|
||||||
})
|
});
|
||||||
|
|
||||||
function onFocusSearchInput() {
|
function onFocusSearchInput() {
|
||||||
if (tags.value == null) {
|
if (tags.value == null) {
|
||||||
fetchTags()
|
fetchTags();
|
||||||
}
|
}
|
||||||
if (categoriesMap.value == null) {
|
if (categoriesMap.value == null) {
|
||||||
fetchCategories()
|
fetchCategories();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const NoResults = defineAsyncComponent(() =>
|
const NoResults = defineAsyncComponent(() => import('./NoResults.vue'));
|
||||||
import('./NoResults.vue')
|
|
||||||
)
|
|
||||||
|
|
||||||
const IconDetailOverlay = defineAsyncComponent(() =>
|
const IconDetailOverlay = defineAsyncComponent(() => import('./IconDetailOverlay.vue'));
|
||||||
import('./IconDetailOverlay.vue')
|
|
||||||
)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -100,11 +99,7 @@ const IconDetailOverlay = defineAsyncComponent(() =>
|
|||||||
@focus="onFocusSearchInput"
|
@focus="onFocusSearchInput"
|
||||||
/>
|
/>
|
||||||
</StickyBar>
|
</StickyBar>
|
||||||
<NoResults
|
<NoResults v-if="categories.length === 0" :searchQuery="searchQuery" @clear="searchQuery = ''" />
|
||||||
v-if="categories.length === 0"
|
|
||||||
:searchQuery="searchQuery"
|
|
||||||
@clear="searchQuery = ''"
|
|
||||||
/>
|
|
||||||
<IconsCategory
|
<IconsCategory
|
||||||
v-for="category in categories"
|
v-for="category in categories"
|
||||||
:key="category.name"
|
:key="category.name"
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, watch, defineAsyncComponent } from 'vue'
|
import { ref, computed, watch, defineAsyncComponent } from 'vue';
|
||||||
import type { IconEntity } from '../../types'
|
import type { IconEntity } from '../../types';
|
||||||
import { useMediaQuery, useOffsetPagination } from '@vueuse/core'
|
import { useMediaQuery, useOffsetPagination } from '@vueuse/core';
|
||||||
import IconGrid from './IconGrid.vue'
|
import IconGrid from './IconGrid.vue';
|
||||||
import InputSearch from '../base/InputSearch.vue'
|
import InputSearch from '../base/InputSearch.vue';
|
||||||
import useSearch from '../../composables/useSearch'
|
import useSearch from '../../composables/useSearch';
|
||||||
import EndOfPage from '../base/EndOfPage.vue'
|
import EndOfPage from '../base/EndOfPage.vue';
|
||||||
import useSearchInput from '../../composables/useSearchInput'
|
import useSearchInput from '../../composables/useSearchInput';
|
||||||
import StickyBar from './StickyBar.vue'
|
import StickyBar from './StickyBar.vue';
|
||||||
import useFetchTags from '../../composables/useFetchTags'
|
import useFetchTags from '../../composables/useFetchTags';
|
||||||
import useFetchCategories from '../../composables/useFetchCategories'
|
import useFetchCategories from '../../composables/useFetchCategories';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
icons: IconEntity[]
|
icons: IconEntity[];
|
||||||
}>()
|
}>();
|
||||||
|
|
||||||
const activeIconName = ref(null)
|
const activeIconName = ref(null);
|
||||||
|
|
||||||
const isExtraLargeScreen = useMediaQuery('(min-width: 1440px)');
|
const isExtraLargeScreen = useMediaQuery('(min-width: 1440px)');
|
||||||
const isLargeScreen = useMediaQuery('(min-width: 1280px)');
|
const isLargeScreen = useMediaQuery('(min-width: 1280px)');
|
||||||
@@ -23,84 +23,78 @@ const isMediumScreen = useMediaQuery('(min-width: 960px)');
|
|||||||
const isSmallScreen = useMediaQuery('(min-width: 640px)');
|
const isSmallScreen = useMediaQuery('(min-width: 640px)');
|
||||||
|
|
||||||
const pageSize = computed(() => {
|
const pageSize = computed(() => {
|
||||||
if(isExtraLargeScreen.value) {
|
if (isExtraLargeScreen.value) {
|
||||||
return 16 * 20;
|
return 16 * 20;
|
||||||
}
|
}
|
||||||
if(isLargeScreen.value) {
|
if (isLargeScreen.value) {
|
||||||
return 16 * 12;
|
return 16 * 12;
|
||||||
}
|
}
|
||||||
if(isMediumScreen.value) {
|
if (isMediumScreen.value) {
|
||||||
return 13 * 12;
|
return 13 * 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isSmallScreen.value) {
|
if (isSmallScreen.value) {
|
||||||
return 10 * 10;
|
return 10 * 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 10 * 5;
|
return 10 * 5;
|
||||||
})
|
});
|
||||||
|
|
||||||
const { execute: fetchTags, data: tags } = useFetchTags()
|
const { execute: fetchTags, data: tags } = useFetchTags();
|
||||||
const { execute: fetchCategories, data: categories } = useFetchCategories()
|
const { execute: fetchCategories, data: categories } = useFetchCategories();
|
||||||
|
|
||||||
const mappedIcons = computed(() => {
|
const mappedIcons = computed(() => {
|
||||||
if(tags.value == null) {
|
if (tags.value == null) {
|
||||||
return props.icons
|
return props.icons;
|
||||||
}
|
}
|
||||||
|
|
||||||
return props.icons.map((icon) => {
|
return props.icons.map((icon) => {
|
||||||
const iconTags = tags.value[icon.name]
|
const iconTags = tags.value[icon.name];
|
||||||
const iconCategories = categories.value?.[icon.name] ?? []
|
const iconCategories = categories.value?.[icon.name] ?? [];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...icon,
|
...icon,
|
||||||
tags: iconTags,
|
tags: iconTags,
|
||||||
categories: iconCategories,
|
categories: iconCategories,
|
||||||
}
|
};
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
|
|
||||||
const { searchInput, searchQuery, searchQueryThrottled } = useSearchInput()
|
const { searchInput, searchQuery, searchQueryDebounced } = useSearchInput();
|
||||||
const searchResults = useSearch(searchQueryThrottled, mappedIcons, [
|
const searchResults = useSearch(searchQueryDebounced, mappedIcons, [
|
||||||
{ name: 'name', weight: 3 },
|
{ name: 'name', weight: 3 },
|
||||||
{ name: 'tags', weight: 2 },
|
{ name: 'tags', weight: 2 },
|
||||||
{ name: 'categories', weight: 1 },
|
{ name: 'categories', weight: 1 },
|
||||||
])
|
]);
|
||||||
|
|
||||||
const { next, currentPage } = useOffsetPagination( { pageSize })
|
|
||||||
|
|
||||||
|
const { next, currentPage } = useOffsetPagination({ pageSize });
|
||||||
|
|
||||||
const paginatedIcons = computed(() => {
|
const paginatedIcons = computed(() => {
|
||||||
const end = pageSize.value * currentPage.value
|
const end = pageSize.value * currentPage.value;
|
||||||
|
|
||||||
return searchResults.value.slice(0, end)
|
return searchResults.value.slice(0, end);
|
||||||
})
|
});
|
||||||
|
|
||||||
function setActiveIconName(name: string) {
|
function setActiveIconName(name: string) {
|
||||||
activeIconName.value = name
|
activeIconName.value = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(searchQueryThrottled, (searchString) => {
|
watch(searchQueryDebounced, (searchString) => {
|
||||||
currentPage.value = 1
|
currentPage.value = 1;
|
||||||
})
|
});
|
||||||
|
|
||||||
function onFocusSearchInput() {
|
function onFocusSearchInput() {
|
||||||
if (tags.value == null) {
|
if (tags.value == null) {
|
||||||
fetchTags()
|
fetchTags();
|
||||||
}
|
}
|
||||||
if (categories.value == null) {
|
if (categories.value == null) {
|
||||||
fetchCategories()
|
fetchCategories();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const NoResults = defineAsyncComponent(() =>
|
const NoResults = defineAsyncComponent(() => import('./NoResults.vue'));
|
||||||
import('./NoResults.vue')
|
|
||||||
)
|
|
||||||
|
|
||||||
const IconDetailOverlay = defineAsyncComponent(() =>
|
|
||||||
import('./IconDetailOverlay.vue')
|
|
||||||
)
|
|
||||||
|
|
||||||
|
const IconDetailOverlay = defineAsyncComponent(() => import('./IconDetailOverlay.vue'));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -124,7 +118,7 @@ const IconDetailOverlay = defineAsyncComponent(() =>
|
|||||||
:icons="paginatedIcons"
|
:icons="paginatedIcons"
|
||||||
@setActiveIcon="setActiveIconName"
|
@setActiveIcon="setActiveIconName"
|
||||||
/>
|
/>
|
||||||
<EndOfPage @end-of-page="next" class="bottom-page"/>
|
<EndOfPage @end-of-page="next" class="bottom-page" />
|
||||||
<IconDetailOverlay
|
<IconDetailOverlay
|
||||||
v-if="activeIconName != null"
|
v-if="activeIconName != null"
|
||||||
:iconName="activeIconName"
|
:iconName="activeIconName"
|
||||||
|
|||||||
@@ -36,15 +36,22 @@ const links = computed(() => [
|
|||||||
<template>
|
<template>
|
||||||
<footer v-if="theme.footer" class="VPFooter" :class="{ 'has-sidebar': hasSidebar }">
|
<footer v-if="theme.footer" class="VPFooter" :class="{ 'has-sidebar': hasSidebar }">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<p v-if="theme.footer.message" class="message" v-html="theme.footer.message"></p>
|
<div class="sponsors">
|
||||||
<p v-if="theme.footer.copyright" class="copyright" v-html="theme.footer.copyright"></p>
|
<a href="https://vercel.com?utm_source=lucide&utm_campaign=oss" rel="noreferrer noopener">
|
||||||
|
<img src="/vercel.svg" alt="Powered by Vercel" width="200" />
|
||||||
|
</a>
|
||||||
|
<a href="https://www.digitalocean.com/?refcode=b0877a2caebd&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge" rel="noreferrer noopener">
|
||||||
|
<img src="/digitalocean.svg" alt="Digital Ocean" width="200" />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
<div class="links">
|
<div class="links">
|
||||||
<VPLink v-for="link in links" :href="link.href" :key="link.text" :rel="link.href.startsWith('http') ? 'noreferrer noopener': undefined">
|
<VPLink v-for="link in links" :href="link.href" :key="link.text" :rel="link.href.startsWith('http') ? 'noreferrer noopener': undefined">
|
||||||
{{ link.text }}
|
{{ link.text }}
|
||||||
</VPLink>
|
</VPLink>
|
||||||
<a href="https://vercel.com?utm_source=lucide&utm_campaign=oss" rel="noreferrer noopener">
|
</div>
|
||||||
<img src="/vercel.svg" alt="Powered by Vercel" width="200" />
|
<div>
|
||||||
</a>
|
<p v-if="theme.footer.message" class="message" v-html="theme.footer.message"></p>
|
||||||
|
<p v-if="theme.footer.copyright" class="copyright" v-html="theme.footer.copyright"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
@@ -67,7 +74,7 @@ const links = computed(() => [
|
|||||||
|
|
||||||
.container {
|
.container {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
max-width: var(--vp-layout-max-width);
|
max-width: calc(var(--vp-layout-max-width) - 64px);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -85,7 +92,7 @@ const links = computed(() => [
|
|||||||
.message { order: 2; }
|
.message { order: 2; }
|
||||||
.copyright { order: 1; }
|
.copyright { order: 1; }
|
||||||
|
|
||||||
.links {
|
.links, .sponsors {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 32px;
|
gap: 32px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -102,7 +109,7 @@ const links = computed(() => [
|
|||||||
flex-direction: row-reverse;
|
flex-direction: row-reverse;
|
||||||
}
|
}
|
||||||
.links {
|
.links {
|
||||||
margin-left: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,24 +1,30 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {data} from './PackageList.data'
|
import {data} from './PackageList.data'
|
||||||
|
import GridSection from '../base/GridSection.vue'
|
||||||
import PackageListItem from "./PackageListItem.vue";</script>
|
import PackageListItem from "./PackageListItem.vue";</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<section class="package-group">
|
<GridSection
|
||||||
<h1 class="name">Packages</h1>
|
title="Packages"
|
||||||
<div class="grid package-list" ref="container">
|
:headingLevel="1"
|
||||||
<div v-for="packageData in data.packages" class="item">
|
class="package-group"
|
||||||
<PackageListItem :packageData="packageData"/>
|
>
|
||||||
</div>
|
<PackageListItem
|
||||||
</div>
|
v-for="packageData in data.packages"
|
||||||
</section>
|
:packageData="packageData"
|
||||||
<section class="package-group">
|
/>
|
||||||
<h2 class="name">Third-party packages</h2>
|
</GridSection>
|
||||||
<div class="grid package-list" ref="container">
|
|
||||||
<div v-for="packageData in data.thirdPartyPackages" class="item">
|
<GridSection
|
||||||
<PackageListItem :packageData="packageData"/>
|
title="Third-party packages"
|
||||||
</div>
|
:headingLevel="2"
|
||||||
</div>
|
class="package-group"
|
||||||
</section>
|
>
|
||||||
|
<PackageListItem
|
||||||
|
v-for="packageData in data.thirdPartyPackages"
|
||||||
|
:packageData="packageData"
|
||||||
|
/>
|
||||||
|
</GridSection>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@@ -26,7 +32,7 @@ import PackageListItem from "./PackageListItem.vue";</script>
|
|||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 24px;
|
margin-bottom: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.package-group {
|
.package-group {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import { useRouter } from 'vitepress';
|
import { useRouter } from 'vitepress';
|
||||||
import {PackageItem} from "../../types";
|
import {PackageItem} from "../../types";
|
||||||
import VPButton from 'vitepress/dist/client/theme-default/components/VPButton.vue';
|
import VPButton from 'vitepress/dist/client/theme-default/components/VPButton.vue';
|
||||||
|
import Card from '../base/Card.vue'
|
||||||
|
|
||||||
const { go } = useRouter()
|
const { go } = useRouter()
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -10,7 +11,8 @@ const props = defineProps<{
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<article class="package">
|
<div>
|
||||||
|
<Card class="package">
|
||||||
<header class="package-header">
|
<header class="package-header">
|
||||||
<div class="package-icon-well">
|
<div class="package-icon-well">
|
||||||
<img :src="packageData.icon" alt="" class="package-icon" :class="{[packageData.iconClass]: true, light: packageData.iconDark}" />
|
<img :src="packageData.icon" alt="" class="package-icon" :class="{[packageData.iconClass]: true, light: packageData.iconDark}" />
|
||||||
@@ -40,18 +42,11 @@ const props = defineProps<{
|
|||||||
@click="go(packageData.source)"
|
@click="go(packageData.source)"
|
||||||
/>
|
/>
|
||||||
</footer>
|
</footer>
|
||||||
</article>
|
</Card>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.package {
|
|
||||||
border: 1px solid var(--vp-c-bg-soft);
|
|
||||||
border-radius: 12px;
|
|
||||||
background-color: var(--vp-c-bg-soft);
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
padding: 24px;
|
|
||||||
}
|
|
||||||
.package {
|
.package {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
72
docs/.vitepress/theme/components/showcase/ShowcaseList.vue
Normal file
72
docs/.vitepress/theme/components/showcase/ShowcaseList.vue
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import companies from '../../../data/companiesData.json'
|
||||||
|
import componentLibraries from '../../../data/componentLibrariesData.json'
|
||||||
|
import GridSection from '../base/GridSection.vue'
|
||||||
|
import ShowcaseListItem from "./ShowcaseListItem.vue";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<GridSection
|
||||||
|
title="Used by"
|
||||||
|
:headingLevel="1"
|
||||||
|
class="package-group"
|
||||||
|
>
|
||||||
|
<ShowcaseListItem
|
||||||
|
v-for="company in companies"
|
||||||
|
:showcaseItem="company"
|
||||||
|
/>
|
||||||
|
</GridSection>
|
||||||
|
|
||||||
|
<GridSection
|
||||||
|
title="Used in"
|
||||||
|
:headingLevel="1"
|
||||||
|
class="package-group"
|
||||||
|
>
|
||||||
|
<ShowcaseListItem
|
||||||
|
v-for="componentLibrary in componentLibraries"
|
||||||
|
:showcaseItem="componentLibrary"
|
||||||
|
/>
|
||||||
|
</GridSection>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.name {
|
||||||
|
font-size: 32px;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.package-group {
|
||||||
|
margin-bottom: 96px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: stretch;
|
||||||
|
justify-content: center;
|
||||||
|
align-content: space-evenly;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin: -8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid > * {
|
||||||
|
flex-basis: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 960px) {
|
||||||
|
.grid > * {
|
||||||
|
flex-basis: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1280px) {
|
||||||
|
.grid > * {
|
||||||
|
flex-basis: 33.33%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { useRouter } from 'vitepress';
|
||||||
|
import { ShowcaseItem } from "../../types";
|
||||||
|
import Card from '../base/Card.vue'
|
||||||
|
|
||||||
|
const { go } = useRouter()
|
||||||
|
defineProps<{
|
||||||
|
showcaseItem: ShowcaseItem,
|
||||||
|
}>()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<Card
|
||||||
|
class="company"
|
||||||
|
:href="showcaseItem.url"
|
||||||
|
:aria-label="showcaseItem.name"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
:src="showcaseItem.image.light"
|
||||||
|
class="logo light"
|
||||||
|
:alt="`${showcaseItem.name} logo`"
|
||||||
|
/>
|
||||||
|
<img
|
||||||
|
:src="showcaseItem.image.dark"
|
||||||
|
class="logo dark"
|
||||||
|
:alt="`${showcaseItem.name} logo`"
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.company {
|
||||||
|
display: flex;
|
||||||
|
height: 100%;
|
||||||
|
padding: 48px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
height:64px;
|
||||||
|
width: 240px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
html.dark .logo.dark {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
html:not(.dark) .logo.light {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,43 +1,40 @@
|
|||||||
import { refThrottled } from '@vueuse/core';
|
import { useDebounce } from '@vueuse/core';
|
||||||
import { nextTick, onMounted, ref, watch } from 'vue';
|
import { nextTick, onMounted, ref, watch } from 'vue';
|
||||||
|
|
||||||
const useSearchInput = () => {
|
const useSearchInput = () => {
|
||||||
const searchInput = ref()
|
const searchInput = ref();
|
||||||
const searchQuery = ref(
|
const searchQuery = ref(
|
||||||
typeof window === 'undefined'
|
typeof window === 'undefined'
|
||||||
? ''
|
? ''
|
||||||
: (
|
: new URLSearchParams(window.location.search).get('search') || ''
|
||||||
new URLSearchParams(window.location.search).get('search')
|
);
|
||||||
|| ''
|
const searchQueryDebounced = useDebounce(searchQuery, 250);
|
||||||
)
|
|
||||||
)
|
|
||||||
const searchQueryThrottled = refThrottled(searchQuery, 400)
|
|
||||||
|
|
||||||
watch(searchQueryThrottled, (searchString) => {
|
watch(searchQueryDebounced, (searchString) => {
|
||||||
const newUrl = new URL(window.location.href);
|
const newUrl = new URL(window.location.href);
|
||||||
|
|
||||||
if(searchString === '') {
|
if (searchString === '') {
|
||||||
newUrl.searchParams.delete('search');
|
newUrl.searchParams.delete('search');
|
||||||
} else {
|
} else {
|
||||||
newUrl.searchParams.set('search', searchString);
|
newUrl.searchParams.set('search', searchString);
|
||||||
}
|
}
|
||||||
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
window.history.replaceState({}, '', newUrl)
|
window.history.replaceState({}, '', newUrl);
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const searchParams = new URLSearchParams(window.location.search);
|
const searchParams = new URLSearchParams(window.location.search);
|
||||||
if(searchParams.has('focus')) {
|
if (searchParams.has('focus')) {
|
||||||
searchInput.value.focus()
|
searchInput.value.focus();
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
searchInput,
|
searchInput,
|
||||||
searchQuery,
|
searchQuery,
|
||||||
searchQueryThrottled
|
searchQueryDebounced,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
34
docs/.vitepress/theme/sandpackTheme.json
Normal file
34
docs/.vitepress/theme/sandpackTheme.json
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"colors": {
|
||||||
|
"surface1": "var(--vp-code-block-bg)",
|
||||||
|
"surface2": "var(--vp-code-block-bg)",
|
||||||
|
"surface3": "var(--vp-code-line-highlight-color)",
|
||||||
|
"clickable": "var(--vp-c-text-2)",
|
||||||
|
"base": "#323232",
|
||||||
|
"disabled": "#C5C5C5",
|
||||||
|
"hover": "var(--vp-c-brand)",
|
||||||
|
"accent": "var(--vp-c-brand)",
|
||||||
|
"error": "var(--vp-c-red)",
|
||||||
|
"errorSurface": "#ffeceb"
|
||||||
|
},
|
||||||
|
"syntax": {
|
||||||
|
"plain": "var(--vp-code-editor-plain)",
|
||||||
|
"comment": {
|
||||||
|
"color": "var(--vp-code-editor-comment)",
|
||||||
|
"fontStyle": "italic"
|
||||||
|
},
|
||||||
|
"keyword": "var(--vp-code-editor-keyword)",
|
||||||
|
"tag": "var(--vp-code-editor-tag)",
|
||||||
|
"punctuation": "var(--vp-code-editor-punctuation)",
|
||||||
|
"definition": "var(--vp-code-editor-definition)",
|
||||||
|
"property": "var(--vp-code-editor-property)",
|
||||||
|
"static": "var(--vp-code-editor-static)",
|
||||||
|
"string": "var(--vp-code-editor-string)"
|
||||||
|
},
|
||||||
|
"font": {
|
||||||
|
"body": "var(--vp-font-family-base)",
|
||||||
|
"mono": "var(--vp-font-family-mono)",
|
||||||
|
"size": "var(--vp-code-font-size)",
|
||||||
|
"lineHeight": "var(--vp-code-line-height)"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,13 +5,39 @@
|
|||||||
--vp-c-brand-dark: #DC5A5A;
|
--vp-c-brand-dark: #DC5A5A;
|
||||||
--vp-c-brand-darker: #C45050;
|
--vp-c-brand-darker: #C45050;
|
||||||
|
|
||||||
|
--vp-c-brand-1: #F67373;
|
||||||
|
--vp-c-brand-2: #FF7070;
|
||||||
|
--vp-c-brand-3: #F56565;
|
||||||
|
--vp-c-brand-4: #DC5A5A;
|
||||||
|
--vp-c-brand-5: #C45050;
|
||||||
|
|
||||||
--vp-c-bg-alt-up: #fff;
|
--vp-c-bg-alt-up: #fff;
|
||||||
--vp-c-bg-alt-down: #fff;
|
--vp-c-bg-alt-down: #fff;
|
||||||
|
|
||||||
|
--vp-code-editor-plain: #24292E;
|
||||||
|
--vp-code-editor-comment: #6A737D;
|
||||||
|
--vp-code-editor-keyword: #D73A49;
|
||||||
|
--vp-code-editor-tag: #22863A;
|
||||||
|
--vp-code-editor-punctuation: #24292E;
|
||||||
|
--vp-code-editor-definition: #6F42C1;
|
||||||
|
--vp-code-editor-property: #005CC5;
|
||||||
|
--vp-code-editor-static: #F78C6C;
|
||||||
|
--vp-code-editor-string: #032F62;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark {
|
.dark {
|
||||||
--vp-c-bg-alt-up: #1B1B1D;
|
--vp-c-bg-alt-up: #1B1B1D;
|
||||||
--vp-c-bg-alt-down: #0F0F10;
|
--vp-c-bg-alt-down: #0F0F10;
|
||||||
|
|
||||||
|
--vp-code-editor-plain: #E1E4E8;
|
||||||
|
--vp-code-editor-comment: #6A737D;
|
||||||
|
--vp-code-editor-keyword: #F97583;
|
||||||
|
--vp-code-editor-tag: #85E89D;
|
||||||
|
--vp-code-editor-punctuation: #9ECBFF;
|
||||||
|
--vp-code-editor-definition: #B392F0;
|
||||||
|
--vp-code-editor-property: #79B8FF;
|
||||||
|
--vp-code-editor-static: #F78C6C;
|
||||||
|
--vp-code-editor-string: #9ECBFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.VPNavBarTitle .logo {
|
.VPNavBarTitle .logo {
|
||||||
@@ -126,3 +152,52 @@
|
|||||||
html:has(* .outline-link:target) {
|
html:has(* .outline-link:target) {
|
||||||
scroll-behavior: smooth;
|
scroll-behavior: smooth;
|
||||||
} */
|
} */
|
||||||
|
|
||||||
|
.sp-wrapper .sp-layout {
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sp-wrapper .sp-tabs-scrollable-container {
|
||||||
|
border-radius: 8px 8px 0 0;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
box-shadow: inset 0 -1px var(--vp-code-tab-divider);
|
||||||
|
margin-bottom: 0px;
|
||||||
|
margin-top: -1px;
|
||||||
|
height: 48px;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sp-wrapper .sp-preview-container {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sp-wrapper .sp-tabs .sp-tab-button {
|
||||||
|
padding: 0 12px;
|
||||||
|
line-height: 48px;
|
||||||
|
height: 48px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
position: relative;
|
||||||
|
/* box-sizing: content-box; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.sp-wrapper .sp-tabs .sp-tab-button:after {
|
||||||
|
position: absolute;
|
||||||
|
right: 8px;
|
||||||
|
left: 8px;
|
||||||
|
bottom: 0px;
|
||||||
|
z-index: 1;
|
||||||
|
height: 1px;
|
||||||
|
content: '';
|
||||||
|
background-color: transparent;
|
||||||
|
transition: background-color 0.25s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sp-wrapper .sp-tabs .sp-tab-button[data-active="true"] {
|
||||||
|
color: var(--vp-code-tab-active-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sp-wrapper .sp-tabs .sp-tab-button[data-active="true"]:after {
|
||||||
|
background-color: var(--vp-code-tab-active-bar-color);
|
||||||
|
}
|
||||||
|
|||||||
@@ -44,3 +44,14 @@ export interface Release {
|
|||||||
version: string
|
version: string
|
||||||
date: string
|
date: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface ShowcaseItemImage {
|
||||||
|
light: string
|
||||||
|
dark: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ShowcaseItem {
|
||||||
|
name: string
|
||||||
|
url: string
|
||||||
|
image: ShowcaseItemImage
|
||||||
|
}
|
||||||
|
|||||||
14
docs/.vitepress/vue-shim.d.ts
vendored
14
docs/.vitepress/vue-shim.d.ts
vendored
@@ -1,10 +1,18 @@
|
|||||||
declare module "*.vue" {
|
declare module '*.vue' {
|
||||||
import Vue from "vue";
|
import Vue from 'vue';
|
||||||
export default Vue;
|
export default Vue;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module "*.data.ts" {
|
declare module '*.data.ts' {
|
||||||
const data: any;
|
const data: any;
|
||||||
|
|
||||||
export { data };
|
export { data };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare module '*.wasm' {}
|
||||||
|
|
||||||
|
declare const resvg_wasm: RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
||||||
|
|
||||||
|
declare module 'node:module' {
|
||||||
|
function createRequire(filename: string): NodeRequire;
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
The Lucide docs website is built with Vitepress: https://vitepress.dev/
|
The Lucide docs website is built with Vitepress: https://vitepress.dev/
|
||||||
This is Markdown-based documentation powered by Vue.
|
This is Markdown-based documentation powered by Vue.
|
||||||
|
|
||||||
This is why this file is in txt format.
|
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
4
docs/guide/advanced/accessibility.md
Normal file
4
docs/guide/advanced/accessibility.md
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# Accessibility
|
||||||
|
|
||||||
|
<!-- Description how you should use svg icons keeping web accessible -->
|
||||||
|
<!-- See @JanTrichter comment about some information to write this: https://github.com/lucide-icons/lucide/pull/1521#discussion_r1332141390 -->
|
||||||
13
docs/guide/advanced/filled-icons.md
Normal file
13
docs/guide/advanced/filled-icons.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Filled Icons
|
||||||
|
|
||||||
|
Fills are officially not supported.
|
||||||
|
However, all SVG properties are available on all icons.
|
||||||
|
Fill can still be used and will work fine on certain icons.
|
||||||
|
|
||||||
|
Example with stars:
|
||||||
|
|
||||||
|
<!-- Code Example with stars -->
|
||||||
|
|
||||||
|
## Will Lucide have fills in the future?
|
||||||
|
|
||||||
|
This feature is requested several times and discussion is happening at: [#458](https://github.com/lucide-icons/lucide/discussions/458).
|
||||||
52
docs/guide/basics/color.md
Normal file
52
docs/guide/basics/color.md
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<script setup>
|
||||||
|
import { Sandpack } from 'sandpack-vue3'
|
||||||
|
import sandpackTheme from '../../.vitepress/theme/sandpackTheme.json'
|
||||||
|
import buttonExampleFiles from './examples/button-example/files.ts'
|
||||||
|
import iconColorExampleFiles from './examples/color-icon/files.ts'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
# Color
|
||||||
|
|
||||||
|
By default, all icons have the color value: `currentColor`. This keyword uses the element's computed text `color` value to represent the icon color.
|
||||||
|
|
||||||
|
Read more about [ `currentColor` on MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#currentcolor_keyword).
|
||||||
|
|
||||||
|
## Adjust the color using the `color` prop
|
||||||
|
|
||||||
|
The color can be adjusted by passing the color prop to the element.
|
||||||
|
|
||||||
|
<Sandpack
|
||||||
|
template="react"
|
||||||
|
:theme="sandpackTheme"
|
||||||
|
:files="iconColorExampleFiles"
|
||||||
|
:customSetup='{
|
||||||
|
dependencies: {
|
||||||
|
"lucide-react": "latest"
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
:options="{
|
||||||
|
editorHeight: 295,
|
||||||
|
editorWidthPercentage: 60,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
## Using parent elements text color value
|
||||||
|
|
||||||
|
Because the color of lucide icons uses `currentColor`, the color of the icon depends on the computed `color` of the element, or it inherits it from its parent.
|
||||||
|
|
||||||
|
For example, if a parent element's color value is `#fff` and one of the children is a lucide icon, the color of the icon will be rendered as `#fff`. This is browser native behavior.
|
||||||
|
|
||||||
|
<Sandpack
|
||||||
|
template="react"
|
||||||
|
:theme="sandpackTheme"
|
||||||
|
:files="buttonExampleFiles"
|
||||||
|
:customSetup='{
|
||||||
|
dependencies: {
|
||||||
|
"lucide-react": "latest"
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
:options="{
|
||||||
|
editorHeight: 320,
|
||||||
|
editorWidthPercentage: 60,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
14
docs/guide/basics/examples/absolute-stroke-width-icon/App.js
Normal file
14
docs/guide/basics/examples/absolute-stroke-width-icon/App.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { RollerCoaster } from "lucide-react";
|
||||||
|
|
||||||
|
function App() {
|
||||||
|
return (
|
||||||
|
<div className="app">
|
||||||
|
<RollerCoaster
|
||||||
|
size={96}
|
||||||
|
absoluteStrokeWidth={true}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default App;
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import App from './App.js?raw'
|
||||||
|
import styles from '../styles.css?raw'
|
||||||
|
|
||||||
|
const files = {
|
||||||
|
'App.js': {
|
||||||
|
code: App,
|
||||||
|
active: true,
|
||||||
|
},
|
||||||
|
'styles.css': {
|
||||||
|
code:styles,
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export default files
|
||||||
5
docs/guide/basics/examples/button-example/App.js
Normal file
5
docs/guide/basics/examples/button-example/App.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import Button from "./Button";
|
||||||
|
|
||||||
|
export default function App() {
|
||||||
|
return <Button />;
|
||||||
|
}
|
||||||
12
docs/guide/basics/examples/button-example/Button.jsx
Normal file
12
docs/guide/basics/examples/button-example/Button.jsx
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { ThumbsUp } from "lucide-react";
|
||||||
|
|
||||||
|
function LikeButton() {
|
||||||
|
return (
|
||||||
|
<button style={{ color: "#fff" }}>
|
||||||
|
<ThumbsUp />
|
||||||
|
Like
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default LikeButton;
|
||||||
21
docs/guide/basics/examples/button-example/files.ts
Normal file
21
docs/guide/basics/examples/button-example/files.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import App from './App.js?raw'
|
||||||
|
import Button from './Button.jsx?raw'
|
||||||
|
import styles from '../styles.css?raw'
|
||||||
|
|
||||||
|
const files = {
|
||||||
|
'App.js': {
|
||||||
|
code: App,
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
'Button.jsx': {
|
||||||
|
code: Button,
|
||||||
|
active: true,
|
||||||
|
readOnly: false,
|
||||||
|
},
|
||||||
|
'styles.css': {
|
||||||
|
code:styles,
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export default files
|
||||||
11
docs/guide/basics/examples/color-icon/App.js
Normal file
11
docs/guide/basics/examples/color-icon/App.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { Smile } from "lucide-react";
|
||||||
|
|
||||||
|
function App() {
|
||||||
|
return (
|
||||||
|
<div className="app">
|
||||||
|
<Smile color="#3e9392" />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default App;
|
||||||
15
docs/guide/basics/examples/color-icon/files.ts
Normal file
15
docs/guide/basics/examples/color-icon/files.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import App from './App.js?raw'
|
||||||
|
import styles from '../styles.css?raw'
|
||||||
|
|
||||||
|
const files = {
|
||||||
|
'App.js': {
|
||||||
|
code: App,
|
||||||
|
active: true,
|
||||||
|
},
|
||||||
|
'styles.css': {
|
||||||
|
code:styles,
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export default files
|
||||||
12
docs/guide/basics/examples/size-icon-css-example/App.js
Normal file
12
docs/guide/basics/examples/size-icon-css-example/App.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { Beer } from "lucide-react";
|
||||||
|
import "./icon.css";
|
||||||
|
|
||||||
|
function App() {
|
||||||
|
return (
|
||||||
|
<div className="app">
|
||||||
|
<Beer className="my-beer-icon" />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default App;
|
||||||
21
docs/guide/basics/examples/size-icon-css-example/files.ts
Normal file
21
docs/guide/basics/examples/size-icon-css-example/files.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import App from './App.js?raw'
|
||||||
|
import styles from '../styles.css?raw'
|
||||||
|
import IconCss from './icon.css?raw'
|
||||||
|
|
||||||
|
const files = {
|
||||||
|
'icon.css': {
|
||||||
|
code: IconCss,
|
||||||
|
readOnly: false,
|
||||||
|
active: true,
|
||||||
|
},
|
||||||
|
'App.js': {
|
||||||
|
code: App,
|
||||||
|
},
|
||||||
|
'styles.css': {
|
||||||
|
code:styles,
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default files
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
.my-beer-icon {
|
||||||
|
/* Change this! */
|
||||||
|
width: 64px;
|
||||||
|
height: 64px;
|
||||||
|
}
|
||||||
11
docs/guide/basics/examples/size-icon-example/App.js
Normal file
11
docs/guide/basics/examples/size-icon-example/App.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { Landmark } from "lucide-react";
|
||||||
|
|
||||||
|
function App() {
|
||||||
|
return (
|
||||||
|
<div className="app">
|
||||||
|
<Landmark size={64} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default App;
|
||||||
15
docs/guide/basics/examples/size-icon-example/files.ts
Normal file
15
docs/guide/basics/examples/size-icon-example/files.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import App from './App.js?raw'
|
||||||
|
import styles from '../styles.css?raw'
|
||||||
|
|
||||||
|
const files = {
|
||||||
|
'App.js': {
|
||||||
|
code: App,
|
||||||
|
active: true,
|
||||||
|
},
|
||||||
|
'styles.css': {
|
||||||
|
code:styles,
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export default files
|
||||||
13
docs/guide/basics/examples/size-icon-font-example/App.js
Normal file
13
docs/guide/basics/examples/size-icon-font-example/App.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { Star } from "lucide-react";
|
||||||
|
import "./icon.css";
|
||||||
|
|
||||||
|
function App() {
|
||||||
|
return (
|
||||||
|
<div className="text-wrapper">
|
||||||
|
<Star class="my-icon" />
|
||||||
|
<div>Yes</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default App;
|
||||||
21
docs/guide/basics/examples/size-icon-font-example/files.ts
Normal file
21
docs/guide/basics/examples/size-icon-font-example/files.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import App from './App.js?raw'
|
||||||
|
import styles from '../styles.css?raw'
|
||||||
|
import IconCss from './icon.css?raw'
|
||||||
|
|
||||||
|
const files = {
|
||||||
|
'icon.css': {
|
||||||
|
code: IconCss,
|
||||||
|
readOnly: false,
|
||||||
|
active: true,
|
||||||
|
},
|
||||||
|
'App.js': {
|
||||||
|
code: App,
|
||||||
|
},
|
||||||
|
'styles.css': {
|
||||||
|
code: styles,
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default files
|
||||||
15
docs/guide/basics/examples/size-icon-font-example/icon.css
Normal file
15
docs/guide/basics/examples/size-icon-font-example/icon.css
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
.my-icon {
|
||||||
|
/* Icon size will relative to font-size of .text-wrapper */
|
||||||
|
width: 1em;
|
||||||
|
height: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-wrapper {
|
||||||
|
/* Change this! */
|
||||||
|
font-size: 96px;
|
||||||
|
|
||||||
|
/* layout stuff */
|
||||||
|
display: flex;
|
||||||
|
gap: 0.25em;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
11
docs/guide/basics/examples/size-icon-tailwind-example/App.js
Normal file
11
docs/guide/basics/examples/size-icon-tailwind-example/App.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { PartyPopper } from "lucide-react";
|
||||||
|
|
||||||
|
function App() {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<PartyPopper className="w-24 h-24" />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default App;
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import App from './App.js?raw'
|
||||||
|
import styles from '../styles.css?raw'
|
||||||
|
|
||||||
|
const files = {
|
||||||
|
'App.js': {
|
||||||
|
code: App,
|
||||||
|
active: true
|
||||||
|
},
|
||||||
|
'styles.css': {
|
||||||
|
code:styles,
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export default files
|
||||||
11
docs/guide/basics/examples/stroke-width-icon/App.js
Normal file
11
docs/guide/basics/examples/stroke-width-icon/App.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { FolderLock } from "lucide-react";
|
||||||
|
|
||||||
|
function App() {
|
||||||
|
return (
|
||||||
|
<div className="app">
|
||||||
|
<FolderLock strokeWidth={1} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default App;
|
||||||
15
docs/guide/basics/examples/stroke-width-icon/files.ts
Normal file
15
docs/guide/basics/examples/stroke-width-icon/files.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import App from './App.js?raw'
|
||||||
|
import styles from '../styles.css?raw'
|
||||||
|
|
||||||
|
const files = {
|
||||||
|
'App.js': {
|
||||||
|
code: App,
|
||||||
|
active: true,
|
||||||
|
},
|
||||||
|
'styles.css': {
|
||||||
|
code:styles,
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export default files
|
||||||
50
docs/guide/basics/examples/styles.css
Normal file
50
docs/guide/basics/examples/styles.css
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
body {
|
||||||
|
font-family: sans-serif;
|
||||||
|
-webkit-font-smoothing: auto;
|
||||||
|
-moz-font-smoothing: auto;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
font-smoothing: auto;
|
||||||
|
text-rendering: optimizeLegibility;
|
||||||
|
font-smooth: always;
|
||||||
|
-webkit-tap-highlight-color: transparent;
|
||||||
|
-webkit-touch-callout: none;
|
||||||
|
background: #202127;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin: 0;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
html,
|
||||||
|
body {
|
||||||
|
height: 100%;
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 18px;
|
||||||
|
padding: 10px 20px;
|
||||||
|
line-height: 24px;
|
||||||
|
gap: 8px;
|
||||||
|
border-radius: 24px;
|
||||||
|
outline: none;
|
||||||
|
border: none;
|
||||||
|
background: #111;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
background: #F56565;
|
||||||
|
}
|
||||||
|
|
||||||
|
.app {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 32px;
|
||||||
|
}
|
||||||
87
docs/guide/basics/sizing.md
Normal file
87
docs/guide/basics/sizing.md
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
<script setup>
|
||||||
|
import { Sandpack } from 'sandpack-vue3'
|
||||||
|
import sandpackTheme from '../../.vitepress/theme/sandpackTheme.json'
|
||||||
|
import sizeIconExample from './examples/size-icon-example/files.ts'
|
||||||
|
import sizeIconCssExample from './examples/size-icon-css-example/files.ts'
|
||||||
|
import sizeIconFontExample from './examples/size-icon-font-example/files.ts'
|
||||||
|
import sizeIconTailwind from './examples/size-icon-tailwind-example/files.ts'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
# Sizing
|
||||||
|
|
||||||
|
By default, the size of all icons is `24px` by `24px`. The size is adjustable using the `size` prop and CSS.
|
||||||
|
|
||||||
|
## Adjusting the icon size using the `size` prop
|
||||||
|
|
||||||
|
<Sandpack
|
||||||
|
template="react"
|
||||||
|
:theme="sandpackTheme"
|
||||||
|
:files="sizeIconExample"
|
||||||
|
:customSetup='{
|
||||||
|
dependencies: {
|
||||||
|
"lucide-react": "latest"
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
:options="{
|
||||||
|
editorHeight: 300,
|
||||||
|
editorWidthPercentage: 60,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
## Adjusting the icon size via CSS
|
||||||
|
|
||||||
|
The CSS properties `width` and `height` can be used to adjust the icon size.
|
||||||
|
|
||||||
|
<Sandpack
|
||||||
|
template="react"
|
||||||
|
:theme="sandpackTheme"
|
||||||
|
:files="sizeIconCssExample"
|
||||||
|
:customSetup='{
|
||||||
|
dependencies: {
|
||||||
|
"lucide-react": "latest"
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
:options="{
|
||||||
|
editorHeight: 300,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
### Dynamically change the icon size based on the font size
|
||||||
|
|
||||||
|
It is possible to resize icons based on font size. This can be achieved using the `em` unit. See this [MDN article](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size#ems) for more information on the `em` unit.
|
||||||
|
|
||||||
|
<Sandpack
|
||||||
|
template="react"
|
||||||
|
:theme="sandpackTheme"
|
||||||
|
:files="sizeIconFontExample"
|
||||||
|
:customSetup='{
|
||||||
|
dependencies: {
|
||||||
|
"lucide-react": "latest"
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
:options="{
|
||||||
|
editorHeight: 300,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
### Resizing with Tailwind
|
||||||
|
|
||||||
|
`h-*` and `w-*` utilities can be used to adjust the size of the icon.
|
||||||
|
|
||||||
|
<Sandpack
|
||||||
|
template="react"
|
||||||
|
:theme="sandpackTheme"
|
||||||
|
:files="sizeIconTailwind"
|
||||||
|
:customSetup='{
|
||||||
|
dependencies: {
|
||||||
|
"lucide-react": "latest",
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
:options="{
|
||||||
|
externalResources: ['https://cdn.tailwindcss.com'],
|
||||||
|
editorHeight: 300,
|
||||||
|
editorWidthPercentage: 60,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- Code Example -->
|
||||||
60
docs/guide/basics/stroke-width.md
Normal file
60
docs/guide/basics/stroke-width.md
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<script setup>
|
||||||
|
import { Sandpack } from 'sandpack-vue3'
|
||||||
|
import sandpackTheme from '../../.vitepress/theme/sandpackTheme.json'
|
||||||
|
import strokeWidth from './examples/stroke-width-icon/files.ts'
|
||||||
|
import absoluteStrokeWidth from './examples/absolute-stroke-width-icon/files.ts'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
# Stroke width
|
||||||
|
|
||||||
|
All icons are designed with SVG elements using strokes.
|
||||||
|
These have a default stroke width of `2px`.
|
||||||
|
|
||||||
|
The `strokeWidth` can be adjusted to create a different look of the icons.
|
||||||
|
|
||||||
|
## Adjusting stroke width with `strokeWidth` prop
|
||||||
|
|
||||||
|
|
||||||
|
<Sandpack
|
||||||
|
template="react"
|
||||||
|
:theme="sandpackTheme"
|
||||||
|
:files="strokeWidth"
|
||||||
|
:customSetup='{
|
||||||
|
dependencies: {
|
||||||
|
"lucide-react": "latest"
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
:options="{
|
||||||
|
editorHeight: 300,
|
||||||
|
editorWidthPercentage: 60,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
## Absolute stroke width
|
||||||
|
|
||||||
|
When adjusting the `size` prop the size of the stroke width will be relative to the size of the icon, this is the default SVG behavior. The `absoluteStrokeWidth` prop is introduced to adjust this behavior to make the stroke width constant no matter the size of the icon.
|
||||||
|
|
||||||
|
This means that when `absoluteStrokeWidth` is enabled and the `size` of the icons is set to `48px` the `strokeWidth` will still be `2px` on the screen.
|
||||||
|
|
||||||
|
Note `2px` is the default stroke width for a Lucide icon, this can be adjusted to all sizes.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### Adjusting stroke width with `absoluteStrokeWidth` prop
|
||||||
|
|
||||||
|
Setting `absoluteStrokeWidth` to `true` will make the stroke width absolute.
|
||||||
|
|
||||||
|
<Sandpack
|
||||||
|
template="react"
|
||||||
|
:theme="sandpackTheme"
|
||||||
|
:files="absoluteStrokeWidth"
|
||||||
|
:customSetup='{
|
||||||
|
dependencies: {
|
||||||
|
"lucide-react": "latest"
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
:options="{
|
||||||
|
editorHeight: 320,
|
||||||
|
editorWidthPercentage: 60,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
@@ -2,60 +2,113 @@
|
|||||||
title: Icon Design Guide
|
title: Icon Design Guide
|
||||||
---
|
---
|
||||||
|
|
||||||
# Icon Design Principles
|
## Icon Design Principles
|
||||||
|
|
||||||
Here are rules that should be followed to keep quality and consistency when making icons for Lucide.
|
Here are rules that should be followed to keep quality and consistency when making icons for Lucide.
|
||||||
|
|
||||||
## Summary of the rules we have
|
### 1. Icons must be designed on a **24 by 24 pixels** canvas.
|
||||||
|
|
||||||
1. Icons must be designed on a **24 by 24 pixels** canvas.
|
|
||||||
2. Icons must have at least **1 pixel padding** within the canvas.
|
|
||||||
3. Icons must have a **stroke width of 2 pixels**.
|
|
||||||
4. Icons must use **round joins**.
|
|
||||||
5. Icons must use **round caps**.
|
|
||||||
6. Icons must use **centered strokes**.
|
|
||||||
7. Shapes (such as rectangles) in icons must have **border radius of 2 pixels**.
|
|
||||||
8. Distinct elements must have **2 pixels of spacing between each other**.
|
|
||||||
|
|
||||||
## The Rules Visualized
|
|
||||||
|
|
||||||
### 1. Icons must be designed on a 24 by 24 pixels canvas.
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 2. Icons must have at least 1 pixel padding within the canvas.
|
### 2. Icons must have at least **1 pixel padding** within the canvas.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 3. Icons must have a stroke width of 2 pixels.
|
### 3. Icons must have a **stroke width of 2 pixels**.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 4. Icons must use round joins.
|
### 4. Icons must use **round joins**.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 5. Icons must use round caps.
|
### 5. Icons must use **round caps**.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 6. Icons must use centered strokes.
|
### 6. Icons must use **centered strokes**.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 7. Shapes (such as squares) in icons must have border radius of 2 pixels.
|
### 7. Shapes (such as rectangles) must have a **border radius of**
|
||||||
|
|
||||||
|
#### A. **2 pixels** if they are at least 8 pixels in size
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 8. Distinct elements must have 2 pixels of spacing between each other.
|
#### B. **1 pixel** if they are smaller than 8 pixels in size
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 8. Distinct elements must have **2 pixels of spacing between each other**
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
### 9. Icons should have a similar optical volume to `circle` and `square`.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**Tip:** place your icon next to circle or square and blur them both; your icon should not feel much darker than the base shape.
|
||||||
|
|
||||||
|
### 10. Icons should be visually centered by their center of gravity.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**Tip:** place your icon both above/below and next to the square or circle icon and check if it feels off center. Symmetrical icons should always be aligned to the center.
|
||||||
|
|
||||||
|
### 11. Icons should have similar visual density and level of detail.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**Tip:** try to make abstractions to dense elements. Blur your icon, and when blurred it should not feel overly dark.
|
||||||
|
|
||||||
|
### 12. Continuous curves should join smoothly.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**Tip:** make sure to use arcs or quadratic curves, when using cubic curves control points should have mirrored angles for smooth curves.
|
||||||
|
|
||||||
|
### 13. Icons should aim to be pixel perfect so that they will be sharp on low DPI displays.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**Tip:** whenever possible align elements and arc centers to the grid.
|
||||||
|
|
||||||
|
## Naming conventions
|
||||||
|
|
||||||
|
1. Icon names use lower kebab case.\
|
||||||
|
For example: `arrow-up` instead of `Arrow Up`.
|
||||||
|
|
||||||
|
2. Icon names use International English names, as opposed to local variants.\
|
||||||
|
For example: `color` instead of `colour`.
|
||||||
|
|
||||||
|
3. Icons should be named for what they depict rather than their use case or what they represent.\
|
||||||
|
For example: `floppy-disk` instead of `save` and `circle-slash` rather than `ban`.
|
||||||
|
|
||||||
|
4. Icons that are part of a group are named `<group>-<variant>`.\
|
||||||
|
For example: `badge-plus` is based on `badge`.
|
||||||
|
|
||||||
|
5. Icon names for alternate icons should represent what makes the alternate unique instead of being numbered.\
|
||||||
|
For example: `send-horizontal` instead of `send-2`.
|
||||||
|
|
||||||
|
6. Names containing numerals are not allowed, unless the number itself is represented in the icon.\
|
||||||
|
For example: `arrow-down-0-to-1` contains both numerals.
|
||||||
|
|
||||||
## Code Conventions
|
## Code Conventions
|
||||||
|
|
||||||
Before an icon is added to the library, we like to have readable and optimized svg code.
|
Before an icon is added to the library, we like to have readable and optimized SVG code.
|
||||||
|
|
||||||
Never use [`<use>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/use). While it may sometimes seem like a good way to optimize file size, there's no way to ensure that the referenced element IDs will be unique once the SVGs are embedded in HTML documents.
|
|
||||||
|
|
||||||
### Global Attributes
|
### Global Attributes
|
||||||
|
|
||||||
@@ -79,11 +132,26 @@ For each icon these attributes are applied, corresponding to the above rules.
|
|||||||
|
|
||||||
### Minify paths
|
### Minify paths
|
||||||
|
|
||||||
Code of paths can get really big.
|
The code of paths can sometimes get quite large. To reduce file size we like to minify the code.
|
||||||
To reduce file size we like to minify the code.
|
We recommend to use the [SVGOMG](https://jakearchibald.github.io/svgomg/) to minify paths to 2 points of precision.
|
||||||
We recommend to use the [SVGOMG](https://jakearchibald.github.io/svgomg/) to minify paths.
|
|
||||||
|
|
||||||
### JSON metadata descriptor
|
### Allowed elements
|
||||||
|
|
||||||
|
SVG files may only contain simple path and shape elements, which may not have any attributes other than sizing and spacing.\
|
||||||
|
In practice only the following elements and attributes are allowed:
|
||||||
|
* `<path d>`
|
||||||
|
* `<line x1 x2>`
|
||||||
|
* `<polygon points>`
|
||||||
|
* `<polyline points>`
|
||||||
|
* `<circle cx cy r>`
|
||||||
|
* `<ellipse cx cy rx ry>`
|
||||||
|
* `<rect x y width height rx>`
|
||||||
|
|
||||||
|
This also means that no transforms, filters, fills or explicit strokes are allowed.
|
||||||
|
|
||||||
|
Never use [`<use>`](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/use). While it may sometimes seem like a good way to optimize file size, there's no way to ensure that the referenced element IDs will be unique once the SVGs are embedded in HTML documents.
|
||||||
|
|
||||||
|
## JSON metadata descriptor
|
||||||
|
|
||||||
Each icon added must also come with a matching JSON file listing tags and categories for the icon.
|
Each icon added must also come with a matching JSON file listing tags and categories for the icon.
|
||||||
Please use the following template:
|
Please use the following template:
|
||||||
@@ -91,6 +159,10 @@ Please use the following template:
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"$schema": "../icon.schema.json",
|
"$schema": "../icon.schema.json",
|
||||||
|
"contributors": [
|
||||||
|
"github-username",
|
||||||
|
"another-github-username"
|
||||||
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"foo",
|
"foo",
|
||||||
"bar"
|
"bar"
|
||||||
|
|||||||
@@ -14,15 +14,15 @@ The Illustrator template is created following guidelines from the [Icon Design G
|
|||||||
|
|
||||||
**Workflow:**
|
**Workflow:**
|
||||||
|
|
||||||
1. Download and open the [Illustrator template](https://github.com/lucide-icons/lucide/blob/main/docs/templates/illustrator_template.ai).
|
1. Download and open the [Illustrator template](https://github.com/lucide-icons/lucide/blob/main/docs/public/templates/illustrator_template.ai).
|
||||||
|
|
||||||
2. You can now remove the content from the example logo layer ("Draw") and start creating.
|
2. You can now remove the content from the example logo layer ("Draw") and start creating.
|
||||||
|
|
||||||
3. Verify that you follow the [Icon Design Guidelines](icon-design-guide.md).
|
3. Verify that you follow the [Icon Design Guidelines](icon-design-guide.md).
|
||||||
|
|
||||||
4. Before you export the file as an SVG make sure to check that you followed the guidelines and remove all unecessary layers (especially "Padding" and "Grid").
|
4. Before you export the file as an SVG make sure to check that you followed the guidelines and remove all unnecessary layers (especially "Padding" and "Grid").
|
||||||
|
|
||||||
5. Export the file with the export menu under: `Export > Export As..` than safe the file as SVG. Select the following options in the SVG Options dialog:
|
5. Export the file with the export menu under: `Export > Export As..` then save the file as SVG. Select the following options in the SVG Options dialog:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
1
docs/guide/how-to-use-icons.md
Normal file
1
docs/guide/how-to-use-icons.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
# How to use icons
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# lucide_icons
|
|
||||||
|
|
||||||
Lucide Icons ([lucide.dev](https://lucide.dev)) for Flutter. Visit the website for the full list of icons
|
|
||||||
|
|
||||||
## Example
|
|
||||||
```dart
|
|
||||||
Icon(LucideIcons.activity);
|
|
||||||
```
|
|
||||||
@@ -26,9 +26,9 @@ npm install lucide-preact
|
|||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
|
||||||
It's build with ES Modules so it's completely tree-shakable.
|
Lucide is built with ES Modules, so it's completely tree-shakable.
|
||||||
|
|
||||||
Each icon can be imported as a Preact component, what renders a inline SVG Element. This way only the icons that are imported into your project are included in the final bundle. The rest of the icons are tree-shaken away.
|
Each icon can be imported as a Preact component, which renders an inline SVG element. This way, only the icons that are imported into your project are included in the final bundle. The rest of the icons are tree-shaken away.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ export default App;
|
|||||||
|
|
||||||
### Applying props
|
### Applying props
|
||||||
|
|
||||||
To apply custom props to change the look of the icon, this can be done by simply pass them as props to the component. All SVG attributes are available as props to style the SVGs. See the list of SVG Presentation Attributes on [MDN](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Presentation).
|
To customize the appearance of an icon, you can pass custom properties as props directly to the component. The component accepts all SVG attributes as props, which allows flexible styling of the SVG elements. See the list of SVG Presentation Attributes on [MDN](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Presentation).
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
// Usage
|
// Usage
|
||||||
@@ -69,10 +69,10 @@ const App = () => {
|
|||||||
|
|
||||||
## One generic icon component
|
## One generic icon component
|
||||||
|
|
||||||
It is possible to create one generic icon component to load icons. It's not recommended.
|
It is possible to create one generic icon component to load icons, but it is not recommended.
|
||||||
|
|
||||||
::: danger
|
::: danger
|
||||||
Example below importing all ES Modules, caution using this example. All icons will be imported. When using bundlers like: `Webpack`, `Rollup` or `Vite` the application build size will grow strongly and harming the performance the application.
|
The example below imports all ES Modules, so exercise caution when using it. Importing all icons will significantly increase the build size of the application, negatively affecting its performance. This is especially important when using bundlers like `Webpack`, `Rollup`, or `Vite`.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### Icon Component Example
|
### Icon Component Example
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Implementation of the lucide icon library for React Native applications
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
First, ensure that you have `react-native-svg@^12.0.0` installed. Then, install the package:
|
First, ensure that you have `react-native-svg` (version between 12 and 14) installed. Then, install the package:
|
||||||
|
|
||||||
::: code-group
|
::: code-group
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ export default App;
|
|||||||
|
|
||||||
### Applying props
|
### Applying props
|
||||||
|
|
||||||
To apply custom props to change the look of the icon, this can be done by simply pass them as props to the component.
|
To customize the appearance of an icon, you can pass custom properties as props directly to the component. The component accepts all SVG attributes as props, which allows flexible styling of the SVG elements.
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
// Usage
|
// Usage
|
||||||
@@ -63,10 +63,10 @@ const App = () => {
|
|||||||
|
|
||||||
## One generic icon component
|
## One generic icon component
|
||||||
|
|
||||||
It is possible to create one generic icon component to load icons.
|
It is possible to create one generic icon component to load icons, but it is not recommended.
|
||||||
|
|
||||||
::: warning
|
::: warning
|
||||||
Example below importing all ES Modules, caution using this example. All icons will be imported. When using bundlers like: `Webpack`, `Rollup` or `Vite` the application build size will grow strongly and harming the performance the application.
|
The example below imports all ES Modules, so exercise caution when using it. Importing all icons will significantly increase the build size of the application, negatively affecting its performance. This is especially important to keep in mind when using bundlers like `Webpack`, `Rollup`, or `Vite`.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### Icon Component Example
|
### Icon Component Example
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ npm install lucide-react
|
|||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
|
||||||
It's build with ES Modules so it's completely tree-shakable.
|
Lucide is built with ES Modules, so it's completely tree-shakable.
|
||||||
|
|
||||||
Each icon can be imported as a React component, what renders a inline SVG Element. This way only the icons that are imported into your project are included in the final bundle. The rest of the icons are tree-shaken away.
|
Each icon can be imported as a React component, which renders an inline SVG element. This way, only the icons that are imported into your project are included in the final bundle. The rest of the icons are tree-shaken away.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ export default App;
|
|||||||
|
|
||||||
### Applying props
|
### Applying props
|
||||||
|
|
||||||
To apply custom props to change the look of the icon, this can be done by simply pass them as props to the component. All SVG attributes are available as props to style the SVGs. See the list of SVG Presentation Attributes on [MDN](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Presentation).
|
To customize the appearance of an icon, you can pass custom properties as props directly to the component. The component accepts all SVG attributes as props, which allows flexible styling of the SVG elements. See the list of SVG Presentation Attributes on [MDN](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Presentation).
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
// Usage
|
// Usage
|
||||||
@@ -63,10 +63,10 @@ const App = () => {
|
|||||||
|
|
||||||
## One generic icon component
|
## One generic icon component
|
||||||
|
|
||||||
It is possible to create one generic icon component to load icons. It's not recommended.
|
It is possible to create one generic icon component to load icons, but it is not recommended.
|
||||||
|
|
||||||
::: danger
|
::: danger
|
||||||
Example below importing all ES Modules, caution using this example. All icons will be imported. When using bundlers like: `Webpack`, `Rollup` or `Vite` the application build size will grow strongly and harming the performance the application.
|
The example below imports all ES Modules, so exercise caution when using it. Importing all icons will significantly increase the build size of the application, negatively affecting its performance. This is especially important to keep in mind when using bundlers like `Webpack`, `Rollup`, or `Vite`.
|
||||||
|
|
||||||
This is not the case for the latest NextJS, because it uses server side rendering. The icons will be streamed to the client when needed. For NextJS with Dynamic Imports, see [dynamic imports](#nextjs-example) section for more information.
|
This is not the case for the latest NextJS, because it uses server side rendering. The icons will be streamed to the client when needed. For NextJS with Dynamic Imports, see [dynamic imports](#nextjs-example) section for more information.
|
||||||
:::
|
:::
|
||||||
@@ -99,9 +99,7 @@ export default App;
|
|||||||
|
|
||||||
#### With Dynamic Imports
|
#### With Dynamic Imports
|
||||||
|
|
||||||
> :warning: This is experimental and only works with bundlers that support dynamic imports.
|
Lucide react exports a dynamic import map `dynamicIconImports`, which is useful for applications that want to show icons dynamically by icon name. For example, when using a content management system with where icon names are stored in a database.
|
||||||
|
|
||||||
Lucide react exports a dynamic import map `dynamicIconImports`. Useful for applications that want to show icons dynamically by icon name. For example when using a content management system with where icon names are stored in a database.
|
|
||||||
|
|
||||||
When using client side rendering, it will fetch the icon component when it's needed. This will reduce the initial bundle size.
|
When using client side rendering, it will fetch the icon component when it's needed. This will reduce the initial bundle size.
|
||||||
|
|
||||||
@@ -134,7 +132,21 @@ export default Icon
|
|||||||
|
|
||||||
##### NextJS Example
|
##### NextJS Example
|
||||||
|
|
||||||
In NextJS [the dynamic function](https://nextjs.org/docs/pages/building-your-application/optimizing/lazy-loading#nextdynamic) can be used to load the icon component dynamically.
|
In NextJS, [the dynamic function](https://nextjs.org/docs/pages/building-your-application/optimizing/lazy-loading#nextdynamic) can be used to dynamically load the icon component.
|
||||||
|
|
||||||
|
To make dynamic imports work with NextJS, you need to add `lucide-react` to the [`transpilePackages`](https://nextjs.org/docs/app/api-reference/next-config-js/transpilePackages) option in your `next.config.js` like this:
|
||||||
|
|
||||||
|
```js
|
||||||
|
/** @type {import('next').NextConfig} */
|
||||||
|
const nextConfig = {
|
||||||
|
transpilePackages: ['lucide-react'] // add this
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = nextConfig
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
You can then start using it:
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
import dynamic from 'next/dynamic'
|
import dynamic from 'next/dynamic'
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ npm install lucide-solid
|
|||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
|
||||||
It's build with ES Modules so it's completely tree-shakable.
|
Lucide is built with ES Modules, so it's completely tree-shakable.
|
||||||
|
|
||||||
Each icon can be imported as a Solid component, what renders a inline SVG Element. This way only the icons that are imported into your project are included in the final bundle. The rest of the icons are tree-shaken away.
|
Each icon can be imported as a Solid component, which renders an inline SVG element. This way, only the icons that are imported into your project are included in the final bundle. The rest of the icons are tree-shaken away.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ export default App;
|
|||||||
|
|
||||||
### Applying props
|
### Applying props
|
||||||
|
|
||||||
To apply custom props to change the look of the icon, this can be done by simply pass them as props to the component. All SVG attributes are available as props to style the SVGs. See the list of SVG Presentation Attributes on [MDN](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Presentation).
|
To customize the appearance of an icon, you can pass custom properties as props directly to the component. The component accepts all SVG attributes as props, which allows flexible styling of the SVG elements. See the list of SVG Presentation Attributes on [MDN](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Presentation).
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
// Usage
|
// Usage
|
||||||
@@ -66,7 +66,7 @@ const App = () => {
|
|||||||
It is possible to create one generic icon component to load icons. It's not recommended.
|
It is possible to create one generic icon component to load icons. It's not recommended.
|
||||||
|
|
||||||
::: danger
|
::: danger
|
||||||
Example below importing all ES Modules, caution using this example. All icons will be imported. When using bundlers like: `Webpack`, `Rollup` or `Vite` the application build size will grow strongly and harming the performance the application.
|
The example below imports all ES Modules, so exercise caution when using it. Importing all icons will significantly increase the build size of the application, negatively affecting its performance. This is especially important to keep in mind when using bundlers like `Webpack`, `Rollup`, or `Vite`.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### Icon Component Example
|
### Icon Component Example
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ npm install lucide-svelte
|
|||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
|
||||||
It's build with ES Modules so it's completely tree-shakable.
|
Lucide is built with ES Modules, so it's completely tree-shakable.
|
||||||
|
|
||||||
Each icon can be imported as a Svelte component, what renders a inline SVG Element. This way only the icons that are imported into your project are included in the final bundle. The rest of the icons are tree-shaken away.
|
Each icon can be imported as a Svelte component, which renders an inline SVG element. This way, only the icons that are imported into your project are included in the final bundle. The rest of the icons are tree-shaken away.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ Additional props can be passed to adjust the icon:
|
|||||||
|
|
||||||
### Applying props
|
### Applying props
|
||||||
|
|
||||||
To apply custom props to change the look of the icon, this can be done by simply pass them as props to the component. All SVG attributes are available as props to style the SVGs. See the list of SVG Presentation Attributes on [MDN](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Presentation).
|
To customize the appearance of an icon, you can pass custom properties as props directly to the component. The component accepts all SVG attributes as props, which allows flexible styling of the SVG elements. See the list of SVG Presentation Attributes on [MDN](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/Presentation).
|
||||||
|
|
||||||
```svelte
|
```svelte
|
||||||
<script>
|
<script>
|
||||||
@@ -73,10 +73,10 @@ This results a filled phone icon.
|
|||||||
|
|
||||||
## One generic icon component
|
## One generic icon component
|
||||||
|
|
||||||
It is possible to create one generic icon component to load icons. It's not recommended.
|
It is possible to create one generic icon component to load icons, but it is not recommended.
|
||||||
|
|
||||||
::: danger
|
::: danger
|
||||||
Example below importing all ES Modules, caution using this example. All icons will be imported. When using bundlers like: `Webpack`, `Rollup` or `Vite` the application build size will grow strongly and harming the performance the application.
|
The example below imports all ES Modules, so exercise caution when using it. Importing all icons will significantly increase the build size of the application, negatively affecting its performance. This is especially important when using bundlers like `Webpack`, `Rollup`, or `Vite`.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### Icon Component Example
|
### Icon Component Example
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user