1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-21 17:34:25 +04:00
Files
tabler/build/generate-font-codepoints.js
Damian Sznajder 497f238fd4 Apply eslint 🍪
2019-06-17 21:43:15 +02:00

21 lines
452 B
JavaScript

'use strict';
const fs = require('fs'),
path = require('path'),
yaml = require('yaml');
const data = fs.readFileSync(path.resolve(__dirname, '../scss/fonts/_tabler-webfont.scss'), 'utf8'),
re = /\$icon-([^\-\s]+)-([^:\s]+):\s'([^'\n]+)';/g;
let items = {};
data.replace(re, function(match, g1, g2, g3) {
if (!items[g1]) {
items[g1] = {};
}
items[g1][g2] = g3;
});
fs.writeFileSync('pages/_data/icons.yml', yaml.stringify(items));