Skip to content
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

[v4] [icons] fix: use stable codepoints #5153

Merged
merged 2 commits into from
Mar 2, 2022
Merged

Conversation

adidahiya
Copy link
Contributor

Fixes #5150

Changes proposed in this pull request:

Add existing codepoints to icons.json using a one-time script like this:

// packages/icons/scripts/add-codepoints.js

const fs = require("fs");
const path = require("path");

const iconsMetadata = require("../icons.json");
const { IconCodepoints } = require("../lib/cjs/iconCodepoints");

for (const icon of iconsMetadata) {
    icon.codepoint = parseInt(IconCodepoints[icon.iconName], 10);
}

const newMetadata = JSON.stringify(iconsMetadata, undefined, 4);

fs.writeFileSync(path.resolve(__dirname, "../icons-new.json"), newMetadata);

And update scripts/generate-icon-fonts.js to pass along the codepoints to fantasticon so that they are stable when new icons are added.

@blueprint-bot
Copy link

fix formatting

Previews: documentation | landing | table | modern colors demo

@adidahiya adidahiya merged commit 7b19363 into next Mar 2, 2022
@adidahiya adidahiya deleted the ad/v4-fix-codepoints branch March 2, 2022 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants