37 Commits

Author SHA1 Message Date
rektdeckard
00b67a25ff feat(app): add ko-fi to banner and FUNDING.yaml 2025-01-10 21:35:48 -07:00
rektdeckard
596ef0bc85 fix(ci): don't assume file encoding 2024-12-29 21:57:53 -07:00
rektdeckard
13248a3270 chore(ci): make sure to create synced files
...and intermediate directories if they don't already exist
2024-12-29 21:50:35 -07:00
rektdeckard
6d2358ffe7 feat(ci): remove meta folders 2024-12-29 21:30:48 -07:00
rektdeckard
e28695fcd2 feat(ci): sync additional files 2024-12-29 21:30:48 -07:00
rektdeckard
d05dd19606 chore(docs): adjust logo 2024-12-29 21:30:48 -07:00
rektdeckard
1635d050ea feat(docs): add community links and owner prefix 2024-12-29 21:30:48 -07:00
rektdeckard
a93f137fd3 chore(sketch): don't include unzipped asset 2024-12-29 01:09:41 -07:00
rektdeckard
bf1433a612 chore(app): use relative urls so testing and preview are live 2024-12-29 01:09:41 -07:00
rektdeckard
72486d8ba0 chore(sketch): update plugin bundle 2024-12-29 01:09:41 -07:00
rektdeckard
315c9df6de chore(docs): add penpot (#672) 2024-12-29 01:09:41 -07:00
rektdeckard
09461de291 chore(docs): sort links (mostly) alphabetically 2024-12-29 01:09:41 -07:00
rektdeckard
cf552f45fb chore(ci): re-disable except for readme changes on master 2024-12-29 01:09:41 -07:00
rektdeckard
bafb374af4 feat(ci): enable all repos and include link in PR 2024-12-29 01:09:41 -07:00
rektdeckard
31595b49cf chore(ci): allow synced repos to not have sections 2024-12-29 01:09:41 -07:00
rektdeckard
1f1b3450c1 fix(ci): use default branch 2024-12-29 01:09:41 -07:00
rektdeckard
3f25a8aa88 chore(ci): use matrix for repo list 2024-12-29 01:09:41 -07:00
rektdeckard
74811edda7 fix(ci): correct lockfile name 2024-12-29 01:09:41 -07:00
rektdeckard
a5e6f10b04 chore(ci): temporarily run on all path changes 2024-12-29 01:09:41 -07:00
rektdeckard
288f4466c5 chore(ci): tweak commit msg 2024-12-29 01:09:41 -07:00
rektdeckard
b6d47ab575 fix(ci): use repos list 2024-12-29 01:09:41 -07:00
rektdeckard
a4421c82b2 feat(ci): create doc PRs, maybe? 2024-12-29 01:09:41 -07:00
rektdeckard
5a390a9231 chore(meta): consistent yaml extensions lol 2024-12-29 01:09:41 -07:00
rektdeckard
625dc776d5 feat(ci): set up preview and prod deployments 2024-12-29 01:09:41 -07:00
rektdeckard
b99c50d61f chore(docs): use explicit version in icon font example (#657) 2024-12-23 22:22:23 -07:00
rektdeckard
363e86fada fix(a11y): use buttons for grid items 2024-12-05 00:55:13 -07:00
Quang Phan
72b6fe088f docs: add link to phosphor-icons-tailwindcss 2024-11-15 01:42:10 -07:00
Jason Pepas
97ac81b0c1 add pepaslabs/phosphor-uikit to README 2024-10-11 15:28:33 -06:00
Tobias Fried
090f4fe1fb chore(funding): native bmac 2024-09-30 00:49:20 -06:00
Tobias Fried
710518cdaa fix(docs): correct webfont usage 2024-09-17 14:41:15 -06:00
adamglin
1a8a7aefd6 Add compose-phosphor-icon 2024-08-22 14:06:22 -06:00
rektdeckard
443545f18b feat(app): update companies mentioned in footer 2024-06-10 12:51:12 -06:00
rektdeckard
83763a2beb fix(app): better color input appearance in Firefox 2024-06-10 12:49:45 -06:00
rektdeckard
dd3fc59e02 fix(app): update vue snippet syntax 2024-06-04 11:06:26 -06:00
rektdeckard
b376d2517e chore(docs): use admonitions 2024-05-02 13:03:00 -06:00
Ignace Maes
91fee139e8 docs: link to Ember package 2024-05-02 10:20:57 -06:00
Tobias Fried
f608c6ea4f feat(meta): add nucleo exporter 2024-04-25 22:27:55 -06:00
21 changed files with 65099 additions and 1023 deletions

5
.github/FUNDING.yaml vendored Normal file
View File

@@ -0,0 +1,5 @@
# Thanks for considering supporting this project! 🎉
github: [phosphor-icons, rektdeckard]
patreon: phosphoricons
buy_me_a_coffee: phosphoricons
ko_fi: phosphoricons

3
.github/FUNDING.yml vendored
View File

@@ -1,3 +0,0 @@
github: [phosphor-icons, rektdeckard]
patreon: phosphoricons
custom: ["https://www.buymeacoffee.com/phosphoricons"]

BIN
.github/logo.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,54 @@
name: Build and deploy to preview
on:
push
concurrency:
group: 'preview'
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Install sshpass
run: sudo apt-get install -y sshpass
- name: Add SSH Key to known_hosts
env:
KNOWN_HOSTS_ENTRY: ${{ secrets.DREAMHOST_KNOWN_HOSTS_ENTRY }}
HOST: ${{ secrets.HOST }}
run: |
mkdir -p ~/.ssh
echo "$KNOWN_HOSTS_ENTRY" >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
- name: Build static site
run: pnpm build
- name: Deploy via rsync and sshpass
env:
USERNAME: ${{ secrets.DREAMHOST_FTP_USERNAME }}
PASSWORD: ${{ secrets.DREAMHOST_FTP_PASSWORD }}
HOST: ${{ secrets.DREAMHOST_FTP_HOST }}
DEPLOY_PATH: preview.phosphoricons.com
run: |
sshpass -p "$PASSWORD" rsync -avz --delete ./dist/* $USERNAME@$HOST:$DEPLOY_PATH

56
.github/workflows/dreamhost-static.yaml vendored Normal file
View File

@@ -0,0 +1,56 @@
name: Build and deploy to production
on:
push:
branches:
- master
concurrency:
group: 'prod'
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Install sshpass
run: sudo apt-get install -y sshpass
- name: Add SSH Key to known_hosts
env:
KNOWN_HOSTS_ENTRY: ${{ secrets.DREAMHOST_KNOWN_HOSTS_ENTRY }}
HOST: ${{ secrets.HOST }}
run: |
mkdir -p ~/.ssh
echo "$KNOWN_HOSTS_ENTRY" >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
- name: Build static site
run: pnpm build
- name: Deploy via rsync and sshpass
env:
USERNAME: ${{ secrets.DREAMHOST_FTP_USERNAME }}
PASSWORD: ${{ secrets.DREAMHOST_FTP_PASSWORD }}
HOST: ${{ secrets.DREAMHOST_FTP_HOST }}
DEPLOY_PATH: phosphoricons.com
run: |
sshpass -p "$PASSWORD" rsync -avz --delete ./dist/* $USERNAME@$HOST:$DEPLOY_PATH

100
.github/workflows/sync-docs.yaml vendored Normal file
View File

@@ -0,0 +1,100 @@
name: Sync documentation
on:
push:
paths:
- 'README.md'
- '.github/FUNDING.yaml'
- '.github/logo.png'
branches:
- master
workflow_dispatch: # Allows manual triggering
concurrency:
group: 'docs'
cancel-in-progress: true
jobs:
sync-docs:
runs-on: ubuntu-latest
strategy:
matrix:
repository: [
'phosphor-icons/core',
'phosphor-icons/figma',
'phosphor-icons/flutter',
'phosphor-icons/penpot',
'phosphor-icons/phosphor-elm',
'phosphor-icons/play',
'phosphor-icons/react',
'phosphor-icons/sketch',
'phosphor-icons/swift',
'phosphor-icons/theme',
'phosphor-icons/unplugin',
'phosphor-icons/vue',
'phosphor-icons/web',
'phosphor-icons/webcomponents'
]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: source-repo
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: source-repo/pnpm-lock.yaml
- name: Install dependencies
working-directory: source-repo
run: pnpm install
- name: Sync to target repositories
env:
GITHUB_TOKEN: ${{ secrets.SYNC_PAT }}
run: |
echo "Syncing to ${{ matrix.repository }}"
# Get the source repository name and commit info
COMMIT_URL="https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}"
# Clone target repository using HTTPS with token
git clone "https://x-access-token:${GITHUB_TOKEN}@github.com/${{ matrix.repository }}.git" target-repo
# Run sync script
cd source-repo
pnpm run sync-docs -- target-repo
cd ..
# Create PR if there are changes
cd target-repo
if [[ -n "$(git status --porcelain)" ]]; then
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Create branch
BRANCH="sync-readme-$(date +%Y%m%d-%H%M%S)"
git checkout -b $BRANCH
# Commit and push changes
git add .
git commit -am "chore(docs): sync readme section"
git push "https://x-access-token:${GITHUB_TOKEN}@github.com/${{ matrix.repository }}.git" $BRANCH
# Create PR using the GitHub CLI
gh pr create \
--repo "${{ matrix.repository }}" \
--title "chore(docs): sync readme section" \
--body "Automated PR to sync README section. This change originates from the following commit: ${COMMIT_URL}". \
--base $(git remote show origin | sed -n '/HEAD branch/s/.*: //p') \
--head $BRANCH
fi

View File

@@ -1,7 +1,10 @@
<img src="/meta/phosphor-mark-tight-black.png" width="96" align="right" />
# Phosphor Icons
<!-- BEGIN_LOGO -->
<img src="/.github/logo.png" width="128" align="right" />
<!-- END_LOGO -->
<!-- BEGIN_OVERVIEW -->
Phosphor is a flexible icon family for interfaces, diagrams, presentations — whatever, really.
- 1,248 icons and counting
@@ -10,6 +13,7 @@ Phosphor is a flexible icon family for interfaces, diagrams, presentations — w
- Raw stroke information retained to fine-tune the style
More ways to use at [phosphoricons.com](https://phosphoricons.com).
<!-- END_OVERVIEW -->
## For developers
@@ -23,10 +27,10 @@ Phosphor is available for [web](https://github.com/phosphor-icons/web), [React](
<!doctype html>
<html>
<head>
<script src="https://unpkg.com/@phosphor-icons/web"></script>
<script src="https://unpkg.com/@phosphor-icons/web@2.1.1"></script>
</head>
<body>
<i class="ph-smiley"></i>
<i class="ph ph-smiley"></i>
<i class="ph-fill ph-heart" style="color: hotpink"></i>
<i class="ph-thin ph-cube"></i>
</body>
@@ -86,34 +90,56 @@ ReactDOM.render(<App />, document.getElementById("root"));
</script>
```
> **Note:** Due to possible namespace collisions with built-in HTML elements, compononent names in the Vue library are prefixed with `Ph`, but otherwise follow the same naming conventions. Both Pascal and kebab-case conventions can be used in templates.
> [!NOTE]
> Due to possible namespace collisions with built-in HTML elements, compononent names in the Vue library are prefixed with `Ph`, but otherwise follow the same naming conventions. Both Pascal and kebab-case conventions can be used in templates.
## Our Related Projects
<!-- BEGIN_LINKS -->
## Our Projects
- [@phosphor-icons/homepage](https://github.com/phosphor-icons/homepage) ▲ Phosphor homepage and general info
- [@phosphor-icons/core](https://github.com/phosphor-icons/core) ▲ Phosphor icon assets and catalog
- [@phosphor-icons/react](https://github.com/phosphor-icons/react) ▲ Phosphor icon component library for React
- [@phosphor-icons/web](https://github.com/phosphor-icons/web) ▲ Phosphor icons for Vanilla JS
- [@phosphor-icons/vue](https://github.com/phosphor-icons/vue) ▲ Phosphor icon component library for Vue
- [@phosphor-icons/elm](https://github.com/phosphor-icons/phosphor-elm) ▲ Phosphor icons for Elm
- [@phosphor-icons/flutter](https://github.com/phosphor-icons/flutter) ▲ Phosphor IconData library for Flutter
- [@phosphor-icons/webcomponents](https://github.com/phosphor-icons/webcomponents) ▲ Phosphor icons as Web Components
- [@phosphor-icons/figma](https://github.com/phosphor-icons/figma) ▲ Phosphor icons Figma plugin
- [@phosphor-icons/flutter](https://github.com/phosphor-icons/flutter) ▲ Phosphor IconData library for Flutter
- [@phosphor-icons/pack](https://github.com/phosphor-icons/pack) ▲ Phosphor web font stripper to generate minimal icon bundles
- [@phosphor-icons/penpot](https://github.com/phosphor-icons/penpot) ▲ Phosphor icons Penpot plugin
- [@phosphor-icons/react](https://github.com/phosphor-icons/react) ▲ Phosphor icon component library for React
- [@phosphor-icons/sketch](https://github.com/phosphor-icons/sketch) ▲ Phosphor icons Sketch plugin
- [@phosphor-icons/swift](https://github.com/phosphor-icons/swift) ▲ Phosphor icon component library for SwiftUI
- [@phosphor-icons/theme](https://github.com/phosphor-icons/theme) ▲ A VS Code (and other IDE) theme with the Phosphor color palette
- [@phosphor-icons/unplugin](https://github.com/phosphor-icons/theme) ▲ A multi-framework bundler plugin for generating Phosphor sprite sheets
- [@phosphor-icons/vue](https://github.com/phosphor-icons/vue) ▲ Phosphor icon component library for Vue
- [@phosphor-icons/web](https://github.com/phosphor-icons/web) ▲ Phosphor icons for Vanilla JS
- [@phosphor-icons/webcomponents](https://github.com/phosphor-icons/webcomponents) ▲ Phosphor icons as Web Components
## Community Projects
- [phosphor-react-native](https://github.com/duongdev/phosphor-react-native) ▲ Phosphor icon component library for React Native
- [phosphor-svelte](https://github.com/haruaki07/phosphor-svelte) ▲ Phosphor icons for Svelte apps
- [phosphor-r](https://github.com/dreamRs/phosphoricons) ▲ Phosphor icon wrapper for R documents and applications
- [blade-phosphor-icons](https://github.com/codeat3/blade-phosphor-icons) ▲ Phosphor icons in your Laravel Blade views
- [adamglin0/compose-phosphor-icons](https://github.com/adamglin0/compose-phosphor-icon) ▲ Phosphor icons for Compose Multiplatform
- [brettkolodny/phosphor-lustre](https://github.com/brettkolodny/phosphor-lustre) ▲ Phosphor icons for Lustre
- [cjohansen/phosphor-clj](https://github.com/cjohansen/phosphor-clj) ▲ Phosphor icons as Hiccup for Clojure and ClojureScript
- [codeat3/blade-phosphor-icons](https://github.com/codeat3/blade-phosphor-icons) ▲ Phosphor icons in your Laravel Blade views
- [dreamRs/phosphor-r](https://github.com/dreamRs/phosphoricons) ▲ Phosphor icon wrapper for R documents and applications
- [duongdev/phosphor-react-native](https://github.com/duongdev/phosphor-react-native) ▲ Phosphor icon component library for React Native
- [haruaki07/phosphor-svelte](https://github.com/haruaki07/phosphor-svelte) ▲ Phosphor icons for Svelte apps
- [IgnaceMaes/ember-phosphor-icons](https://github.com/IgnaceMaes/ember-phosphor-icons) ▲ Phosphor icons for Ember apps
- [lucagoslar/phosphor-css](https://github.com/lucagoslar/phosphor-css) ▲ CSS wrapper for Phosphor SVG icons
- [maful/ruby-phosphor-icons](https://github.com/maful/ruby-phosphor-icons) ▲ Phosphor icons for Ruby and Rails applications
- [meadowsys/phosphor-svgs](https://github.com/meadowsys/phosphor-svgs) ▲ Phosphor icons as Rust string constants
- [mwood/tamagui-phosphor-icons](https://github.com/mwood23/tamagui-phosphor-icons) ▲ Phosphor icons for Tamagui
- [oyedejioyewole/nuxt-phosphor-icons](https://github.com/oyedejioyewole/nuxt-phosphor-icons) ▲ Phosphor icons integration for Nuxt
- [pepaslabs/phosphor-uikit](https://github.com/pepaslabs/phosphor-uikit) ▲ Xcode asset catalog generator for Swift/UIKit
- [raycast/phosphor-icons](https://www.raycast.com/marinsokol/phosphor-icons) ▲ Phosphor icons Raycast extension
- [reatlat/eleventy-plugin-phosphoricons](https://github.com/reatlat/eleventy-plugin-phosphoricons) ▲ An Eleventy shortcode plugin to embed icons as inline SVGs
- [robruiz/wordpress-phosphor-icons-block](https://github.com/robruiz/phosphor-icons-block) ▲ Phosphor icon block for use in WordPress v5.8+
- [sachaw/solid-phosphor](https://github.com/sachaw/solid-phosphor) ▲ Phosphor icons for SolidJS
- [SeanMcP/phosphor-astro](https://github.com/SeanMcP/phosphor-astro) ▲ Phosphor icons as Astro components
- [SorenHolstHansen/phosphor-leptos](https://github.com/SorenHolstHansen/phosphor-leptos) ▲ Phosphor icon component library for Leptos apps (rust)
- [vnphanquang/phosphor-icons-tailwindcss](https://github.com/vnphanquang/phosphor-icons-tailwindcss) ▲ TailwindCSS plugin for Phosphor icons
- [wireui/phosphoricons](https://github.com/wireui/phosphoricons) ▲ Phosphor icons for Laravel
- [phosphor-css](https://github.com/lucagoslar/phosphor-css) ▲ CSS wrapper for Phosphor SVG icons
- [ruby-phosphor-icons](https://github.com/maful/ruby-phosphor-icons) ▲ Phosphor icons for Ruby and Rails applications
- [eleventy-plugin-phosphoricons](https://github.com/reatlat/eleventy-plugin-phosphoricons) ▲ An Eleventy plugin for add shortcode, allows Phosphor icons to be embedded as inline svg into templates
- [phosphor-leptos](https://github.com/SorenHolstHansen/phosphor-leptos) ▲ Phosphor icon component library for Leptos apps (rust)
If you've made a port of Phosphor and you want to see it here, just open a PR [here](https://github.com/phosphor-icons/homepage)!
## License
MIT © [Phosphor Icons](https://github.com/phosphor-icons)
<!-- END_LINKS -->

View File

@@ -1,6 +1,6 @@
{
"name": "@phosphor-icons/homepage",
"version": "2.0.6",
"version": "2.1.1",
"license": "MIT",
"homepage": "https://phosphoricons.com",
"author": {
@@ -20,12 +20,14 @@
],
"repository": "github:phosphor-icons/homepage",
"private": true,
"packageManager": "pnpm@9",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"format": "prettier --write \"./src/**/*.{js,jsx,ts,tsx,json,vue}\"",
"generate": "tsx scripts/generate.ts"
"generate": "tsx scripts/generate.ts",
"sync-docs": "tsx scripts/sync-docs.ts"
},
"dependencies": {
"@phosphor-icons/core": "^2.1.1",

2125
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
import path from "node:path";
import fs from "node:fs/promises";
import path from "node:path";
import { fileURLToPath } from "node:url";
import IconJar, { IconGroup, IconSet, Icon, License } from "iconjar-exporter";
import { icons, IconStyle } from "@phosphor-icons/core";
import IconJar, { IconGroup, IconSet, Icon, License } from "iconjar-exporter";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
@@ -23,6 +23,54 @@ abstract class Exporter {
}
}
class NucleoExporter implements Exporter {
static JSON_PATH = path.join(OUT_DIR, "./phosphor.nucleo.json");
static SET_ID = 1;
static data: {
sets: Array<{ label: string; id: number }>;
groups: Array<unknown>;
icons: Array<{
name: string;
content: string;
style: /* possibly just "outline" and "glyph" */ string;
tags: /* comma-separated, no spaces */ string;
set_id: number;
}>;
};
static async load(): Promise<void> {
NucleoExporter.data = {
sets: [{ label: "Phosphor Icons", id: NucleoExporter.SET_ID }],
groups: [],
icons: [],
};
for (const weight of Object.values(IconStyle)) {
for (const icon of icons) {
const name =
weight === "regular" ? icon.name : `${icon.name}-${weight}`;
const filePath = path.join(CORE_DIR, `${weight}/${name}.svg`);
const content = (await fs.readFile(filePath)).toString();
NucleoExporter.data.icons.push({
name,
content,
style: "outline",
tags: icon.tags.join(","),
set_id: NucleoExporter.SET_ID,
});
}
}
}
static async save(): Promise<void> {
await fs.writeFile(
NucleoExporter.JSON_PATH,
JSON.stringify(NucleoExporter.data)
);
}
}
class IconJarExporter implements Exporter {
static iconJar: IconJar;
static JAR_PATH = path.join(OUT_DIR, "./phosphor.iconjar");
@@ -68,7 +116,7 @@ class IconJarExporter implements Exporter {
}
(async function main() {
for (const exporter of [IconJarExporter]) {
for (const exporter of [IconJarExporter, NucleoExporter]) {
await exporter.load();
await exporter.save();
}

72
scripts/sync-docs.ts Normal file
View File

@@ -0,0 +1,72 @@
import fs from "node:fs";
import path from "node:path";
const README_PATH = "README.md";
const FUNDING_PATH = ".github/FUNDING.yaml";
const LOGO_PATH = ".github/logo.png";
const SYNC_SECTIONS = ["LOGO", "OVERVIEW", "LINKS"];
const SYNC_FILES: Array<string | Array<string>> = [
[FUNDING_PATH, ".github/FUNDING.yml"],
[LOGO_PATH, "meta"],
]; // These files will be replaced in the target repository
(function main() {
const targetRepo = process.argv[process.argv.length - 1];
if (!targetRepo) throw new Error("Target repository not provided");
const readmePath = path.resolve(__dirname, `../${README_PATH}`);
const readmeContent = fs.readFileSync(readmePath, "utf8");
const targetReadmePath = path.resolve(__dirname, `../../${targetRepo}/${README_PATH}`);
if (!fs.existsSync(targetReadmePath)) throw new Error(`README.md not found in ${targetRepo}`);
for (const section of SYNC_SECTIONS) {
const readmeSection = extractSection(readmeContent, section);
if (readmeSection) {
const targetReadmeContent = fs.readFileSync(targetReadmePath, "utf8");
const updatedDocsContent = updateSection(targetReadmeContent, section, readmeSection);
fs.writeFileSync(targetReadmePath, updatedDocsContent);
}
}
for (const file of SYNC_FILES) {
const fileName = Array.isArray(file) ? file[0] : file;
const filePath = path.resolve(__dirname, `../${fileName}`);
const fileContent = fs.readFileSync(filePath);
// If target file has aliases, remove them
if (Array.isArray(file)) {
for (const alias of file) {
const targetPath = path.resolve(__dirname, `../../${targetRepo}/${alias}`);
if (fs.existsSync(targetPath)) {
fs.rmSync(targetPath, { recursive: true });
}
}
}
// Write the target file and intermediate directories, or overwrite if it already exists
const targetPath = path.resolve(__dirname, `../../${targetRepo}/${fileName}`);
if (!fs.existsSync(path.dirname(targetPath))) {
fs.mkdirSync(path.dirname(targetPath), { recursive: true });
}
fs.writeFileSync(targetPath, fileContent);
}
})();
function extractSection(content: string, section: string) {
const pattern = new RegExp(
`<!-- BEGIN_${section} -->\n([\\s\\S]*)\n<!-- END_${section} -->`,
"g",
);
const match = pattern.exec(content);
return match?.[1];
}
function updateSection(content: string, section: string, newContent: string) {
const pattern = new RegExp(
`<!-- BEGIN_${section} -->\n([\\s\\S]*)\n<!-- END_${section} -->`,
"g",
);
return content.replace(pattern, `<!-- BEGIN_${section} -->\n${newContent}\n<!-- END_${section} -->`);
}

View File

@@ -48,6 +48,10 @@ body {
background-color: var(--acid);
}
::-moz-color-swatch {
border: none;
}
h2 {
font-weight: 400;
}

View File

@@ -65,6 +65,14 @@ const Footer = (_: FooterProps) => {
AllTrails
</a>
,{" "}
<a className="main-link" href="https://www.anthropic.com">
Anthropic
</a>
,{" "}
<a className="main-link" href="https://www.babbel.com/">
Babbel
</a>
,{" "}
<a
className="main-link"
href="https://www.dive.club/course/figma-academy"
@@ -76,8 +84,8 @@ const Footer = (_: FooterProps) => {
Framer
</a>
,{" "}
<a className="main-link" href="https://www.outgo.co/">
Outgo
<a className="main-link" href="https://www.khanacademy.org/">
Khan Academy
</a>
,{" "}
<a

View File

@@ -60,6 +60,10 @@ const Header = (_: HeaderProps) => {
We are now processing donations via{" "}
<a href="https://www.buymeacoffee.com/phosphoricons">
Buy Me a Coffee
</a>{" "}
and{" "}
<a href="https://ko-fi.com/phosphoricons">
Ko-fi
</a>
! Your one-time or recurring contribution does a lot to keep us
going. Please show us some support if you can!

View File

@@ -16,6 +16,8 @@
.grid-item {
display: flex;
appearance: none;
background: transparent;
box-sizing: border-box;
width: 160px;
height: 160px;

View File

@@ -68,11 +68,10 @@ const IconGridItem = (props: IconGridItemProps) => {
}, [originOffset]);
return (
<motion.div
<motion.button
className="grid-item"
key={name}
ref={ref}
tabIndex={0}
style={{
...style,
backgroundColor: isOpen ? "var(--background-layer)" : undefined,
@@ -80,7 +79,6 @@ const IconGridItem = (props: IconGridItemProps) => {
custom={delayRef}
transition={transition}
variants={itemVariants}
onKeyPress={(e) => e.key === "Enter" && handleOpen()}
onClick={handleOpen}
>
<Icon />
@@ -89,7 +87,7 @@ const IconGridItem = (props: IconGridItemProps) => {
{isNew && <span className="badge new"></span>}
{isUpdated && <span className="badge updated"></span>}
</p>
</motion.div>
</motion.button>
);
};

View File

@@ -5,7 +5,7 @@ import OutboundLink from "@/components/OutboundLink";
import "./Links.css";
interface LinksProps {}
interface LinksProps { }
const Links = (_: LinksProps) => {
return (
@@ -14,7 +14,7 @@ const Links = (_: LinksProps) => {
<ArrowElbowDownRight size={24} />
<OutboundLink
className="nav-link"
href="https://phosphoricons.com/assets/phosphor-icons.zip"
href="/assets/phosphor-icons.zip"
eventLabel="Download all"
download
type="application/zip"
@@ -45,7 +45,7 @@ const Links = (_: LinksProps) => {
<div>
<ArrowElbowDownRight size={24} />
<OutboundLink
href="https://phosphoricons.com/assets/phosphor-icons.sketchplugin.zip"
href="/assets/phosphor-icons.sketchplugin.zip"
eventLabel="Download sketch plugin"
download
type="application/zip"

View File

@@ -30,38 +30,29 @@ export function getCodeSnippets({
const { r, g, b } = TinyColor(color).toRgb();
return {
[SnippetType.HTML]: `<i class="ph${
isDefaultWeight ? "" : `-${weight}`
} ph-${name}"></i>`,
[SnippetType.REACT]: `<${displayName} size={${size}} ${
!isDefaultColor ? `color="${color}" ` : ""
}${isDefaultWeight ? "" : `weight="${weight}" `}/>`,
[SnippetType.VUE]: `<ph${displayName
.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2")
.toLowerCase()} :size="${size}" ${
!isDefaultColor ? `color="${color}" ` : ""
}${isDefaultWeight ? "" : `weight="${weight}" `}/>`,
[SnippetType.HTML]: `<i class="ph${isDefaultWeight ? "" : `-${weight}`
} ph-${name}"></i>`,
[SnippetType.REACT]: `<${displayName} size={${size}} ${!isDefaultColor ? `color="${color}" ` : ""
}${isDefaultWeight ? "" : `weight="${weight}" `}/>`,
[SnippetType.VUE]: `<Ph${displayName} :size="${size}" ${!isDefaultColor ? `color="${color}" ` : ""
}${isDefaultWeight ? "" : `weight="${weight}" `}/>`,
[SnippetType.FLUTTER]: `Icon(\n PhosphorIcons.${displayName.replace(
/^\w/,
(c) => c.toLowerCase()
)}${
isDefaultWeight ? "" : weight.replace(/^\w/, (c) => c.toUpperCase())
},\n size: ${size.toFixed(1)},\n${
!isDefaultColor ? ` color: Color(0xff${color.replace("#", "")}),\n` : ""
})`,
[SnippetType.ELM]: `Phosphor.${camelName}${
isDefaultWeight ? "" : " " + pascalWeight
}
)}${isDefaultWeight ? "" : weight.replace(/^\w/, (c) => c.toUpperCase())
},\n size: ${size.toFixed(1)},\n${!isDefaultColor ? ` color: Color(0xff${color.replace("#", "")}),\n` : ""
})`,
[SnippetType.ELM]: `Phosphor.${camelName}${isDefaultWeight ? "" : " " + pascalWeight
}
|> withSize ${size}
|> withSizeUnit "px"
|> toHtml []`,
[SnippetType.SWIFT]: `Ph.${camelName}.${weight}${
!isDefaultColor
[SnippetType.SWIFT]: `Ph.${camelName}.${weight}${!isDefaultColor
? `\n .color(red: ${u8ToCGFloatStr(r)}, green: ${u8ToCGFloatStr(
g
)}, blue: ${u8ToCGFloatStr(b)})`
g
)}, blue: ${u8ToCGFloatStr(b)})`
: ""
}
}
.frame(width: ${size}, height: ${size})
`,
};