-
Notifications
You must be signed in to change notification settings - Fork 2
feat(website): Phosphor icon system + mobile nav fix #843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9dcc004
feat(website): replace emoji icons with Phosphor SVGs, fix mobile nav
claude 1789915
fix(website): address Gemini review + add changelog entry
claude 6e483a0
fix(website): clear mobile scroll-lock on viewport resize
claude ef410f3
fix(website): fix duplicate SVG attributes and add missing-icon warning
claude 5efcbb5
refactor(website): extract TRACK_ICONS to lib/learn.ts, fix ag-type-i…
claude e021698
chore(changelog): add issue #844 link to Phosphor icons + mobile nav …
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| --- | ||
| import { readFileSync } from "node:fs"; | ||
| import { fileURLToPath } from "node:url"; | ||
|
|
||
| interface Props { | ||
| name: string; | ||
| size?: number; | ||
| weight?: "regular" | "bold" | "fill" | "light" | "thin"; | ||
| class?: string; | ||
| } | ||
|
|
||
| const { name, size = 24, weight = "regular", class: className } = Astro.props; | ||
|
|
||
| let svgContent = ""; | ||
| try { | ||
| const svgPath = fileURLToPath( | ||
| import.meta.resolve(`@phosphor-icons/core/assets/${weight}/${name}.svg`), | ||
| ); | ||
| const raw = readFileSync(svgPath, "utf-8"); | ||
| svgContent = raw | ||
| .replace(/\bwidth="\d+"/, `width="${size}"`) | ||
| .replace(/\bheight="\d+"/, `height="${size}"`); | ||
| } catch (err) { | ||
| console.warn(`[Icon.astro] Missing Phosphor icon: "${weight}/${name}"`, err); | ||
| svgContent = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" width="${size}" height="${size}" fill="currentColor"></svg>`; | ||
| } | ||
| --- | ||
|
|
||
| <span class:list={["ph-icon", className]} aria-hidden="true" set:html={svgContent} /> | ||
|
|
||
| <style> | ||
| .ph-icon { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| flex-shrink: 0; | ||
| line-height: 1; | ||
| } | ||
|
|
||
| .ph-icon svg { | ||
| display: block; | ||
| } | ||
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a visitor opens the drawer at ≤768px and then rotates/resizes to desktop, this inline
overflow: hiddenremains onbodywhile the hamburger is hidden by the media query, so the desktop page can become unscrollable until the user happens to press Escape or follows a nav link. Please add a resize/media-query cleanup path, or only apply the lock while the mobile query still matches.Useful? React with 👍 / 👎.