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

Update JavaScript package to support 24px icons #445

Merged
merged 4 commits into from
Jun 10, 2020
Merged

Conversation

colebemis
Copy link
Contributor

@colebemis colebemis commented Jun 8, 2020

Problem

As part of the Octicons refresh project, we designed a set of 24px icons—as well as 16px icons—to accommodate interfaces that need larger icons. With the addition of this 24px grid size, we no longer have a 1-to-1 mapping of icon name to SVG file.

Solution

The structure of each icon object has been updated to allow support multiple SVGs per icon:

Before

octicons.alert
// {
//     symbol: 'alert',
//     keywords: ['warning', 'triangle', 'exclamation', 'point'],
//     toSVG: [Function],
//     width: 16,
//     height: 16,
//     path: '<path d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/>',
//     options: {
//         version: '1.1',
//         width: '16',
//         height: '16',
//         viewBox: '0 0 16 16',
//         class: 'octicon octicon-alert',
//         'aria-hidden': 'true'
//     },
// }

After

octicons.alert
// {
//     symbol: 'alert',
//     keywords: ['warning', 'triangle', 'exclamation', 'point'],
//     toSVG: [Function]
//     heights: {
//         16: {
//             width: 16,
//             path: '<path d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/>',
//             options: {
//                 version: '1.1',
//                 width: '16',
//                 height: '16',
//                 viewBox: '0 0 16 16',
//                 class: 'octicon octicon-alert',
//                 'aria-hidden': 'true'
//             },
//         },
//         24: ...
//     }
// }

@vercel
Copy link

vercel bot commented Jun 8, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/primer/octicons/g6pmvxm6r
✅ Preview: https://octicons-git-update-node-package.primer.now.sh

@colebemis colebemis marked this pull request as ready for review June 10, 2020 18:32
@colebemis colebemis requested a review from jonrohan June 10, 2020 18:32
Copy link
Member

@jonrohan jonrohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, thanks for doing this 👍 and for the tests.

@colebemis colebemis merged commit dcc6a36 into v2 Jun 10, 2020
@colebemis colebemis deleted the update-node-package branch June 10, 2020 22:00
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.

3 participants