2.0.3 • Published 7 years ago

@vendasta/fec-icon v2.0.3

Weekly downloads
9
License
ISC
Repository
-
Last release
7 years ago

icon

Description

A simple HTML generator that appropriately applies a class name to a <span>, so as to allow CSS to insert an icon character using a supplied web font.

Requirements

Each icon you want to represent as a <va-icon> element must be available as CSS class name in the styles available to the page when it's rendered in the browser.

This typically means ensuring your HTML document is loading a CSS file that loads a font stack and maps each character to a class, with a …:before {content: …} style rule for each icon class. If you are using the material icons by using the material prefix, you should link the font from Google via their recommended link <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

Example CSS:

@font-face {
  font-family: 'fec-icons';
  src: url("../fonts/icons_1465248177255.eot"); }

.fec-icon:before {
  display: inline-block;
  font-family: 'fec-icons'; }

.fec-icon-pdf:before {
  content: '\E018'; }

.fec-icon-phone:before {
  content: '\E019'; }

Usage

When rendered, the component provides a span with class attribute set for the icon set. The icon name will also be in the class if using Vendasta icons, or the content of the span if using Material icons.

  • Use <va-icon [iconClass]="'icon-pdf'"></va-icon> in your component or app template markup, where icon-pdf is any icon class in your loaded Vendasta styles.
  • If using material icons directly, use <va-icon [iconClass]="'material:dashboard'"></va-icon> in your component or app template markup, where material is specifying that the material-icons class should be used, and dashboard corresponds to a valid icon in the Material icon set.
  • Add IconModule to the NgModule imports in whichever Angular2 module wil be using <va-icon> in its template.

Example:

<va-icon [iconClass]="'icon-pdf'"></va-icon>
<va-icon [iconClass]="'material:dashboard'"></va-icon>

Live example (if you are viewing this on the live demo site)

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.1.0

7 years ago

1.0.0

8 years ago

0.1.0

8 years ago

0.0.14

8 years ago

0.0.13

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago