photon-ant
Version:
Mozilla Photon styles for the Ant Design UI library
122 lines (118 loc) • 2.13 kB
JavaScript
// #TODO: Pull this list from the SVG files included with the package.
const availableIcons = [
'arrow-forward',
'arrow-left',
'arrowhead-down-bold',
'arrowhead-down',
'arrowhead-left-bold',
'arrowhead-left',
'arrowhead-right-bold',
'arrowhead-right',
'arrowhead-up-bold',
'arrowhead-up',
'available-updates',
'check',
'clipboard',
'clock',
'close-bold',
'close',
'copy',
'cursor-disabled',
'cursor',
'cut',
'delete',
'double-arrow-right',
'download-a',
'download',
'ellipsis',
'experiment',
'extension-update',
'extension',
'firefox',
'folder',
'forget',
'fullscreen-disabled',
'fullscreen-exit',
'fullscreen',
'help',
'home',
'info-hover',
'info-notice-hover',
'info-notice',
'info',
'key',
'laptop',
'legacy-extension',
'library',
'lightbulb',
'link',
'location-disabled-mac',
'location-disabled-win',
'location-disabled',
'location-mac',
'location-win',
'location',
'mail',
'menu',
'microphone-disabled',
'microphone',
'mobile',
'notification-disabled',
'open-dir',
'open-in-new',
'paintbrush',
'person',
'pin-outline',
'pin-remove',
'pin',
'plugin',
'plus',
'pocket-list',
'pocket',
'power-button',
'preferences',
'print',
'privatebrowsing',
'readermode',
'refresh',
'return-arrow',
'rss',
'save',
'screenshot',
'search',
'share-macos',
'share-windows',
'shield-disabled',
'shield',
'sidebar',
'star-filled',
'star-menu',
'star-outline',
'star-remove',
'stars',
'store-disabled',
'sync',
'tab-new',
'tab',
'video-recorder-disabled',
'video-recorder',
'warning',
'window-new',
'window',
'wrench'
];
const mappings = {};
const baseIndex = '9';
availableIcons.forEach((icon, idx) => {
// Icons are mapped in HEX, so we need to convert the base 10 counter before use.
let next = idx.toString(16);
if (next.length < 2) {
next = `0${next}`;
}
// This is the value that is output in the actual CSS.
mappings[icon] = `\\e${baseIndex}${next}`;
});
module.exports = {
icons: mappings,
iconList: availableIcons
};