Font icon repo for TheStreet As long as your file structure is the same as TST-NG these instructions should work otherwise editing the urls from the _font-icons.scss may be necessary
To manually add the font-icon library to a project:
- Download the entire font-icons dir containing the font files to the CMS-TAGS/grails-app/assets/stylesheets/fonts
- Download the _font-icons.scss to CMS-TAGS/grails-app/assets/stylesheets/styles/modules
- Commit and merge these changes in CMS-Tags project to your local branch (branch from develop), making sure you have incremented the Build.Config version number for CMS-TAGS then open a Pull Request for merge to develop branch
To install use npm:
- go to the vendor folder cms-tags/grails-app/assets/vendor
- run
npm install ks-fonticons
- The postinstall script will auto-overwrite the fonts and _font-icons.scss
- Commit and merge these changes in CMS-Tags project to your local branch (branch from develop), making sure you have incremented the Build.Config version number for CMS-TAGS then open a Pull Request for merge to develop branch
There two main steps to udating the font library
- Update the library master files which will handle the adding or deleteing of font icons
- Update the gh-pages branch which will update the font-icon reference page of the font style-guide
- Download the selection.json file from this github repo
- Upload the selection.json file to icomoon.io app
- Add, edit or delete fonts (keep in mind the fonts are named the same as that of the svg file name used so please follow these conventions:
- Use dashes instead of underscores when naming svg files
- All fonts are prefixed with "font-icons-" so please refrain from using these words in the name ie: "share-icon" becomes "font-icon-share-icon" there fore better naming conventions would be: "share.svg" or share-arrow.svg"
- Then click "Generate Font"
After downloading the newly created font there are four files or sets of files to be concerned with:
- style.css (will become _font-icons.scss and font-icons.css)
- demo.html (will become index.html for the gh-pages)
- selection.json (will replace initial selection.json)
- package.json (from this repo to increment the version number)
- four font files inside the fonts directory
- From the resulting files locate the style.css file and the fonts dir
- Edit the resulting style.css to match the _font-icons.scss file and rename it as _font-icons.scss
-
To edit the style.css simply make sure the font face declaration at the top of the page matches:
@font-face { font-family: 'font-icons'; src: url('../fonts/font-icons/font-icons.eot?trcws1'); src: url('../fonts/font-icons/font-icons.eot?trcws1#iefix') format('embedded-opentype'), url('../fonts/font-icons/font-icons.ttf?trcws1') format('truetype'), url('../fonts/font-icons/font-icons.woff?trcws1') format('woff'), url('../fonts/font-icons/font-icons.svg?trcws1#font-icons') format('svg'); font-weight: normal; font-style: normal; }
- After cloning a local repo for ks-font-icons
- Upload the new _font-icons.sccs to the assets dir of the master branch of this repo (ks-fonticons)
- Upload the new font files in the new fonts folder to the dir fonts/fonticons/ of the master branch of this repo (ks-fonticons)
- Be sure to increment the version number of the repo in the package json (you can simply do this by editing the package.json from the repo editor
- In the terminal on your machine navigate to the ks-fonticons local repo
- From this dir run
$ npm publish
to update the registry to the new package version number - At this point update the project by refering to the instructions above "Adding font-icons font to your project"
- First locate the demo.html and update the head info
<head> <meta charset="utf-8"> <title>Font Icons</title> <meta name="description" content="An Icon set for the street"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="assets/demo.css"> <link rel="stylesheet" href="assets/font-icons.css"></head>
- Then remove the test code at the bottom
what appears between:<!--[if gt IE 8]><!-->
AND<!--<![endif]-->
as well as the demo-script.js and icomoon link
- Rename the demo.html file to index.html
- Now locate the _font-icons.scss file you uploaded to this the master branch of the repo and duplicate it and rename the dupe: font-icons.css
- Then upload both files as well as all the new fonts to gh-pages branch of ks-fonticons repo, note though that the font-icons.css goes into the assets folder and the fonts go into the fonts/font-icons/ folder
- After committing to gh-pages branch the styleguide will be updated.
- You can see the showcase page for the new fonts you just edited here: https://dondmcg.github.io/
- Just click the dropdown and select "Font-icons"