VFF - Vendasta Frontend Framework
===============

Provides reusible components for building Vendasta web pages.  This project has been superceded by
[FrontEndCentral](http://www.github.com/vendasta/FrontEndCentral).  However, some projects still exclusively use VFF and
it is still updated regularly.

The reference page for this framework is available at http://cdnstyles.com/styles/

---

#### Tips and Tricks

##### Adding New Icons (Fonts)

There are four **font files** in the ``` src/static/fonts ``` directory which house VFF's icons.  These are: 
- platform_icons.eot
- platform_icons.svg
- platform_icons.ttf
- platform_icons.woff

These files are created via http://icomoon.io and are generally provided by someone from the design team.  If you
receive files having different names (``` Vendasta.svg ```, for example) simply rename them to ``` platform_icons ``` 
and replace the old files in VFF.

Once you have added the new **font files** to VFF, you will need to update ``` app.views.style_guide.IconHandler ``` to
be able to identify them.

To accomplish this, open up the ``` platform_icons.svg ``` file and take note of the glyph ``` unicode ``` values. 

##### Example:
```xml
<?xml version="1.0" standalone="no"?>  
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >  
<svg xmlns="http://www.w3.org/2000/svg">  
<metadata>Generated by IcoMoon</metadata>  
<defs>  
<font id="VendAsta" horiz-adv-x="1024">  
<font-face units-per-em="1024" ascent="960" descent="-64" />  
<missing-glyph horiz-adv-x="1024" />  
<glyph unicode="&#xe000;" glyph-name="home-icon" d="M832 544l-320 320-512-512v..." />  
<glyph unicode="&#xe001;" glyph-name="user-icon" d="M768 278.878c-115.926 65.208-149.632..." />  
<glyph unicode="&#xe002;" glyph-name="team-icon" d="M859.152 175.706c-99.238 55.822-128.094..." />  
<glyph unicode="&#xe003;" glyph-name="impersonate-icon" d="M348.822 464.964h62.848c-0.090 5.376..." />  
<glyph unicode="&#xe004;" glyph-name="add-user-icon" horiz-adv-x="1088" d="M436 224c0-57.376..." />  
<glyph unicode="&#xe600;" glyph-name="arrow-left-icon" d="M960 512h-672l224 192v128l-448-384..." />  
<glyph unicode="&#xe601;" glyph-name="asterisk-icon" d="M448 896h128v-896h-128v896zM156.012..." />  
<glyph unicode="&#xe602;" glyph-name="email-sent-icon" d="M896 960h-896l448.084-320.084zM0..." />  
<glyph unicode="&#xe603;" glyph-name="send-email-icon" d="M736.042 511.916c-158.954..." />  
<glyph unicode="&#xe800;" glyph-name="share-icon" d="M896 448v-256h-768v448h128l64..." />  
<glyph unicode="&#xe801;" glyph-name="notshared-icon" d="M800 384c-123.8 0-224-100.2-224-224..." />  
<glyph unicode="&#xe802;" glyph-name="shared-icon" d="M800 384c-123.8 0-224-100.2-224-224..." />  
</font></defs></svg> 
```

Notice that there are a couple of "ranges" of unicode values: **000-004**, **600-603**, and **800-802**

There are a couple of constants in ``` IconHandler ``` which will be set to these ranges. For this example, they would 
be:

```python
ICON_NUMBER_RANGE_V1_START = 0
ICON_NUMBER_RANGE_V1_END = 4
ICON_NUMBER_RANGE_V2_START = 600
ICON_NUMBER_RANGE_V2_END = 603
ICON_NUMBER_RANGE_V3_START = 800
ICON_NUMBER_RANGE_V3_END = 802
```

Additionally, you will need to add the new icon classes to both ``` src/templates/style_guide/components/icons.html ``` 
and ``` src/static/sass/partials/_icons.scss ``` in order for them to show up on the ``` cdnstyles.com/styles/ ``` page.

Remember to run compass compile after updating ``` _icons.scss ```

#### Adding New FEC Icons

The FEC Icons in VFF are generated in the same way as the icons in FrontEndCentral, but are actually their own set of
icons that are hosted in VFF and allow VFF projects to display FEC-like icons.

There are a few steps that you need to do in order to add an icon:

Copy and paste the new svg(s) into src/static/icons.
Ensure that the names of the files are all lower-case separated by hyphens (these will be used to name your icon class).
Add the icon to src/templates/style_guide/fec_icons.html in the same way that the other icons are. (This displays the icon in the documentation at <VFF_URL>/styles/fec-icons/).
Run gulp generate_icons
Run gulp compile to recompile the css.
Your icons should now be added properly; however, there are a few validation steps:

Ensure that src/static/sass/fec-icons.scss has created the icon class and variable.
Go to localhost:8087/styles/fec-icons/ and ensure your new icons (and the existing icons) are displaying correctly.
Note: Be sure to add the generated eot/svg/ttf/wof files in src/static/fonts/fec to your commit
