Giter Club home page Giter Club logo

nette-macro-fontawesome's Introduction

This repo is discontinued - for Latte3 and PHP8.1 you should look here: https://github.com/kravcik/latte-font-awesome-icon

Simple macro for generating Font Awesome icons. First parameter is required. Parameters can be set in order or randomly with string keys (macro detects if it's getting an associative array).

Version 2.0.0

It's compatible with FontAwesome 5, but default style is set to light. Best option would be to create multiple macros or a static variable to set default style. Send me a PR or create an issue if you need this.

Thanks to @peldax it's also possible to change the html element. Default is span.

Register to config.neon

latte:
    macros:
        - Kravcik\Macros\FontAwesomeMacro::install

Parameters

  1. icon - icon name without fa-
  2. color - color (blue, red-dark, etc.)
  3. size - number (generates fa-{size}x) or sm, lg, etc.
  4. fw - if TRUE, disable fa-fw
  5. style - fas / far / fal / fab

Examples

{icon star, 'el' => 'i'} -> <i class="fal fa-star fa-fw"></i>

{icon star} -> <span class="fal fa-star fa-fw"></span>

{icon star, red} -> <span class="fal fa-star color-red fa-fw"></span>

{icon star, NULL, lg} -> <span class="fal fa-star fa-lg fa-fw"></span>

{icon star, yellow, 2} -> <span class="fal fa-star color-yellow fa-2x fa-fw"></span>

{icon star, blue, 2, TRUE, far} -> <span class="far fa-star color-blue fa-2x"></span>

{icon star, size => 2, fw => TRUE, color => 'green-light', style => 'fas'} -> <span class="fas fa-star color-green-light fa-2x"></span>

Versions

Package PHP Nette Font Awesome Bootstrap
v4 >=8.0 >=3.0 5 4
v3 >=7.3 >=3.0 5 4
v2 >=7.1 >=2.4 5 3
v1 >=5.6 >=2.4 4 3

nette-macro-fontawesome's People

Contributors

dependabot[bot] avatar kravcik avatar peldax avatar spulakk avatar vodictomas avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.