mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-27 21:05:53 +00:00
This is a maintenance commit with no released build.
* Added: `npm run font` command for editing the Fontello icon font. Use it to get started, then start the development server with `npm start` and changes will automatically save when you click `Export Font` from Fontello. * Changed: The list of Fontello icons is now extracted from our Fontello config file so that it doesn't have to be manually updated.
This commit is contained in:
parent
1c0f7edab5
commit
38c87840af
23 changed files with 1502 additions and 166 deletions
24
bin/update_fonts.js
Normal file
24
bin/update_fonts.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const dir = 'styles/fontello';
|
||||
|
||||
for(const file of fs.readdirSync(dir)) {
|
||||
if ( file.endsWith('.css') ) {
|
||||
const old_path = path.join(dir, file),
|
||||
new_path = `${old_path.substr(0, old_path.length - 4)}.scss`;
|
||||
|
||||
fs.renameSync(old_path, new_path);
|
||||
}
|
||||
}
|
||||
|
||||
const config = JSON.parse(fs.readFileSync('fontello.config.json', 'utf8'));
|
||||
const icons = config.glyphs.map(x => x.css);
|
||||
|
||||
fs.writeFileSync('src/utilities/ffz-icons.js', `'use strict';
|
||||
// This is a generated file. To update it, please run: npm run font:update
|
||||
/* eslint quotes: 0 */
|
||||
|
||||
export default ${JSON.stringify(icons, null, '\t')};`);
|
Loading…
Add table
Add a link
Reference in a new issue