@energycap/energycap-icons
TypeScript icon, indicating that this package has built-in type declarations

4.3.3 • Public • Published

EnergyCAP Icons

Icon library to use with EnergyCAP software projects.

Usage

Install the package from npm

npm install @energycap/energycap-icons

⚠️ This package includes a peer dependency of Font Awesome Pro. You must have a pro account in order to download the necessary dependencies.

npm install @fortawesome/energycap-icons

Angular Projects

SVGs

  1. Import the EnergyCapIconsModule.

    @NgModule({
        declarations: [
        AppComponent
        ],
        imports: [
        CommonModule,
        EnergyCapIconsModule
        ],
        providers: [],
        bootstrap: [AppComponent]
    })
    export class AppModule { }
  2. In your templates, use the following snippet

    <ec-icon icon="icon-delete"></ec-icon>

Webfont

  1. Add webfonts directory to assets configuration under your project in angular.json

    ...
    "assets": [
        {
            "glob": "**/*",
            "input": "node_modules/@fortawesome/fontawesome-pro/webfonts",
            "output": "./assets/webfonts"
        }
    ],
    ...
  2. Add library css to the styles configuration under your project in angular.json

    ...
    "styles": [
        "node_modules/@energycap/energycap-icons/energycap-icons.min.css"
    ],
    ...
  3. In your templates, use the following snippet

    <i class="ec-icon icon-delete"></i>

Basic CSS with webfont (Non-Angular projects)

  1. Copy webfonts directory from @fortawesome/fontawesome-pro to an assets folder at the root of your website

  2. Add the energycap-icons.min.css file in the <head> of your website pages

    <link rel="stylesheet" href="path/to/energycap-icons.min.css">
  3. Reference icons in your html

    <i class="ec-icon icon-delete"></i>

Advanced

Sizes

Apply predefined size classes to modify the font size of a single icon.

<!-- Webfont -->
<i class="ec-icon icon-delete ec-icon-md"></i>
<!-- Angular -->
<ec-icon class="ec-icon-md" icon="icon-delete"></ec-icon>

Available sizes are xs(.625rem), sm(.75rem), md(1.5rem), and lg(3rem)

To set the font size to a custom value use the style attribute or a custom css class

If the icon is combined with other text, use the .icon-font-size-inherit utility to set the icon font size to the same font size of the surrounding text.

<p><i class="icon-warning icon-font-size-inherit"></i> CAUTION. Icons at work.</p>

Modifiers

If an icon is a single color, it's default color is rgba(26, 26, 35, 0.66). Icon color can be set to the current color of its parent element with the .icon-color-current utility.

<p style="color: red;"><i class="icon-error icon-color-current"></i> ERROR. Something went wrong!</p>

Icons be flipped and rotated with the following utility classes

  • .flip-y
  • .flip-x
  • .rotate-90
  • .rotate-180
  • .rotate-270

Chargeback

EnergyCAP commodity and account icons have special overlays for when a meter or account has chargeback properties. These are overlays are applied with a collection of chargeback classes.

<i class="icon-commodity-electric is-master is-recipient"></i>

Readme

Keywords

none

Package Sidebar

Install

npm i @energycap/energycap-icons

Weekly Downloads

1

Version

4.3.3

License

SEE LICENSE IN LICENSE file

Unpacked Size

1.98 MB

Total Files

26

Last publish

Collaborators

  • energycapadmin
  • choudeshell
  • ecap-steveclewell
  • drm224