Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25d7b55459 | ||
|
|
4d8a8091b6 | ||
|
|
a17c1aafbd | ||
|
|
d1d6eec36e | ||
|
|
abec311bc9 | ||
|
|
3df9be04a8 | ||
|
|
016c9d1fac | ||
|
|
17f9509f71 | ||
|
|
b6c7434e92 |
89
.github/workflows/pull-request.yml
vendored
@@ -22,8 +22,78 @@ jobs:
|
||||
uses: tj-actions/changed-files@v35
|
||||
with:
|
||||
files: icons/*.svg
|
||||
- name: Generate comment
|
||||
id: generate-comment
|
||||
- name: Generate cohesion check random
|
||||
id: generate-cohesion-check-random
|
||||
run: |
|
||||
delimiter="$(openssl rand -hex 8)"
|
||||
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
||||
for file in $(printf "%s\\n" icons/*.svg | shuf | head -n$(awk -F' ' '{print NF}' <<< '${{ steps.changed-files.outputs.all_changed_files }}')); 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/stroke-width/2/&.svg\"/> |"
|
||||
done | tr '\n' ' ' >> $GITHUB_OUTPUT
|
||||
echo >> $GITHUB_OUTPUT
|
||||
echo "$delimiter" >> $GITHUB_OUTPUT
|
||||
- name: Generate cohesion check squares
|
||||
id: generate-cohesion-check-squares
|
||||
run: |
|
||||
delimiter="$(openssl rand -hex 8)"
|
||||
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
||||
for file in $(printf "%s\\n" icons/*square*.svg | shuf | head -n$(awk -F' ' '{print NF}' <<< '${{ steps.changed-files.outputs.all_changed_files }}')); 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/stroke-width/2/&.svg\"/> |"
|
||||
done | tr '\n' ' ' >> $GITHUB_OUTPUT
|
||||
echo >> $GITHUB_OUTPUT
|
||||
echo "$delimiter" >> $GITHUB_OUTPUT
|
||||
- name: Generate 1px stroke-width
|
||||
id: generate-1px-stroke-width
|
||||
run: |
|
||||
delimiter="$(openssl rand -hex 8)"
|
||||
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
||||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; 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/stroke-width/1/&.svg\"/> |"
|
||||
done | tr '\n' ' ' >> $GITHUB_OUTPUT
|
||||
echo >> $GITHUB_OUTPUT
|
||||
echo "$delimiter" >> $GITHUB_OUTPUT
|
||||
- name: Generate 2px stroke-width
|
||||
id: generate-2px-stroke-width
|
||||
run: |
|
||||
delimiter="$(openssl rand -hex 8)"
|
||||
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
||||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; 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/stroke-width/2/&.svg\"/> |"
|
||||
done | tr '\n' ' ' >> $GITHUB_OUTPUT
|
||||
echo >> $GITHUB_OUTPUT
|
||||
echo "$delimiter" >> $GITHUB_OUTPUT
|
||||
- name: Generate 3px stroke-width
|
||||
id: generate-3px-stroke-width
|
||||
run: |
|
||||
delimiter="$(openssl rand -hex 8)"
|
||||
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
||||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; 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/stroke-width/3/&.svg\"/> |"
|
||||
done | tr '\n' ' ' >> $GITHUB_OUTPUT
|
||||
echo >> $GITHUB_OUTPUT
|
||||
echo "$delimiter" >> $GITHUB_OUTPUT
|
||||
- name: Generate X-rays
|
||||
id: generate-x-rays
|
||||
run: |
|
||||
delimiter="$(openssl rand -hex 8)"
|
||||
echo "body<<$delimiter" >> $GITHUB_OUTPUT
|
||||
@@ -50,8 +120,21 @@ jobs:
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body: |
|
||||
### Added or changed icons
|
||||
${{ steps.generate-2px-stroke-width.outputs.body }}<br/>
|
||||
<details>
|
||||
<summary>Preview cohesion</summary>
|
||||
${{ steps.generate-cohesion-check-squares.outputs.body }}<br/>
|
||||
${{ steps.generate-2px-stroke-width.outputs.body }}<br/>
|
||||
${{ steps.generate-cohesion-check-random.outputs.body }}<br/>
|
||||
</details>
|
||||
<details>
|
||||
<summary>Preview stroke widths</summary>
|
||||
${{ steps.generate-1px-stroke-width.outputs.body }}<br/>
|
||||
${{ steps.generate-2px-stroke-width.outputs.body }}<br/>
|
||||
${{ steps.generate-3px-stroke-width.outputs.body }}<br/>
|
||||
</details>
|
||||
<details>
|
||||
<summary>Icon X-rays</summary>
|
||||
${{ steps.generate-comment.outputs.body }}
|
||||
${{ steps.generate-x-rays.outputs.body }}
|
||||
</details>
|
||||
edit-mode: replace
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<circle cx="17" cy="12" r="3" />
|
||||
<line x1="14" x2="14" y1="7" y2="15" />
|
||||
<circle cx="7" cy="12" r="3" />
|
||||
<line x1="10" x2="10" y1="9" y2="15" />
|
||||
<path d="M10 9v6" />
|
||||
<circle cx="17" cy="12" r="3" />
|
||||
<path d="M14 7v8" />
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 361 B After Width: | Height: | Size: 323 B |
@@ -9,8 +9,8 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<polyline points="3,15 7,7 11,15" />
|
||||
<line x1="4" x2="10" y1="13" y2="13" />
|
||||
<path d="m3 15 4-8 4 8" />
|
||||
<path d="M4 13h6" />
|
||||
<circle cx="18" cy="12" r="3" />
|
||||
<line x1="21" x2="21" y1="9" y2="15" />
|
||||
<path d="M21 9v6" />
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 366 B After Width: | Height: | Size: 318 B |
@@ -9,8 +9,7 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<polyline points="3,15 7,7 11,15" />
|
||||
<line x1="4" x2="10" y1="13" y2="13" />
|
||||
<path d="M15 7h4c1.1 0 2 .9 2 2s-.9 2-2 2h-4V7z" />
|
||||
<path d="M15 11h4.5c1.1 0 2 .9 2 2s-.9 2-2 2H15v-4z" />
|
||||
<path d="m3 15 4-8 4 8" />
|
||||
<path d="M4 13h6" />
|
||||
<path d="M15 11h4.5a2 2 0 0 1 0 4H15V7h4a2 2 0 0 1 0 4" />
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 401 B After Width: | Height: | Size: 321 B |
@@ -4,7 +4,11 @@
|
||||
"pending",
|
||||
"dot",
|
||||
"progress",
|
||||
"issue"
|
||||
"issue",
|
||||
"radio button",
|
||||
"choices",
|
||||
"multiple choice",
|
||||
"choose"
|
||||
],
|
||||
"categories": [
|
||||
"shapes"
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<rect width="7" height="9" x="3" y="3" />
|
||||
<rect width="7" height="5" x="14" y="3" />
|
||||
<rect width="7" height="9" x="14" y="12" />
|
||||
<rect width="7" height="5" x="3" y="16" />
|
||||
<rect width="7" height="9" x="3" y="3" rx="1" />
|
||||
<rect width="7" height="5" x="14" y="3" rx="1" />
|
||||
<rect width="7" height="9" x="14" y="12" rx="1" />
|
||||
<rect width="7" height="5" x="3" y="16" rx="1" />
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 388 B After Width: | Height: | Size: 416 B |
@@ -9,8 +9,8 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<rect width="7" height="7" x="3" y="3" />
|
||||
<rect width="7" height="7" x="14" y="3" />
|
||||
<rect width="7" height="7" x="14" y="14" />
|
||||
<rect width="7" height="7" x="3" y="14" />
|
||||
<rect width="7" height="7" x="3" y="3" rx="1" />
|
||||
<rect width="7" height="7" x="14" y="3" rx="1" />
|
||||
<rect width="7" height="7" x="14" y="14" rx="1" />
|
||||
<rect width="7" height="7" x="3" y="14" rx="1" />
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 388 B After Width: | Height: | Size: 416 B |
@@ -9,8 +9,8 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<rect width="7" height="7" x="3" y="14" />
|
||||
<rect width="7" height="7" x="3" y="3" />
|
||||
<rect width="7" height="7" x="3" y="14" rx="1" />
|
||||
<rect width="7" height="7" x="3" y="3" rx="1" />
|
||||
<line x1="14" x2="21" y1="4" y2="4" />
|
||||
<line x1="14" x2="21" y1="9" y2="9" />
|
||||
<line x1="14" x2="21" y1="15" y2="15" />
|
||||
|
||||
|
Before Width: | Height: | Size: 465 B After Width: | Height: | Size: 479 B |
13
icons/layout-panel-left.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "../icon.schema.json",
|
||||
"tags": [
|
||||
"app",
|
||||
"home",
|
||||
"start",
|
||||
"grid"
|
||||
],
|
||||
"categories": [
|
||||
"design",
|
||||
"layout"
|
||||
]
|
||||
}
|
||||
15
icons/layout-panel-left.svg
Normal file
@@ -0,0 +1,15 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<rect width="7" height="18" x="3" y="3" rx="1" />
|
||||
<rect width="7" height="7" x="14" y="3" rx="1" />
|
||||
<rect width="7" height="7" x="14" y="14" rx="1" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 365 B |
15
icons/layout-panel-top.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "../icon.schema.json",
|
||||
"tags": [
|
||||
"window",
|
||||
"webpage",
|
||||
"block",
|
||||
"section",
|
||||
"grid",
|
||||
"template",
|
||||
"structure"
|
||||
],
|
||||
"categories": [
|
||||
"layout"
|
||||
]
|
||||
}
|
||||
15
icons/layout-panel-top.svg
Normal file
@@ -0,0 +1,15 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<rect width="18" height="7" x="3" y="3" rx="1" />
|
||||
<rect width="7" height="7" x="3" y="14" rx="1" />
|
||||
<rect width="7" height="7" x="14" y="14" rx="1" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 365 B |
@@ -9,7 +9,7 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M21 3H3v7h18V3z" />
|
||||
<path d="M21 14h-5v7h5v-7z" />
|
||||
<path d="M12 14H3v7h9v-7z" />
|
||||
<rect width="18" height="7" x="3" y="3" rx="1" />
|
||||
<rect width="9" height="7" x="3" y="14" rx="1" />
|
||||
<rect width="5" height="7" x="16" y="14" rx="1" />
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 304 B After Width: | Height: | Size: 365 B |
18
icons/pi.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"$schema": "../icon.schema.json",
|
||||
"tags": [
|
||||
"constant",
|
||||
"code",
|
||||
"coding",
|
||||
"programming",
|
||||
"symbol",
|
||||
"trigonometry",
|
||||
"geometry",
|
||||
"formula"
|
||||
],
|
||||
"categories": [
|
||||
"development",
|
||||
"maths",
|
||||
"shapes"
|
||||
]
|
||||
}
|
||||
15
icons/pi.svg
Normal file
@@ -0,0 +1,15 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<line x1="9" x2="9" y1="4" y2="20" />
|
||||
<path d="M4 7c0-1.7 1.3-3 3-3h13" />
|
||||
<path d="M18 20c-1.7 0-3-1.3-3-3V4" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 328 B |
@@ -4,7 +4,9 @@
|
||||
"sum",
|
||||
"calculate",
|
||||
"formula",
|
||||
"maths"
|
||||
"maths",
|
||||
"enumeration",
|
||||
"enumerate"
|
||||
],
|
||||
"categories": [
|
||||
"text",
|
||||
|
||||
@@ -9,5 +9,5 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<polyline points="22,17 22,19 2,19 2,17" />
|
||||
<path d="M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1" />
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 254 B After Width: | Height: | Size: 266 B |
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"$schema": "../icon.schema.json",
|
||||
"tags": [
|
||||
"stars",
|
||||
"effect",
|
||||
"filter",
|
||||
"night",
|
||||
"sparkles",
|
||||
"magic"
|
||||
],
|
||||
"categories": [
|
||||
@@ -13,5 +13,8 @@
|
||||
"multimedia",
|
||||
"gaming",
|
||||
"weather"
|
||||
],
|
||||
"aliases": [
|
||||
"stars"
|
||||
]
|
||||
}
|
||||
|
Before Width: | Height: | Size: 481 B After Width: | Height: | Size: 481 B |
@@ -1,8 +1,11 @@
|
||||
{
|
||||
"$schema": "../icon.schema.json",
|
||||
"tags": [
|
||||
"equilateral",
|
||||
"delta",
|
||||
"shape"
|
||||
"shape",
|
||||
"pyramid",
|
||||
"hierarchy"
|
||||
],
|
||||
"categories": [
|
||||
"shapes"
|
||||
|
||||
19
icons/variable.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"$schema": "../icon.schema.json",
|
||||
"tags": [
|
||||
"code",
|
||||
"coding",
|
||||
"programming",
|
||||
"symbol",
|
||||
"calculate",
|
||||
"algebra",
|
||||
"x",
|
||||
"parentheses",
|
||||
"parenthesis",
|
||||
"brackets"
|
||||
],
|
||||
"categories": [
|
||||
"development",
|
||||
"maths"
|
||||
]
|
||||
}
|
||||
16
icons/variable.svg
Normal file
@@ -0,0 +1,16 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M8 21s-4-3-4-9 4-9 4-9" />
|
||||
<path d="M16 3s4 3 4 9-4 9-4 9" />
|
||||
<line x1="15" x2="9" y1="9" y2="15" />
|
||||
<line x1="9" x2="15" y1="9" y2="15" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 365 B |
@@ -9,9 +9,9 @@
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<circle cx="17" cy="12" r="3" />
|
||||
<line x1="14" x2="14" y1="7" y2="15" />
|
||||
<circle cx="7" cy="12" r="3" />
|
||||
<line x1="10" x2="10" y1="9" y2="15" />
|
||||
<polyline points="22,17 22,19 2,19 2,17" />
|
||||
<path d="M10 9v6" />
|
||||
<circle cx="17" cy="12" r="3" />
|
||||
<path d="M14 7v8" />
|
||||
<path d="M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1" />
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 407 B After Width: | Height: | Size: 381 B |
@@ -77,7 +77,7 @@
|
||||
"zone.js": "~0.11.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/common": "13.x - 15.x",
|
||||
"@angular/core": "13.x - 15.x"
|
||||
"@angular/common": "13.x - 16.x",
|
||||
"@angular/core": "13.x - 16.x"
|
||||
}
|
||||
}
|
||||
|
||||
29
site/src/pages/api/gh-icon/stroke-width/[...data].tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import { parseSync } from 'svgson';
|
||||
import { createLucideIcon, IconNode } from 'lucide-react';
|
||||
|
||||
export default async function handler(req, res) {
|
||||
// ReactDOMServer needs to be imported dynamically
|
||||
// https://github.com/vercel/next.js/issues/43810
|
||||
const ReactDOMServer = (await import('react-dom/server')).default;
|
||||
|
||||
const url = req.url.split('/');
|
||||
const src = Buffer.from(url.at(-1).slice(0, -4), 'base64').toString('utf8');
|
||||
|
||||
const Icon = createLucideIcon(
|
||||
'icon',
|
||||
parseSync(src.includes('<svg') ? src : `<svg>${src}</svg>`).children.map(
|
||||
({ name, attributes }) => [name, attributes]
|
||||
) as IconNode
|
||||
);
|
||||
|
||||
const svg = Buffer.from(
|
||||
ReactDOMServer.renderToString(<Icon strokeWidth={url.at(-2)} />).replace(
|
||||
/>/,
|
||||
'><style>@media screen and (prefers-color-scheme: dark) { svg { stroke: #fff } }</style>'
|
||||
)
|
||||
);
|
||||
|
||||
res.setHeader('Cache-Control', 'public,max-age=31536000');
|
||||
res.setHeader('Content-Type', 'image/svg+xml');
|
||||
res.status(200).end(svg);
|
||||
}
|
||||