Add customization options to the icon display and download (#113)

* feat: ability to customize icons before downloading PNG or SVG

* feat: change color input to be a graphical color picker

* feat: tweak appearance of new inputs

* fix: switch to correct Chakra-UI@Next slider syntax

* fix: make default color `currentColor` and also add Reset button
This commit is contained in:
Frank Riccobono
2020-10-31 07:53:25 -04:00
committed by GitHub
parent f3c3fea228
commit 51fd3af446
11 changed files with 437 additions and 38 deletions

View File

@@ -1,5 +1,6 @@
import fs from "fs";
import path from "path";
import cheerio from 'cheerio';
import tags from '../../../tags.json';
const directory = path.join(process.cwd(), "../icons");
@@ -16,10 +17,14 @@ export function getData(name) {
const fullPath = path.join(directory, `${name}.svg`);
const fileContents = fs.readFileSync(fullPath, "utf8");
const $ = cheerio.load(fileContents);
const content = $("svg").html();
return {
name,
tags: tags[name] || [],
src: fileContents,
content: content
};
}