From bf6a8bffdc5554941d3c14fe4f1c27c4d827e802 Mon Sep 17 00:00:00 2001 From: Tancredi Trugenberger Date: Mon, 8 Feb 2021 21:08:35 +0000 Subject: [PATCH] fix: Update readme with directory namespacing --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index 640d89ec..4f660254 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,36 @@ generateFonts({ }).then(results => console.log(results)); ``` +#### Organising icons + +Icon names and className will be generated from a slug of the relative path + basename of each `.svg` file found in the input directory. + +This allows arranging your icons in namespaces, which can be useful if a project uses a large number of icons. + +Considering the following `./icons` input directory: + +``` +icons +├── logo.svg +├── social +│ ├── facebook.svg +│ └── twitter.svg +└── symbol + └── chevron + ├── left.svg + └── right.svg +``` + +Running `fantasticon ./icons -o dist` will generate a font-set with the following Icon IDs / CSS selectors: +And the generated icon IDs would be: + +| Icon ID | CSS selector | +| ---------------------- | ---------------------------- | +| `social-facebook` | `.icon.icon-social-facebook` | +| `social-twitter` | `.icon.icon-social-twitter` | +| `symbol-chevron-left` | `.icon.icon-chevron-left` | +| `symbol-chevron-right` | `.icon.icon-chevron-right` | + ### Contribute PRs are always welcome. If you need help questions, want to bounce ideas or just say hi, [join the Discord channel](https://discord.gg/BXAY3Kc3mp).